Search code examples
opencl

OpenCL global worksize and offset question


Let's say the global work size is 32, and I set the offset as 1. Does this mean that get_global_id(0) would start from 1 and end at 31, making the effective global work size to 31 rather than 32?

If I want to retain the total global work size as 32, should I specify the global work size as 32+1 for when I set the offset to 1?


Solution

  • If you set the global work size as 32 and set the offset as 1, get_global_id(0) will start from 1 and end at 32. The global work size specifies the NDRange size and the offset does not change it.