The function runs an OpenCL program. There are 3 versions of the function:
1. Launching kernel functions using one kernel
bool CLExecute( |
2. Launching several kernel copies (OpenCL function) with task space description
bool CLExecute( |
3. Launching several kernel copies (OpenCL function) with task space description and specification of the size of the group's local task subset
bool CLExecute( |
Parameters
kernel
[in] Handle to the OpenCL kernel.
work_dim
[in] Dimension of the tasks space.
global_work_offset[]
[in] Initial offset in the tasks space.
global_work_size[]
[in] The size of a subset of tasks.
local_work_size[]
[in] The size of the group's local task subset.
Return Value
Returns true if successful, otherwise returns false. For information about the error, use the GetLastError() function.
Note
Consider the use of the parameters in the following example:
•work_dim specifies work_items[] array dimension describing the tasks. If work_dim=3, three-dimensional array work_items[N1, N2, N3] is used.
•global_work_size[] contains the values setting work_items[] array size. If work_dim=3, global_work_size[3] array can be {40, 100, 320}. Then we have work_items[40, 100, 320]. So, the total number of tasks is 40 х 100 х 320 = 1 280 000.
•local_work_size[] sets the subset of the tasks that will be executed by the specified kernel of OpenCL program. Its dimension is equal to work_items[] dimension and allows exact division of the common task subset into smaller subsets. In fact, the sizes of local_work_size[] array should be selected so that to divide work_items[] global task set into smaller subsets. local_work_size[3]={10, 10, 10} will fit the current example, as work_items[40, 100, 320] can be gathered from local_items[10, 10, 10] array with no excess.