TOpenCLKernel::Enqueue Method

Overload List

#SignatureDescription
1void Enqueue(TOpenCLCommandQueue *CmdQueue, int WorkSize, bool CPUAdjust = true);Submits the Kernel to cmdQueue for computation with specified WorkSize.
2void Enqueue(TOpenCLCommandQueue *CmdQueue, int WorkSize, int LocalSize, bool CPUAdjust = true);Submits the Kernel to cmdQueue for computation with specified WorkSize and LocalSize.
3void Enqueue(TOpenCLCommandQueue *CmdQueue, const DewArray<int> &WorkSizeOffsets, const DewArray<int> &WorkSizes, const DewArray<int> &LocalSizes, bool CPUAdjust);

Overload 1: void Enqueue(TOpenCLCommandQueue *CmdQueue, int WorkSize, bool CPUAdjust = true);

Submits the Kernel to cmdQueue for computation with specified WorkSize.

#NameTypeDescription
1CmdQueueTOpenCLCommandQueue *
2WorkSizeint
3CPUAdjust = truebool
Remarks:

Setting CPUAdjust to true will reduce WorkSize by factor OPENCL_BLOCKLEN and assume presence of kernel internal for-loops. Kernel internal for-loops can significantly speed up execution of the kernel on CPU devices lowering the function call overhead. The CPUAdjust parameter is used only if the device is of CPU type. The for-loop pattern expected inside the kernel looks like this:

  size_t i = get_global_id(0);
	size_t tIdx = i*BLOCK_LEN;
	size_t tIdxLen = tIdx + BLOCK_LEN;
	if (tIdxLen > Length) tIdxLen = Length;
	for (i = tIdx; i < tIdxLen; i++)
	{

  }

where BLOCK_LEN matches OPENCL_BLOCKLEN.

Declared in Dew::Math::TOpenCLKernel · Dew.Math/clMtxVec.h · Cross-compiler

Overload 2: void Enqueue(TOpenCLCommandQueue *CmdQueue, int WorkSize, int LocalSize, bool CPUAdjust = true);

Submits the Kernel to cmdQueue for computation with specified WorkSize and LocalSize.

#NameTypeDescription
1CmdQueueTOpenCLCommandQueue *
2WorkSizeint
3LocalSizeint
4CPUAdjust = truebool
Remarks:

When specified explicitely the (WorkSize mod LocalSize) is required to be zero. Setting CPUAdjust to true will reduce WorkSize by factor OPENCL_BLOCKLEN and assume presence of kernel internal for-loops. Kernel internal for-loops can significantly speed up execution of the kernel on CPU devices lowering the function call overhead. Kernel internal for-loops in GPU devices cause large performance penalties. The CPUAdjust parameter should be used only if the device is of CPU type. LocalSize is also called workgroup size. The for-loop pattern expected inside the kernel looks like this:

  size_t i = get_global_id(0);
	size_t tIdx = i*BLOCK_LEN;
	size_t tIdxLen = tIdx + BLOCK_LEN;
	if (tIdxLen > Length) tIdxLen = Length;
	for (i = tIdx; i < tIdxLen; i++)
	{

  }

where BLOCK_LEN matches OPENCL_BLOCKLEN.

Declared in Dew::Math::TOpenCLKernel · Dew.Math/clMtxVec.h · Cross-compiler

Overload 3: void Enqueue(TOpenCLCommandQueue *CmdQueue, const DewArray<int> &WorkSizeOffsets, const DewArray<int> &WorkSizes, const DewArray<int> &LocalSizes, bool CPUAdjust);

#NameTypeDescription
1CmdQueueTOpenCLCommandQueue *
2WorkSizeOffsetsconst DewArray<int> &
3WorkSizesconst DewArray<int> &
4LocalSizesconst DewArray<int> &
5CPUAdjustbool
Declared in Dew::Math::TOpenCLKernel · Dew.Math/clMtxVec.h · Cross-compiler