Public Member Functions | Friends

kernel Class Reference

Represents an OpenCL kernel within ViennaCL. More...

#include <kernel.hpp>

Public Member Functions

 kernel ()
 kernel (viennacl::ocl::handle< cl_program > const &prog, std::string const &name)
 kernel (kernel const &other)
viennacl::ocl::kerneloperator= (const kernel &other)
void arg (unsigned int pos, cl_uint val)
 Sets an unsigned integer argument at the provided position.
void arg (unsigned int pos, float val)
 Sets a single precision floating point argument at the provided position.
void arg (unsigned int pos, double val)
 Sets a double precision floating point argument at the provided position.
template<class VCL_TYPE >
void arg (unsigned int pos, VCL_TYPE const &val)
 Sets an OpenCL memory object at the provided position.
template<class CL_TYPE >
void arg (unsigned int pos, viennacl::ocl::handle< CL_TYPE > const &h)
 Sets an OpenCL object at the provided position.
void arg (unsigned int pos, const local_mem &mem)
 Sets an OpenCL local memory object at the provided position.
template<typename T0 >
kerneloperator() (T0 const &t0)
 Convenience function for setting one kernel parameter.
template<typename T0 , typename T1 >
kerneloperator() (T0 const &t0, T1 const &t1)
 Convenience function for setting two kernel parameters.
template<typename T0 , typename T1 , typename T2 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2)
 Convenience function for setting three kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3)
 Convenience function for setting four kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4)
 Convenience function for setting five kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5)
 Convenience function for setting six kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6)
 Convenience function for setting seven kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7)
 Convenience function for setting eight kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8)
 Convenience function for setting nine kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9)
 Convenience function for setting ten kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10)
 Convenience function for setting eleven kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11)
 Convenience function for setting twelve kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12)
 Convenience function for setting thirteen kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13)
 Convenience function for setting fourteen kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14)
 Convenience function for setting fifteen kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14, T15 const &t15)
 Convenience function for setting sixteen kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14, T15 const &t15, T16 const &t16)
 Convenience function for setting seventeen kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14, T15 const &t15, T16 const &t16, T17 const &t17)
 Convenience function for setting eighteen kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14, T15 const &t15, T16 const &t16, T17 const &t17, T18 const &t18)
 Convenience function for setting nineteen kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14, T15 const &t15, T16 const &t16, T17 const &t17, T18 const &t18, T19 const &t19)
 Convenience function for setting twenty kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14, T15 const &t15, T16 const &t16, T17 const &t17, T18 const &t18, T19 const &t19, T20 const &t20)
 Convenience function for setting twentyone kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14, T15 const &t15, T16 const &t16, T17 const &t17, T18 const &t18, T19 const &t19, T20 const &t20, T21 const &t21)
 Convenience function for setting twentytwo kernel parameters.
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 >
kerneloperator() (T0 const &t0, T1 const &t1, T2 const &t2, T3 const &t3, T4 const &t4, T5 const &t5, T6 const &t6, T7 const &t7, T8 const &t8, T9 const &t9, T10 const &t10, T11 const &t11, T12 const &t12, T13 const &t13, T14 const &t14, T15 const &t15, T16 const &t16, T17 const &t17, T18 const &t18, T19 const &t19, T20 const &t20, T21 const &t21, T22 const &t22)
 Convenience function for setting twentythree kernel parameters.
size_t local_work_size (int index=0) const
 Returns the local work size at the respective dimension.
size_t global_work_size (int index=0) const
 Returns the global work size at the respective dimension.
void local_work_size (int index, size_t s)
 Sets the local work size at the respective dimension.
void global_work_size (int index, size_t s)
 Sets the global work size at the respective dimension.
std::string const & name () const
viennacl::ocl::handle
< cl_kernel > const & 
handle () const

Friends

template<typename KernelType >
void enqueue (KernelType &k, viennacl::ocl::command_queue const &queue)
 Enqueues a kernel in the provided queue.

Detailed Description

Represents an OpenCL kernel within ViennaCL.


Constructor & Destructor Documentation

kernel (  )  [inline]
kernel ( viennacl::ocl::handle< cl_program > const &  prog,
std::string const &  name 
) [inline]
kernel ( kernel const &  other  )  [inline]

Member Function Documentation

void arg ( unsigned int  pos,
cl_uint  val 
) [inline]

Sets an unsigned integer argument at the provided position.

void arg ( unsigned int  pos,
double  val 
) [inline]

Sets a double precision floating point argument at the provided position.

void arg ( unsigned int  pos,
VCL_TYPE const &  val 
) [inline]

Sets an OpenCL memory object at the provided position.

void arg ( unsigned int  pos,
float  val 
) [inline]

Sets a single precision floating point argument at the provided position.

void arg ( unsigned int  pos,
viennacl::ocl::handle< CL_TYPE > const &  h 
) [inline]

Sets an OpenCL object at the provided position.

void arg ( unsigned int  pos,
const local_mem mem 
) [inline]

Sets an OpenCL local memory object at the provided position.

size_t global_work_size ( int  index = 0  )  const [inline]

Returns the global work size at the respective dimension.

Parameters:
index Dimension index (currently either 0 or 1)
void global_work_size ( int  index,
size_t  s 
) [inline]

Sets the global work size at the respective dimension.

Parameters:
index Dimension index (currently either 0 or 1)
s The new global work size
viennacl::ocl::handle<cl_kernel> const& handle (  )  const [inline]
void local_work_size ( int  index,
size_t  s 
) [inline]

Sets the local work size at the respective dimension.

Parameters:
index Dimension index (currently either 0 or 1)
s The new local work size
size_t local_work_size ( int  index = 0  )  const [inline]

Returns the local work size at the respective dimension.

Parameters:
index Dimension index (currently either 0 or 1)
std::string const& name (  )  const [inline]
kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14,
T15 const &  t15,
T16 const &  t16,
T17 const &  t17 
) [inline]

Convenience function for setting eighteen kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14,
T15 const &  t15,
T16 const &  t16 
) [inline]

Convenience function for setting seventeen kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14,
T15 const &  t15 
) [inline]

Convenience function for setting sixteen kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14 
) [inline]

Convenience function for setting fifteen kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13 
) [inline]

Convenience function for setting fourteen kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12 
) [inline]

Convenience function for setting thirteen kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11 
) [inline]

Convenience function for setting twelve kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1 
) [inline]

Convenience function for setting two kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14,
T15 const &  t15,
T16 const &  t16,
T17 const &  t17,
T18 const &  t18,
T19 const &  t19,
T20 const &  t20,
T21 const &  t21,
T22 const &  t22 
) [inline]

Convenience function for setting twentythree kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14,
T15 const &  t15,
T16 const &  t16,
T17 const &  t17,
T18 const &  t18 
) [inline]

Convenience function for setting nineteen kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8 
) [inline]

Convenience function for setting nine kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14,
T15 const &  t15,
T16 const &  t16,
T17 const &  t17,
T18 const &  t18,
T19 const &  t19,
T20 const &  t20 
) [inline]

Convenience function for setting twentyone kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5 
) [inline]

Convenience function for setting six kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4 
) [inline]

Convenience function for setting five kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3 
) [inline]

Convenience function for setting four kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2 
) [inline]

Convenience function for setting three kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7 
) [inline]

Convenience function for setting eight kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14,
T15 const &  t15,
T16 const &  t16,
T17 const &  t17,
T18 const &  t18,
T19 const &  t19,
T20 const &  t20,
T21 const &  t21 
) [inline]

Convenience function for setting twentytwo kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6 
) [inline]

Convenience function for setting seven kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9 
) [inline]

Convenience function for setting ten kernel parameters.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10 
) [inline]

Convenience function for setting eleven kernel parameters.

kernel& operator() ( T0 const &  t0  )  [inline]

Convenience function for setting one kernel parameter.

kernel& operator() ( T0 const &  t0,
T1 const &  t1,
T2 const &  t2,
T3 const &  t3,
T4 const &  t4,
T5 const &  t5,
T6 const &  t6,
T7 const &  t7,
T8 const &  t8,
T9 const &  t9,
T10 const &  t10,
T11 const &  t11,
T12 const &  t12,
T13 const &  t13,
T14 const &  t14,
T15 const &  t15,
T16 const &  t16,
T17 const &  t17,
T18 const &  t18,
T19 const &  t19 
) [inline]

Convenience function for setting twenty kernel parameters.

viennacl::ocl::kernel& operator= ( const kernel other  )  [inline]

Friends And Related Function Documentation

void enqueue ( KernelType &  k,
viennacl::ocl::command_queue const &  queue 
) [friend]

Enqueues a kernel in the provided queue.


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