mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Use thrust::swap for vtkm::Swap in CUDA device code.
This commit is contained in:
parent
7158d56cdc
commit
cc631650c5
@ -23,7 +23,11 @@
|
|||||||
|
|
||||||
#include <vtkm/internal/ExportMacros.h>
|
#include <vtkm/internal/ExportMacros.h>
|
||||||
|
|
||||||
|
#ifdef __CUDACC__
|
||||||
|
#include <thrust/swap.h>
|
||||||
|
#else
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace vtkm
|
namespace vtkm
|
||||||
{
|
{
|
||||||
@ -33,9 +37,8 @@ namespace vtkm
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
VTKM_EXEC_CONT void Swap(T& a, T& b)
|
VTKM_EXEC_CONT void Swap(T& a, T& b)
|
||||||
{
|
{
|
||||||
T tmp = a;
|
using namespace thrust;
|
||||||
a = b;
|
swap(a, b);
|
||||||
b = tmp;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user