Merge branch 'make_sure_to_use_cuda_execution_policy' into 'master'

All occurrences of thrust invocation uses an execution policy.

See merge request !162
This commit is contained in:
Robert Maynard 2015-09-01 20:30:43 -04:00
commit 3980b5966c
2 changed files with 11 additions and 1 deletions

@ -29,6 +29,9 @@ VTKM_THIRDPARTY_PRE_INCLUDE
#include <thrust/system/cuda/vector.h> #include <thrust/system/cuda/vector.h>
#include <thrust/device_malloc_allocator.h> #include <thrust/device_malloc_allocator.h>
#include <thrust/copy.h> #include <thrust/copy.h>
#include <thrust/system/cuda/execution_policy.h>
VTKM_THIRDPARTY_POST_INCLUDE VTKM_THIRDPARTY_POST_INCLUDE
#include <vtkm/exec/cuda/internal/ArrayPortalFromThrust.h> #include <vtkm/exec/cuda/internal/ArrayPortalFromThrust.h>
@ -164,6 +167,7 @@ public:
{ {
storage->Allocate(static_cast<vtkm::Id>(this->Array.size())); storage->Allocate(static_cast<vtkm::Id>(this->Array.size()));
::thrust::copy( ::thrust::copy(
thrust::cuda::par,
this->Array.data(), this->Array.data(),
this->Array.data() + static_cast<difference_type>(this->Array.size()), this->Array.data() + static_cast<difference_type>(this->Array.size()),
vtkm::cont::ArrayPortalToIteratorBegin(storage->GetPortal())); vtkm::cont::ArrayPortalToIteratorBegin(storage->GetPortal()));

@ -28,8 +28,12 @@
#include <vtkm/opengl/internal/TransferToOpenGL.h> #include <vtkm/opengl/internal/TransferToOpenGL.h>
// Disable warnings we check vtkm for but Thrust does not.
VTKM_THIRDPARTY_PRE_INCLUDE
#include <thrust/copy.h> #include <thrust/copy.h>
#include <thrust/device_ptr.h> #include <thrust/device_ptr.h>
#include <thrust/system/cuda/execution_policy.h>
VTKM_THIRDPARTY_POST_INCLUDE
namespace vtkm { namespace vtkm {
namespace opengl { namespace opengl {
@ -123,7 +127,9 @@ public:
//Perhaps a direct call to thrust copy should be wrapped in a vtkm //Perhaps a direct call to thrust copy should be wrapped in a vtkm
//compatble function //compatble function
::thrust::copy(vtkm::cont::cuda::internal::IteratorBegin(portal), ::thrust::copy(
thrust::cuda::par,
vtkm::cont::cuda::internal::IteratorBegin(portal),
vtkm::cont::cuda::internal::IteratorEnd(portal), vtkm::cont::cuda::internal::IteratorEnd(portal),
thrust::cuda::pointer<ValueType>(beginPointer)); thrust::cuda::pointer<ValueType>(beginPointer));