Image Component Library (ICL)
|
Wrapper for an OpenCL Kernel. More...
#include <CLKernel.h>
Classes | |
struct | Arg |
Utility structure for the CLKernel's index operator. More... | |
struct | LocalMemory |
struct that represents the dynamic local memory for a kernel More... | |
Public Member Functions | |
CLKernel () | |
Default constructor (creates a dummy instance) | |
CLKernel (const CLKernel &other) | |
copy constructor (creates shallow copy) | |
CLKernel const & | operator= (CLKernel const &other) |
assignment operator (creates shallow copy) | |
~CLKernel () | |
Destructor. | |
void | apply (int gloW, int gloH=0, int gloC=0, int locW=0, int locH=0, int locC=0) throw (CLKernelException) |
executes kernel with given global and local coordinates | |
void | setArg (const unsigned idx, const unsigned int &value) throw (CLKernelException) |
Overloaded Kernel argument setter for unsigned int values. | |
void | setArg (const unsigned idx, const int &value) throw (CLKernelException) |
Overloaded Kernel argument setter for int values. | |
void | setArg (const unsigned idx, const short &value) throw (CLKernelException) |
Overloaded Kernel argument setter for short values. | |
void | setArg (const unsigned idx, const long &value) throw (CLKernelException) |
Overloaded Kernel argument setter for long values. | |
void | setArg (const unsigned idx, const unsigned long &value) throw (CLKernelException) |
Overloaded Kernel argument setter for unsigned long values. | |
void | setArg (const unsigned idx, const float &value) throw (CLKernelException) |
Overloaded Kernel argument setter for float values. | |
void | setArg (const unsigned idx, const double &value) throw (CLKernelException) |
Overloaded Kernel argument setter for double values. | |
void | setArg (const unsigned idx, const char &value) throw (CLKernelException) |
Overloaded Kernel argument setter for char values. | |
void | setArg (const unsigned idx, const unsigned char &value) throw (CLKernelException) |
Overloaded Kernel argument setter for unsigned char values. | |
void | setArg (const unsigned idx, const FixedArray< float, 4 > &value) throw (CLKernelException) |
Overloaded Kernel argument setter for 4D vectors. | |
void | setArg (const unsigned idx, const FixedArray< float, 3 > &value) throw (CLKernelException) |
Overloaded Kernel argument setter for 3D vectors. | |
void | setArg (const unsigned idx, const CLBuffer &value) throw (CLKernelException) |
Overloaded Kernel argument setter for CLBuffer values (aka arrays/pointers) | |
void | setArg (const unsigned idx, const CLImage2D &value) throw (CLKernelException) |
Overloaded Kernel argument setter for CLImage2D values (aka arrays/pointers) | |
void | setArg (const unsigned idx, const LocalMemory &value) throw (CLKernelException) |
Overloaded Kernel argument setter for dynamic local memory. | |
template<typename A > | |
void | setArgs (const A &value) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B > | |
void | setArgs (const A &valueA, const B &valueB) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I , typename J > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI, const J &valueJ) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I , typename J , typename K > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI, const J &valueJ, const K &valueK) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I , typename J , typename K , typename L > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI, const J &valueJ, const K &valueK, const L &valueL) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I , typename J , typename K , typename L , typename M > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI, const J &valueJ, const K &valueK, const L &valueL, const M &valueM) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I , typename J , typename K , typename L , typename M , typename N > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI, const J &valueJ, const K &valueK, const L &valueL, const M &valueM, const N &valueN) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I , typename J , typename K , typename L , typename M , typename N , typename O > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI, const J &valueJ, const K &valueK, const L &valueL, const M &valueM, const N &valueN, const O &valueO) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I , typename J , typename K , typename L , typename M , typename N , typename O , typename P > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI, const J &valueJ, const K &valueK, const L &valueL, const M &valueM, const N &valueN, const O &valueO, const P &valueP) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I , typename J , typename K , typename L , typename M , typename N , typename O , typename P , typename Q > | |
void | setArgs (const A &valueA, const B &valueB, const C &valueC, const D &valueD, const E &valueE, const F &valueF, const G &valueG, const H &valueH, const I &valueI, const J &valueJ, const K &valueK, const L &valueL, const M &valueM, const N &valueN, const O &valueO, const P &valueP, const Q &valueQ) throw (CLKernelException) |
sets mutiple kernel arguments at once | |
Arg | operator[] (int idx) |
for index operator-based setting of kernel arguments | |
Private Member Functions | |
CLKernel (const string &id, cl::Program &program, cl::CommandQueue &cmdQueue) throw (CLKernelException) | |
private constructor (CLKernel instances can only be created by CLPrograms) | |
Private Attributes | |
Impl * | impl |
internal implementation | |
Friends | |
class | CLProgram |
for tight integration with the CLProgram class |
Wrapper for an OpenCL Kernel.
A Kernel is a callable OpenCL function. CLKernel instances can only be created by CLProgram instances. Please refer to the CLProgram reference for further details.
Before, a Kernel (aka an OpenCL function) is called, its arguments have to be set. This can either be done step by step using one of the overloaded CLKernel.setArg-methods or using the assignment operator or with the templated CLKernel::setArgs method.
kernel.setArgs(inBuffer, outBuffer, inSize, outSize);
or: kernel[0] = inBuffer; kernel[1] = outBuffer; kernel[2] = inSize; kernel[3] = outSize;
icl::utils::CLKernel::CLKernel | ( | const string & | id, |
cl::Program & | program, | ||
cl::CommandQueue & | cmdQueue | ||
) | throw (CLKernelException) [private] |
private constructor (CLKernel instances can only be created by CLPrograms)
Default constructor (creates a dummy instance)
icl::utils::CLKernel::CLKernel | ( | const CLKernel & | other | ) |
copy constructor (creates shallow copy)
Destructor.
void icl::utils::CLKernel::apply | ( | int | gloW, |
int | gloH = 0 , |
||
int | gloC = 0 , |
||
int | locW = 0 , |
||
int | locH = 0 , |
||
int | locC = 0 |
||
) | throw (CLKernelException) |
executes kernel with given global and local coordinates
gloW can be accessed in the kernel code by get_global_id(0), and so on
assignment operator (creates shallow copy)
Arg icl::utils::CLKernel::operator[] | ( | int | idx | ) | [inline] |
for index operator-based setting of kernel arguments
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const unsigned int & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for unsigned int values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const int & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for int values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const short & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for short values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const long & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for long values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const unsigned long & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for unsigned long values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const float & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for float values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const double & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for double values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const char & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for char values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const unsigned char & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for unsigned char values.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const FixedArray< float, 4 > & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for 4D vectors.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const FixedArray< float, 3 > & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for 3D vectors.
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const CLBuffer & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for CLBuffer values (aka arrays/pointers)
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const CLImage2D & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for CLImage2D values (aka arrays/pointers)
void icl::utils::CLKernel::setArg | ( | const unsigned | idx, |
const LocalMemory & | value | ||
) | throw (CLKernelException) |
Overloaded Kernel argument setter for dynamic local memory.
void icl::utils::CLKernel::setArgs | ( | const A & | value | ) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI, | ||
const J & | valueJ | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI, | ||
const J & | valueJ, | ||
const K & | valueK | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI, | ||
const J & | valueJ, | ||
const K & | valueK, | ||
const L & | valueL | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI, | ||
const J & | valueJ, | ||
const K & | valueK, | ||
const L & | valueL, | ||
const M & | valueM | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI, | ||
const J & | valueJ, | ||
const K & | valueK, | ||
const L & | valueL, | ||
const M & | valueM, | ||
const N & | valueN | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI, | ||
const J & | valueJ, | ||
const K & | valueK, | ||
const L & | valueL, | ||
const M & | valueM, | ||
const N & | valueN, | ||
const O & | valueO | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI, | ||
const J & | valueJ, | ||
const K & | valueK, | ||
const L & | valueL, | ||
const M & | valueM, | ||
const N & | valueN, | ||
const O & | valueO, | ||
const P & | valueP | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
void icl::utils::CLKernel::setArgs | ( | const A & | valueA, |
const B & | valueB, | ||
const C & | valueC, | ||
const D & | valueD, | ||
const E & | valueE, | ||
const F & | valueF, | ||
const G & | valueG, | ||
const H & | valueH, | ||
const I & | valueI, | ||
const J & | valueJ, | ||
const K & | valueK, | ||
const L & | valueL, | ||
const M & | valueM, | ||
const N & | valueN, | ||
const O & | valueO, | ||
const P & | valueP, | ||
const Q & | valueQ | ||
) | throw (CLKernelException) [inline] |
sets mutiple kernel arguments at once
Impl* icl::utils::CLKernel::impl [private] |
internal implementation
internally used data