18#ifndef itkOpenCLKernel_h
19#define itkOpenCLKernel_h
32#include "itkCovariantVector.h"
111#define OpenCLKernelSetArgMacroH(type) cl_int SetArg(const cl_uint index, const type value);
113#define OpenCLKernelSetArgMacroCXX(type) \
114 cl_int OpenCLKernel::SetArg(const cl_uint index, const type value) \
116 return clSetKernelArg(this->m_KernelId, index, sizeof(value), (const void *)&value); \
119#define OpenCLKernelSetArgsMacroH(type0, type1, type2, type3, type4) \
120 OpenCLKernelSetArgMacroH(type0) OpenCLKernelSetArgMacroH(type1) OpenCLKernelSetArgMacroH(type2) \
121 OpenCLKernelSetArgMacroH(type3) OpenCLKernelSetArgMacroH(type4)
123#define OpenCLKernelSetArgsMacroCXX(type0, type1, type2, type3, type4) \
124 OpenCLKernelSetArgMacroCXX(type0) OpenCLKernelSetArgMacroCXX(type1) OpenCLKernelSetArgMacroCXX(type2) \
125 OpenCLKernelSetArgMacroCXX(type3) OpenCLKernelSetArgMacroCXX(type4)
130class OpenCLVectorBase;
133class OpenCLKernelPimpl;
336 cl_int
SetArg(const cl_uint index, const
void * data, const
size_t size);
647 template <
typename T1>
659 template <
typename T1,
typename T2>
672 template <
typename T1,
typename T2,
typename T3>
674 operator()(
const T1 & arg1,
const T2 & arg2,
const T3 & arg3)
686 template <
typename T1,
typename T2,
typename T3,
typename T4>
688 operator()(
const T1 & arg1,
const T2 & arg2,
const T3 & arg3,
const T4 & arg4)
701 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
703 operator()(
const T1 & arg1,
const T2 & arg2,
const T3 & arg3,
const T4 & arg4,
const T5 & arg5)
717 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
719 operator()(
const T1 & arg1,
const T2 & arg2,
const T3 & arg3,
const T4 & arg4,
const T5 & arg5,
const T6 & arg6)
734 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
758 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8>
785 template <
typename T1,
822 template <
typename T1,
859 std::unique_ptr<OpenCLKernelPimpl>
d_ptr;
879template <
typename charT,
typename traits>
880inline std::basic_ostream<charT, traits> &
885 strm <<
"OpenCLKernel(null)";
889 const char indent =
' ';
891 strm <<
"OpenCLKernel\n"
892 << indent <<
"Id: " << kernel.
GetKernelId() <<
'\n'
893 << indent <<
"Name: " << kernel.
GetName() <<
'\n'
The OpenCLContext class represents an OpenCL context.
The OpenCLDevice class represents the collection of OpenCL devices to be used by the host.
OpenCLEventList class represents a list of OpenCLEvent objects.
OpenCLEvent class represents an OpenCL event object.
The OpenCLKernel class represents an executable entry point function in an OpenCL program.
Matrix< double, 3, 3 > MatrixDouble3x3Type
Point< int, 1 > PointInt1DType
Point< int, 2 > PointInt2DType
Vector< int, 3 > VectorInt3DType
OpenCLSize GetBestLocalWorkSizeImage3D() const
void SetGlobalWorkSize(const OpenCLSize &size)
Matrix< float, 4, 4 > MatrixFloat4x4Type
void SetRoundedGlobalWorkSize(const OpenCLSize &size)
void SetDoubleAsFloat(const bool value)
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6)
CovariantVector< double, 3 > CovariantVectorDouble3DType
Matrix< float, 2, 2 > MatrixFloat2x2Type
void SetLocalWorkSize(const OpenCLSize &size)
Vector< float, 2 > VectorFloat2DType
std::vcl_size_t GetNumberOfArguments() const
Vector< int, 2 > VectorInt2DType
Point< double, 2 > PointDouble2DType
OpenCLSize GetBestLocalWorkSizeImage(const std::vcl_size_t dimension) const
cl_char16 cl_short16 cl_int8
cl_char16 cl_short16 cl_int16 cl_long16 cl_double2
Point< float, 4 > PointFloat4DType
cl_char16 cl_short16 cl_int16 cl_long16 cl_double4
CovariantVector< float, 4 > CovariantVectorFloat4DType
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4)
OpenCLKernel & operator=(const OpenCLKernel &other)
CovariantVector< float, 3 > CovariantVectorFloat3DType
Vector< int, 1 > VectorInt1DType
CovariantVector< int, 3 > CovariantVectorInt3DType
OpenCLSize GetLocalWorkSize() const
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9)
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2)
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5)
cl_char16 cl_short16 cl_int4
Vector< double, 1 > VectorDouble1DType
OpenCLSize GetBestLocalWorkSizeImage2D() const
Point< double, 3 > PointDouble3DType
void SetDoubleAsFloatDisable()
cl_char16 cl_short16 cl_int16 cl_long2
Vector< int, 4 > VectorInt4DType
Matrix< float, 1, 1 > MatrixFloat1x1Type
OpenCLEvent LaunchKernel()
CovariantVector< float, 2 > CovariantVectorFloat2DType
CovariantVector< float, 1 > CovariantVectorFloat1DType
OpenCLSize GetGlobalWorkOffset() const
CovariantVector< double, 2 > CovariantVectorDouble2DType
OpenCLKernel(const OpenCLKernel &other)
CovariantVector< double, 1 > CovariantVectorDouble1DType
Point< double, 4 > PointDouble4DType
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10)
Point< int, 4 > PointInt4DType
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7)
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8)
Matrix< double, 1, 1 > MatrixDouble1x1Type
cl_char16 cl_short16 cl_int2
CovariantVector< int, 4 > CovariantVectorInt4DType
OpenCLSize GetGlobalWorkSize() const
OpenCLKernelSetArgsMacroH(cl_uchar, cl_uchar2, cl_uchar4, cl_uchar8, cl_uchar16) OpenCLKernelSetArgsMacroH(cl_char
Vector< double, 3 > VectorDouble3DType
vcl_size_t GetPreferredWorkSizeMultiple() const
Point< float, 2 > PointFloat2DType
void SetGlobalWorkOffset(const OpenCLSize &offset)
OpenCLSize GetCompileWorkGroupSize() const
Vector< double, 2 > VectorDouble2DType
OpenCLProgram GetProgram() const
cl_char16 cl_short16 cl_int16 cl_long16 cl_double8
OpenCLEvent operator()(const T1 &arg1, const T2 &arg2, const T3 &arg3)
Point< double, 1 > PointDouble1DType
bool GetDoubleAsFloatEnabled()
OpenCLKernel(OpenCLContext *context, const cl_kernel id)
OpenCLSize GetCompileWorkGroupSize(const OpenCLDevice &device) const
cl_char16 cl_short16 cl_int16 cl_long16 cl_double16 cl_int SetArg(const cl_uint index, const void *data, const vcl_size_t size)
Point< float, 3 > PointFloat3DType
Vector< float, 3 > VectorFloat3DType
Vector< double, 4 > VectorDouble4DType
std::unique_ptr< OpenCLKernelPimpl > d_ptr
OpenCLContext * GetContext() const
OpenCLEvent LaunchTaskAsync(const OpenCLEventList &event_list)
OpenCLEvent operator()(const T1 &arg1)
Point< int, 3 > PointInt3DType
std::string GetName() const
OpenCLSize GetBestLocalWorkSizeImage1D() const
cl_char16 cl_short16 cl_int16 cl_long8
Matrix< double, 4, 4 > MatrixDouble4x4Type
CovariantVector< int, 2 > CovariantVectorInt2DType
CovariantVector< double, 4 > CovariantVectorDouble4DType
cl_kernel GetKernelId() const
CovariantVector< int, 1 > CovariantVectorInt1DType
Point< float, 1 > PointFloat1DType
cl_char16 cl_short16 cl_int16 cl_long4
Vector< float, 4 > VectorFloat4DType
Matrix< float, 3, 3 > MatrixFloat3x3Type
void SetDoubleAsFloatEnable()
Vector< float, 1 > VectorFloat1DType
Matrix< double, 2, 2 > MatrixDouble2x2Type
bool LaunchTask(const OpenCLEventList &event_list)
The OpenCLMemoryObject class represents all common memory objects such as buffers and image objects.
The OpenCLProgram class represents an OpenCL program object.
The OpenCLSampler class represents an OpenCL sampler object.
The OpenCLSize class defines the size of an item of work for an OpenCL kernel.
The base class for the OpenCLVector implementation.
#define ITK_OPENCL_DECLARE_PRIVATE(Class)
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)