mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
Correct warnings found by using clang as the host compiler for cuda
This commit is contained in:
parent
0370029f92
commit
b48c19f251
@ -207,8 +207,8 @@ void DeviceAdapterAlgorithm<vtkm::cont::DeviceAdapterTagCuda>::GetBlocksAndThrea
|
||||
int deviceId;
|
||||
VTKM_CUDA_CALL(cudaGetDevice(&deviceId)); //get deviceid from cuda
|
||||
const auto& params = cuda::internal::scheduling_1d_parameters[static_cast<size_t>(deviceId)];
|
||||
blocks = params.first;
|
||||
threadsPerBlock = params.second;
|
||||
blocks = static_cast<vtkm::UInt32>(params.first);
|
||||
threadsPerBlock = static_cast<vtkm::UInt32>(params.second);
|
||||
}
|
||||
|
||||
void DeviceAdapterAlgorithm<vtkm::cont::DeviceAdapterTagCuda>::GetBlocksAndThreads(
|
||||
@ -223,13 +223,13 @@ void DeviceAdapterAlgorithm<vtkm::cont::DeviceAdapterTagCuda>::GetBlocksAndThrea
|
||||
if (size.z <= 1)
|
||||
{ //2d images
|
||||
const auto& params = cuda::internal::scheduling_2d_parameters[static_cast<size_t>(deviceId)];
|
||||
blocks = params.first;
|
||||
blocks = static_cast<vtkm::UInt32>(params.first);
|
||||
threadsPerBlock = params.second;
|
||||
}
|
||||
else
|
||||
{ //3d images
|
||||
const auto& params = cuda::internal::scheduling_3d_parameters[static_cast<size_t>(deviceId)];
|
||||
blocks = params.first;
|
||||
blocks = static_cast<vtkm::UInt32>(params.first);
|
||||
threadsPerBlock = params.second;
|
||||
}
|
||||
}
|
||||
|
@ -145,8 +145,11 @@ void DeviceAdapterMemoryManager<vtkm::cont::DeviceAdapterTagCuda>::CopyHostToDev
|
||||
vtkm::cont::GetHumanReadableSize(static_cast<std::size_t>(size)).c_str(),
|
||||
size);
|
||||
|
||||
VTKM_CUDA_CALL(cudaMemcpyAsync(
|
||||
dest.GetPointer(), src.GetPointer(), size, cudaMemcpyHostToDevice, cudaStreamPerThread));
|
||||
VTKM_CUDA_CALL(cudaMemcpyAsync(dest.GetPointer(),
|
||||
src.GetPointer(),
|
||||
static_cast<std::size_t>(size),
|
||||
cudaMemcpyHostToDevice,
|
||||
cudaStreamPerThread));
|
||||
}
|
||||
}
|
||||
|
||||
@ -203,8 +206,11 @@ void DeviceAdapterMemoryManager<vtkm::cont::DeviceAdapterTagCuda>::CopyDeviceToH
|
||||
vtkm::cont::GetHumanReadableSize(static_cast<std::size_t>(size)).c_str(),
|
||||
size);
|
||||
|
||||
VTKM_CUDA_CALL(cudaMemcpyAsync(
|
||||
dest.GetPointer(), src.GetPointer(), size, cudaMemcpyDeviceToHost, cudaStreamPerThread));
|
||||
VTKM_CUDA_CALL(cudaMemcpyAsync(dest.GetPointer(),
|
||||
src.GetPointer(),
|
||||
static_cast<std::size_t>(size),
|
||||
cudaMemcpyDeviceToHost,
|
||||
cudaStreamPerThread));
|
||||
}
|
||||
|
||||
//In all cases we have possibly multiple async calls queued up in
|
||||
|
@ -22,7 +22,9 @@
|
||||
#include <random>
|
||||
#include <vector>
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include "curand_kernel.h"
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user