Does get_global_id include offset?

Viewed 109

If I run kernel by calling clEnqueueNDRangeKernel with global work item offset, does get_global_id return offsetted value or I should offset it manualy?

size_t offset[1] = { some value};
clEnqueueNDRangeKernel(..., &offset[0], ...);

The right way will be: int id = get_global_id(0) or int id = get_global_id(0) + get_global_offset(0);?

1 Answers

Yes, get_global_id(0) does include the offset specified in clEnqueueNDRangeKernel. For example, if you set the kernel offset to 50 and kernel range to 100, get_global_id(0) will count from 50 to 149.

Related