23 #ifndef itkGPUKernelManager_h
24 #define itkGPUKernelManager_h
70 cl_kernel_work_group_info paramName,
void *value);
73 size_t argSize,
void *argValue);
75 bool SetKernelArg(
int kernelIdx, cl_uint argIdx,
size_t argSize,
const void* argVal);
83 template<
typename TGPUImageDataManager >
85 int kernelIdx, cl_uint &argIdx,
86 TGPUImageDataManager *manager)
94 manager->GetGPUBufferPointer() );
105 manager->GetGPUBufferedRegionIndex()->GetGPUBufferPointer() );
114 manager->GetGPUBufferedRegionSize()->GetGPUBufferPointer() );
124 bool LaunchKernel(
int kernelIdx,
int dim,
size_t *globalWorkSize,
size_t *localWorkSize);
126 bool LaunchKernel1D(
int kernelIdx,
size_t globalWorkSize,
size_t localWorkSize);
129 size_t globalWorkSizeX,
size_t globalWorkSizeY,
130 size_t localWorkSizeX,
size_t localWorkSizeY );
133 size_t globalWorkSizeX,
size_t globalWorkSizeY,
size_t globalWorkSizeZ,
134 size_t localWorkSizeX,
size_t localWorkSizeY,
size_t localWorkSizeZ );
bool SetKernelArgWithImage(int kernelIdx, cl_uint argIdx, GPUDataManager::Pointer manager)
Light weight base class for most itk classes.
bool CheckArgumentReady(int kernelIdx)
std::vector< std::vector< KernelArgumentList > > m_KernelArgumentReady
bool LoadProgramFromFile(const char *filename, const char *cPreamble="")
int CreateKernel(const char *kernelName)
bool SetKernelArg(int kernelIdx, cl_uint argIdx, vcl_size_t argSize, const void *argVal)
std::vector< cl_kernel > m_KernelContainer
bool LoadProgramFromString(const char *cSource, const char *cPreamble="")
cl_int GetDeviceInfo(cl_kernel_work_group_info paramName, vcl_size_t argSize, void *argValue)
GPU kernel manager implemented using OpenCL.
~GPUKernelManager() override
cl_int GetKernelWorkGroupInfo(int kernelIdx, cl_kernel_work_group_info paramName, void *value)
bool LaunchKernel3D(int kernelIdx, vcl_size_t globalWorkSizeX, vcl_size_t globalWorkSizeY, vcl_size_t globalWorkSizeZ, vcl_size_t localWorkSizeX, vcl_size_t localWorkSizeY, vcl_size_t localWorkSizeZ)
bool LaunchKernel1D(int kernelIdx, vcl_size_t globalWorkSize, vcl_size_t localWorkSize)
void OpenCLCheckError(cl_int error, const char *filename="", int lineno=0, const char *location="")
GPUContextManager * m_Manager
Singleton class to store the GPU context.
GPUDataManager::Pointer m_GPUDataManager
int GetCurrentCommandQueueID()
void SetCurrentCommandQueue(int queueid)
void ResetArguments(int kernelIdx)
bool LaunchKernel(int kernelIdx, int dim, vcl_size_t *globalWorkSize, vcl_size_t *localWorkSize)
bool LaunchKernel2D(int kernelIdx, vcl_size_t globalWorkSizeX, vcl_size_t globalWorkSizeY, vcl_size_t localWorkSizeX, vcl_size_t localWorkSizeY)
bool SetKernelArgWithImageAndBufferedRegion(int kernelIdx, cl_uint &argIdx, TGPUImageDataManager *manager)