10 #ifndef vtk_m_cont_cuda_internal_RuntimeDeviceConfigurationCuda_h
11 #define vtk_m_cont_cuda_internal_RuntimeDeviceConfigurationCuda_h
34 class RuntimeDeviceConfiguration<
vtkm::cont::DeviceAdapterTagCuda>
35 :
public vtkm::cont::internal::RuntimeDeviceConfigurationBase
38 RuntimeDeviceConfiguration<vtkm::cont::DeviceAdapterTagCuda>()
40 this->CudaDeviceCount = 0;
41 this->CudaProp.clear();
49 this->CudaDeviceCount = tmp;
50 this->CudaProp.resize(this->CudaDeviceCount);
51 for (
int i = 0; i < this->CudaDeviceCount; ++i)
59 "Error retrieving CUDA device information. Disabling.");
60 this->CudaDeviceCount = 0;
70 VTKM_CONT virtual RuntimeDeviceConfigReturnCode SetDeviceInstance(
71 const vtkm::Id& value)
override final
73 if (value >= this->CudaDeviceCount)
77 "Failed to set CudaDeviceInstance, supplied id exceeds the number of available devices: "
78 << value <<
" >= " << this->CudaDeviceCount);
79 return RuntimeDeviceConfigReturnCode::INVALID_VALUE;
82 return RuntimeDeviceConfigReturnCode::SUCCESS;
85 VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetDeviceInstance(
86 vtkm::Id& value)
const override final
91 return RuntimeDeviceConfigReturnCode::SUCCESS;
94 VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetMaxDevices(
95 vtkm::Id& value)
const override final
97 value = this->CudaDeviceCount;
98 return RuntimeDeviceConfigReturnCode::SUCCESS;
104 GetCudaDeviceProp(std::vector<cudaDeviceProp>& value)
const
107 return RuntimeDeviceConfigReturnCode::SUCCESS;
111 std::vector<cudaDeviceProp> CudaProp;
118 #endif //vtk_m_cont_cuda_internal_RuntimeDeviceConfigurationCuda_h