23 #ifndef __itkGPUKernelManager_h
24 #define __itkGPUKernelManager_h
69 cl_kernel_work_group_info paramName,
void *value);
72 size_t argSize,
void *argValue);
74 bool SetKernelArg(
int kernelIdx, cl_uint argIdx,
size_t argSize,
const void* argVal);
82 template<
typename TGPUImageDataManager >
84 int kernelIdx, cl_uint &argIdx,
85 TGPUImageDataManager *manager)
93 manager->GetGPUBufferPointer() );
104 manager->GetGPUBufferedRegionIndex()->GetGPUBufferPointer() );
113 manager->GetGPUBufferedRegionSize()->GetGPUBufferPointer() );
123 bool LaunchKernel(
int kernelIdx,
int dim,
size_t *globalWorkSize,
size_t *localWorkSize);
125 bool LaunchKernel1D(
int kernelIdx,
size_t globalWorkSize,
size_t localWorkSize);
128 size_t globalWorkSizeX,
size_t globalWorkSizeY,
129 size_t localWorkSizeX,
size_t localWorkSizeY );
132 size_t globalWorkSizeX,
size_t globalWorkSizeY,
size_t globalWorkSizeZ,
133 size_t localWorkSizeX,
size_t localWorkSizeY,
size_t localWorkSizeZ );
virtual ~GPUKernelManager()
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="")
SmartPointer< Self > Pointer
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="")
void operator=(const Self &)
cl_int GetDeviceInfo(cl_kernel_work_group_info paramName, vcl_size_t argSize, void *argValue)
GPU kernel manager implemented using OpenCL.
SmartPointer< const Self > ConstPointer
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)