Skip to content
Snippets Groups Projects
Commit c5b72c9d authored by Sujin Philip's avatar Sujin Philip Committed by Kitware Robot
Browse files

Merge topic 'fix-cuda-interop'


8d62bf12 Fix cuda-opengl interop

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Acked-by: default avatarKenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2528
parents d2df97cc 8d62bf12
Branches
Tags
2 merge requests!2615Draft: DONTMERGE ME: TEST FOR 1.7.0-rc1 is our 9th official release of VTK-m.,!2528Fix cuda-opengl interop
Pipeline #237428 failed
......@@ -79,7 +79,7 @@ public:
void Map()
{
//map the resource into cuda, so we can copy it
cudaError_t cError = cudaGraphicsMapResources(1, &this->CudaResource);
cudaError_t cError = cudaGraphicsMapResources(1, &this->CudaResource, cudaStreamPerThread);
if (cError != cudaSuccess)
{
throw vtkm::cont::ErrorBadAllocation(
......@@ -106,7 +106,7 @@ public:
return pointer;
}
void UnMap() { cudaGraphicsUnmapResources(1, &this->CudaResource); }
void UnMap() { cudaGraphicsUnmapResources(1, &this->CudaResource, cudaStreamPerThread); }
private:
bool Registered;
......@@ -182,7 +182,8 @@ public:
this->Resource->Map();
ValueType* beginPointer = this->Resource->GetMappedPoiner<ValueType>(size);
auto deviceMemory = vtkm::cont::make_ArrayHandle(beginPointer, size, vtkm::CopyFlag::Off);
vtkm::cont::ArrayHandleBasic<ValueType> deviceMemory(
beginPointer, handle.GetNumberOfValues(), DeviceAdapterTag{}, [](void*) {});
//Do a device to device memory copy
vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapterTag>::Copy(handle, deviceMemory);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment