10 #ifndef vtk_m_cont_cuda_internal_RuntimeDeviceConfigurationCuda_h
11 #define vtk_m_cont_cuda_internal_RuntimeDeviceConfigurationCuda_h
19 VTKM_THIRDPARTY_PRE_INCLUDE
21 VTKM_THIRDPARTY_POST_INCLUDE
33 class RuntimeDeviceConfiguration<
vtkm::cont::DeviceAdapterTagCuda>
34 :
public vtkm::cont::internal::RuntimeDeviceConfigurationBase
37 RuntimeDeviceConfiguration<vtkm::cont::DeviceAdapterTagCuda>()
41 this->CudaDeviceCount = tmp;
42 this->CudaProp.resize(this->CudaDeviceCount);
43 for (
int i = 0; i < this->CudaDeviceCount; ++i)
51 return vtkm::cont::DeviceAdapterTagCuda{};
54 VTKM_CONT virtual RuntimeDeviceConfigReturnCode SetDeviceInstance(
55 const vtkm::Id& value)
override final
57 if (value >= this->CudaDeviceCount)
61 "Failed to set CudaDeviceInstance, supplied id exceeds the number of available devices: "
62 << value <<
" >= " << this->CudaDeviceCount);
63 return RuntimeDeviceConfigReturnCode::INVALID_VALUE;
66 return RuntimeDeviceConfigReturnCode::SUCCESS;
69 VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetDeviceInstance(
70 vtkm::Id& value)
const override final
75 return RuntimeDeviceConfigReturnCode::SUCCESS;
78 VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetMaxDevices(
79 vtkm::Id& value)
const override final
81 value = this->CudaDeviceCount;
82 return RuntimeDeviceConfigReturnCode::SUCCESS;
88 GetCudaDeviceProp(std::vector<cudaDeviceProp>& value)
const
91 return RuntimeDeviceConfigReturnCode::SUCCESS;
95 std::vector<cudaDeviceProp> CudaProp;
102 #endif //vtk_m_cont_cuda_internal_RuntimeDeviceConfigurationCuda_h