ITK  5.2.0
Insight Toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
itk::GPUKernelManager Class Reference

#include <itkGPUKernelManager.h>

+ Inheritance diagram for itk::GPUKernelManager:
+ Collaboration diagram for itk::GPUKernelManager:

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

virtual ::itk::LightObject::Pointer CreateAnother () const
 
int CreateKernel (const char *kernelName)
 
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)
 
virtual const char * GetNameOfClass () const
 
bool LoadProgramFromFile (const char *filename, const char *cPreamble="")
 
bool LoadProgramFromString (const char *cSource, const char *cPreamble="")
 
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)
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
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 ()
 
cl_program m_Program
 
GPUContextManagerm_Manager
 
int m_CommandQueueId
 
std::vector< cl_kernel > m_KernelContainer
 
std::vector< std::vector< KernelArgumentList > > m_KernelArgumentReady
 
template<typename TGPUImageDataManager >
bool SetKernelArgWithImageAndBufferedRegion (int kernelIdx, cl_uint &argIdx, TGPUImageDataManager *manager)
 
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)
 
void SetCurrentCommandQueue (int queueid)
 
int GetCurrentCommandQueueID () const
 
 GPUKernelManager ()
 
 ~GPUKernelManager () override
 
bool CheckArgumentReady (int kernelIdx)
 
void ResetArguments (int kernelIdx)
 
template<typename TArg >
bool SetTypedKernelArg (int kernelIdx, cl_uint argIdx, TArg argVal)
 

Additional Inherited Members

- 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 ()
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

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.

Member Typedef Documentation

◆ ConstPointer

Definition at line 58 of file itkGPUKernelManager.h.

◆ Pointer

Definition at line 57 of file itkGPUKernelManager.h.

◆ Self

Definition at line 55 of file itkGPUKernelManager.h.

◆ Superclass

Definition at line 56 of file itkGPUKernelManager.h.

Constructor & Destructor Documentation

◆ GPUKernelManager()

itk::GPUKernelManager::GPUKernelManager ( )
protected

Pass to GPU both the pixel buffer and the buffered region.

◆ ~GPUKernelManager()

itk::GPUKernelManager::~GPUKernelManager ( )
overrideprotected

Pass to GPU both the pixel buffer and the buffered region.

Member Function Documentation

◆ CheckArgumentReady()

bool itk::GPUKernelManager::CheckArgumentReady ( int  kernelIdx)
protected

Pass to GPU both the pixel buffer and the buffered region.

◆ CreateAnother()

virtual::itk::LightObject::Pointer itk::GPUKernelManager::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::LightObject.

◆ CreateKernel()

int itk::GPUKernelManager::CreateKernel ( const char *  kernelName)

◆ GetCurrentCommandQueueID()

int itk::GPUKernelManager::GetCurrentCommandQueueID ( ) const

Pass to GPU both the pixel buffer and the buffered region.

◆ GetDeviceInfo()

cl_int itk::GPUKernelManager::GetDeviceInfo ( cl_kernel_work_group_info  paramName,
vcl_size_t  argSize,
void *  argValue 
)

◆ GetKernelWorkGroupInfo()

cl_int itk::GPUKernelManager::GetKernelWorkGroupInfo ( int  kernelIdx,
cl_kernel_work_group_info  paramName,
void *  value 
)

◆ GetNameOfClass()

virtual const char* itk::GPUKernelManager::GetNameOfClass ( ) const
virtual

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.

◆ LaunchKernel()

bool itk::GPUKernelManager::LaunchKernel ( int  kernelIdx,
int  dim,
vcl_size_t *  globalWorkSize,
vcl_size_t *  localWorkSize 
)

Pass to GPU both the pixel buffer and the buffered region.

◆ LaunchKernel1D()

bool itk::GPUKernelManager::LaunchKernel1D ( int  kernelIdx,
vcl_size_t  globalWorkSize,
vcl_size_t  localWorkSize 
)

Pass to GPU both the pixel buffer and the buffered region.

◆ LaunchKernel2D()

bool itk::GPUKernelManager::LaunchKernel2D ( int  kernelIdx,
vcl_size_t  globalWorkSizeX,
vcl_size_t  globalWorkSizeY,
vcl_size_t  localWorkSizeX,
vcl_size_t  localWorkSizeY 
)

Pass to GPU both the pixel buffer and the buffered region.

◆ LaunchKernel3D()

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 
)

Pass to GPU both the pixel buffer and the buffered region.

◆ LoadProgramFromFile()

bool itk::GPUKernelManager::LoadProgramFromFile ( const char *  filename,
const char *  cPreamble = "" 
)

◆ LoadProgramFromString()

bool itk::GPUKernelManager::LoadProgramFromString ( const char *  cSource,
const char *  cPreamble = "" 
)

◆ New()

static Pointer itk::GPUKernelManager::New ( )
static

◆ ResetArguments()

void itk::GPUKernelManager::ResetArguments ( int  kernelIdx)
protected

Pass to GPU both the pixel buffer and the buffered region.

◆ SetCurrentCommandQueue()

void itk::GPUKernelManager::SetCurrentCommandQueue ( int  queueid)

Pass to GPU both the pixel buffer and the buffered region.

◆ SetKernelArg()

bool itk::GPUKernelManager::SetKernelArg ( int  kernelIdx,
cl_uint  argIdx,
vcl_size_t  argSize,
const void *  argVal 
)

◆ SetKernelArgWithChar()

bool itk::GPUKernelManager::SetKernelArgWithChar ( int  kernelIdx,
cl_uint  argIdx,
char  argVal 
)

◆ SetKernelArgWithDouble()

bool itk::GPUKernelManager::SetKernelArgWithDouble ( int  kernelIdx,
cl_uint  argIdx,
double  argVal 
)

◆ SetKernelArgWithFloat()

bool itk::GPUKernelManager::SetKernelArgWithFloat ( int  kernelIdx,
cl_uint  argIdx,
float  argVal 
)

◆ SetKernelArgWithImage()

bool itk::GPUKernelManager::SetKernelArgWithImage ( int  kernelIdx,
cl_uint  argIdx,
GPUDataManager manager 
)

◆ SetKernelArgWithImageAndBufferedRegion()

template<typename TGPUImageDataManager >
bool itk::GPUKernelManager::SetKernelArgWithImageAndBufferedRegion ( int  kernelIdx,
cl_uint &  argIdx,
TGPUImageDataManager *  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().

◆ SetKernelArgWithInt()

bool itk::GPUKernelManager::SetKernelArgWithInt ( int  kernelIdx,
cl_uint  argIdx,
int  argVal 
)

◆ SetKernelArgWithLongLong()

bool itk::GPUKernelManager::SetKernelArgWithLongLong ( int  kernelIdx,
cl_uint  argIdx,
long long  argVal 
)

◆ SetKernelArgWithShort()

bool itk::GPUKernelManager::SetKernelArgWithShort ( int  kernelIdx,
cl_uint  argIdx,
short  argVal 
)

◆ SetKernelArgWithUChar()

bool itk::GPUKernelManager::SetKernelArgWithUChar ( int  kernelIdx,
cl_uint  argIdx,
unsigned char  argVal 
)

◆ SetKernelArgWithUInt()

bool itk::GPUKernelManager::SetKernelArgWithUInt ( int  kernelIdx,
cl_uint  argIdx,
unsigned int  argVal 
)

◆ SetKernelArgWithULongLong()

bool itk::GPUKernelManager::SetKernelArgWithULongLong ( int  kernelIdx,
cl_uint  argIdx,
unsigned long long  argVal 
)

◆ SetKernelArgWithUShort()

bool itk::GPUKernelManager::SetKernelArgWithUShort ( int  kernelIdx,
cl_uint  argIdx,
unsigned short  argVal 
)

◆ SetTypedKernelArg()

template<typename TArg >
bool itk::GPUKernelManager::SetTypedKernelArg ( int  kernelIdx,
cl_uint  argIdx,
TArg  argVal 
)
private

Pass to GPU both the pixel buffer and the buffered region.

Member Data Documentation

◆ m_CommandQueueId

int itk::GPUKernelManager::m_CommandQueueId
private

Pass to GPU both the pixel buffer and the buffered region.

Definition at line 204 of file itkGPUKernelManager.h.

◆ m_KernelArgumentReady

std::vector<std::vector<KernelArgumentList> > itk::GPUKernelManager::m_KernelArgumentReady
private

Pass to GPU both the pixel buffer and the buffered region.

Definition at line 207 of file itkGPUKernelManager.h.

Referenced by SetKernelArgWithImageAndBufferedRegion().

◆ m_KernelContainer

std::vector<cl_kernel> itk::GPUKernelManager::m_KernelContainer
private

Pass to GPU both the pixel buffer and the buffered region.

Definition at line 206 of file itkGPUKernelManager.h.

Referenced by SetKernelArgWithImageAndBufferedRegion().

◆ m_Manager

GPUContextManager* itk::GPUKernelManager::m_Manager
private

Pass to GPU both the pixel buffer and the buffered region.

Definition at line 203 of file itkGPUKernelManager.h.

◆ m_Program

cl_program itk::GPUKernelManager::m_Program
private

Pass to GPU both the pixel buffer and the buffered region.

Definition at line 201 of file itkGPUKernelManager.h.


The documentation for this class was generated from the following file: