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