ImFusion SDK 4.3
ClKernel Class Reference

#include <ImFusion/CL/ClKernel.h>

OpenCL kernel class. More...

Detailed Description

OpenCL kernel class.

Public Member Functions

 ClKernel (const ClProgram &program, const std::string &name, ClEnvironment *env=0)
 Construct kernel from program object and kernel name.
 
bool isValid () const
 
unsigned int workgroupSize () const
 
unsigned long long localMemSize () const
 
int setLocalArgument (int idx, int size)
 Set local kernel argument.
 
int setNullArgument (int idx)
 Set a cl_mem kernel argument (i.e. a buffer or an image) to NULL.
 
void finish () const
 This is a convenience function. The proper place for this is on the command queue.
 
void * kernel () const
 
template<typename T>
int setArgument (int idx, const T &arg)
 Set kernel argument.
 
template<typename T>
int setArgument (int idx, const T *arg, int entries)
 
int run (const std::vector< ClEvent * > *waitEvents=0, ClEvent **event=0) const
 
int run (unsigned int dim, unsigned int *globalWorkSize, unsigned int *localWorkSize, const std::vector< ClEvent * > *waitEvents=0, ClEvent **event=0) const
 
int run (unsigned int dim, unsigned int *desiredGlobalWorkSize, const std::vector< ClEvent * > *waitEvents=0, ClEvent **event=0) const
 Convenience function for specifying desired size of global work size. The kernel computes the required global and local work size.
 
void computeKernelWorkSize (int dim, unsigned int *globalWorkSize, unsigned int *localWorkSize=0) const
 Compute global and local work size for kernel.
 
void computeKernelWorkSize (const ImageDescriptor &desc) const
 Define kernel work group dimension and size from the provided image descriptor.
 
void computeKernelWorkSize (const Image &desc) const
 
template<typename T>
getKernelWorkgroupInfo (unsigned int name, int *ret=0) const
 
template<typename T>
std::vector< T > getKernelWorkgroupInfoVector (unsigned int name, int *ret=0) const
 
template<typename T>
getKernelInfo (unsigned int name, int *ret=0) const
 
template<typename T>
std::vector< T > getKernelInfoVector (unsigned int name, int *ret=0) const
 

Protected Member Functions

int setMatrixArgument (int idx, const float *ptr, int width, int height)
 Auxiliary method to set float matrix kernel arguments of arbitrary size.
 

Protected Attributes

ClEnvironmentm_env
 
const ClProgramm_program
 
unsigned int m_dim
 
unsigned int m_globalWorkSize [3]
 
unsigned int m_localWorkSize [3]
 
std::map< int, ClImage * > m_args
 
ImplData * m_d
 

Member Function Documentation

◆ computeKernelWorkSize()

void computeKernelWorkSize ( int dim,
unsigned int * globalWorkSize,
unsigned int * localWorkSize = 0 ) const

Compute global and local work size for kernel.

globalWorkSize is an input/output parameter: the input is the desired global work size while the output is the adjusted global work size which is a multiple of the computed local work size


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close