ITK
6.0.0
Insight Toolkit
|
#include <itkGPUKernelManager.h>
GPU kernel manager implemented using OpenCL.
This class is responsible for managing the GPU kernel and command queue.
Definition at line 44 of file itkGPUKernelManager.h.
Classes | |
struct | KernelArgumentList |
Public Types | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = GPUKernelManager |
using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = LightObject |
Public Member Functions | |
int | CreateKernel (const char *kernelName) |
int | GetCurrentCommandQueueID () const |
cl_int | GetDeviceInfo (cl_kernel_work_group_info paramName, vcl_size_t argSize, void *argValue) |
cl_int | GetKernelWorkGroupInfo (int kernelIdx, cl_kernel_work_group_info paramName, void *value) |
const char * | GetNameOfClass () const override |
bool | LaunchKernel (int kernelIdx, int dim, vcl_size_t *globalWorkSize, vcl_size_t *localWorkSize) |
bool | LaunchKernel1D (int kernelIdx, 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 | 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 | LoadProgramFromFile (const char *filename, const char *cPreamble="") |
bool | LoadProgramFromString (const char *cSource, const char *cPreamble="") |
void | SetCurrentCommandQueue (int queueid) |
bool | SetKernelArg (int kernelIdx, cl_uint argIdx, vcl_size_t argSize, const void *argVal) |
bool | SetKernelArgWithChar (int kernelIdx, cl_uint argIdx, char argVal) |
bool | SetKernelArgWithDouble (int kernelIdx, cl_uint argIdx, double argVal) |
bool | SetKernelArgWithFloat (int kernelIdx, cl_uint argIdx, float argVal) |
bool | SetKernelArgWithImage (int kernelIdx, cl_uint argIdx, GPUDataManager *manager) |
bool | SetKernelArgWithInt (int kernelIdx, cl_uint argIdx, int argVal) |
bool | SetKernelArgWithLongLong (int kernelIdx, cl_uint argIdx, long long argVal) |
bool | SetKernelArgWithShort (int kernelIdx, cl_uint argIdx, short argVal) |
bool | SetKernelArgWithUChar (int kernelIdx, cl_uint argIdx, unsigned char argVal) |
bool | SetKernelArgWithUInt (int kernelIdx, cl_uint argIdx, unsigned int argVal) |
bool | SetKernelArgWithULongLong (int kernelIdx, cl_uint argIdx, unsigned long long argVal) |
bool | SetKernelArgWithUShort (int kernelIdx, cl_uint argIdx, unsigned short argVal) |
template<typename TGPUImageDataManager > | |
bool | SetKernelArgWithImageAndBufferedRegion (int kernelIdx, cl_uint &argIdx, TGPUImageDataManager *manager) |
Public Member Functions inherited from itk::LightObject | |
Pointer | Clone () const |
virtual Pointer | CreateAnother () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
virtual void | Register () const |
virtual void | SetReferenceCount (int) |
virtual void | UnRegister () const noexcept |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
bool | CheckArgumentReady (int kernelIdx) |
GPUKernelManager () | |
void | ResetArguments (int kernelIdx) |
~GPUKernelManager () override | |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintSelf (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Member Functions | |
template<typename TArg > | |
bool | SetTypedKernelArg (int kernelIdx, cl_uint argIdx, TArg argVal) |
Private Attributes | |
int | m_CommandQueueId {} |
std::vector< std::vector< KernelArgumentList > > | m_KernelArgumentReady {} |
std::vector< cl_kernel > | m_KernelContainer {} |
GPUContextManager * | m_Manager {} |
cl_program | m_Program {} |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount {} |
using itk::GPUKernelManager::ConstPointer = SmartPointer<const Self> |
Definition at line 58 of file itkGPUKernelManager.h.
Definition at line 57 of file itkGPUKernelManager.h.
Definition at line 55 of file itkGPUKernelManager.h.
Definition at line 56 of file itkGPUKernelManager.h.
|
protected |
|
overrideprotected |
|
protected |
int itk::GPUKernelManager::CreateKernel | ( | const char * | kernelName | ) |
int itk::GPUKernelManager::GetCurrentCommandQueueID | ( | ) | const |
cl_int itk::GPUKernelManager::GetDeviceInfo | ( | cl_kernel_work_group_info | paramName, |
vcl_size_t | argSize, | ||
void * | argValue | ||
) |
cl_int itk::GPUKernelManager::GetKernelWorkGroupInfo | ( | int | kernelIdx, |
cl_kernel_work_group_info | paramName, | ||
void * | value | ||
) |
|
overridevirtual |
Return the name of this class as a string. Used by the object factory (implemented in New()) to instantiate objects of a named type. Also used for debugging and other output information.
Reimplemented from itk::LightObject.
bool itk::GPUKernelManager::LaunchKernel | ( | int | kernelIdx, |
int | dim, | ||
vcl_size_t * | globalWorkSize, | ||
vcl_size_t * | localWorkSize | ||
) |
bool itk::GPUKernelManager::LaunchKernel1D | ( | int | kernelIdx, |
vcl_size_t | globalWorkSize, | ||
vcl_size_t | localWorkSize | ||
) |
bool itk::GPUKernelManager::LaunchKernel2D | ( | int | kernelIdx, |
vcl_size_t | globalWorkSizeX, | ||
vcl_size_t | globalWorkSizeY, | ||
vcl_size_t | localWorkSizeX, | ||
vcl_size_t | localWorkSizeY | ||
) |
bool itk::GPUKernelManager::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 itk::GPUKernelManager::LoadProgramFromFile | ( | const char * | filename, |
const char * | cPreamble = "" |
||
) |
bool itk::GPUKernelManager::LoadProgramFromString | ( | const char * | cSource, |
const char * | cPreamble = "" |
||
) |
|
static |
|
protected |
void itk::GPUKernelManager::SetCurrentCommandQueue | ( | int | queueid | ) |
bool itk::GPUKernelManager::SetKernelArg | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
vcl_size_t | argSize, | ||
const void * | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithChar | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
char | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithDouble | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
double | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithFloat | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
float | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithImage | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
GPUDataManager * | manager | ||
) |
|
inline |
Pass to GPU both the pixel buffer and the buffered region.
Definition at line 120 of file itkGPUKernelManager.h.
References m_KernelArgumentReady, m_KernelContainer, and itk::OpenCLCheckError().
bool itk::GPUKernelManager::SetKernelArgWithInt | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
int | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithLongLong | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
long long | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithShort | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
short | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithUChar | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
unsigned char | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithUInt | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
unsigned int | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithULongLong | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
unsigned long long | argVal | ||
) |
bool itk::GPUKernelManager::SetKernelArgWithUShort | ( | int | kernelIdx, |
cl_uint | argIdx, | ||
unsigned short | argVal | ||
) |
|
private |
|
private |
Definition at line 206 of file itkGPUKernelManager.h.
|
private |
Definition at line 209 of file itkGPUKernelManager.h.
Referenced by SetKernelArgWithImageAndBufferedRegion().
|
private |
Definition at line 208 of file itkGPUKernelManager.h.
Referenced by SetKernelArgWithImageAndBufferedRegion().
|
private |
Definition at line 205 of file itkGPUKernelManager.h.
|
private |
Definition at line 203 of file itkGPUKernelManager.h.