From fc3d519eb313426e6a1562a27783ce750f2b0b8c Mon Sep 17 00:00:00 2001 From: Jan S Date: Sat, 12 Aug 2017 11:35:35 +0200 Subject: [PATCH] Add example to clEnqueueNDRangeKernel --- clEnqueueNDRangeKernel.adoc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/clEnqueueNDRangeKernel.adoc b/clEnqueueNDRangeKernel.adoc index 33a2150..c064294 100644 --- a/clEnqueueNDRangeKernel.adoc +++ b/clEnqueueNDRangeKernel.adoc @@ -105,6 +105,32 @@ If `event` is NULL, no event will be created for this kernel execution instance If the `event_wait_list` and the `event` arguments are not NULL, the `event` argument should not refer to an element of the `event_wait_list` array. +[[example]] +== Example + +As example of how to specify the size of a kernel, suppose a 1D kernel should be enqueued with + +[source,c] +---- +global_work_offset[0] = 2; +global_work_size[0] = 4; +local_work_size[0] = 2; +---- + +This will create 4 work-items with the following IDs: + +[cols="1a,1a,1a", options="header"] +|=== + +||Global ID|Local ID +|work-item 1|2|0 +|work-item 2|3|1 +|work-item 3|4|0 +|work-item 4|5|1 + +|=== + + [[errors]] == Errors