VTK-m  2.0
Classes | Functions
vtkm::cont::cuda Namespace Reference

CUDA implementation for Control Environment. More...

Classes

class  ErrorCuda
 This error is thrown whenever an unidentified CUDA runtime error is encountered. More...
 
struct  ScheduleParameters
 Represents how to schedule 1D, 2D, and 3D Cuda kernels. More...
 

Functions

VTKM_CONT_EXPORT void InitScheduleParameters (vtkm::cont::cuda::ScheduleParameters(*)(char const *name, int major, int minor, int multiProcessorCount, int maxThreadsPerMultiProcessor, int maxThreadsPerBlock))
 Specify the custom scheduling to use for VTK-m CUDA kernel launches. More...
 

Detailed Description

CUDA implementation for Control Environment.

vtkm::cont::cuda includes the code to implement the VTK-m Control Environment for the CUDA-based device adapter.

Function Documentation

◆ InitScheduleParameters()

VTKM_CONT_EXPORT void vtkm::cont::cuda::InitScheduleParameters ( vtkm::cont::cuda::ScheduleParameters(*)(char const *name, int major, int minor, int multiProcessorCount, int maxThreadsPerMultiProcessor, int maxThreadsPerBlock)  )

Specify the custom scheduling to use for VTK-m CUDA kernel launches.

By default VTK-m uses a preset table based on the GPU's found at runtime to determine the best scheduling parameters for a worklet. When these defaults are insufficient for certain projects it is possible to override the defaults by binding a custom function to InitScheduleParameters.

Note: The this function must be called before any invocation of any worklets by VTK-m.

Note: This function will be called for each GPU on a machine.

ScheduleParameters CustomScheduleValues(char const* name,
int major,
int minor,
int multiProcessorCount,
int maxThreadsPerMultiProcessor,
int maxThreadsPerBlock)
{
ScheduleParameters params {
64 * multiProcessorCount, //1d blocks
64, //1d threads per block
64 * multiProcessorCount, //2d blocks
{ 8, 8, 1 }, //2d threads per block
64 * multiProcessorCount, //3d blocks
{ 4, 4, 4 } }; //3d threads per block
return params;
}