From cc631650c5049f9bb3d2637ea3e0da55e7771bb4 Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Mon, 11 Jun 2018 12:27:54 -0400 Subject: [PATCH] Use thrust::swap for vtkm::Swap in CUDA device code. --- vtkm/Swap.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vtkm/Swap.h b/vtkm/Swap.h index b870248d0..233266ad2 100644 --- a/vtkm/Swap.h +++ b/vtkm/Swap.h @@ -23,7 +23,11 @@ #include +#ifdef __CUDACC__ +#include +#else #include +#endif namespace vtkm { @@ -33,9 +37,8 @@ namespace vtkm template VTKM_EXEC_CONT void Swap(T& a, T& b) { - T tmp = a; - a = b; - b = tmp; + using namespace thrust; + swap(a, b); } #else template