![]() |
ImFusion SDK 4.3
|
#include <ImFusion/CL/ClKernel.h>
OpenCL kernel class. More...
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> | |
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> | |
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 | |
ClEnvironment * | m_env |
const ClProgram & | m_program |
unsigned int | m_dim |
unsigned int | m_globalWorkSize [3] |
unsigned int | m_localWorkSize [3] |
std::map< int, ClImage * > | m_args |
ImplData * | m_d |
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