According to OpenCL spec:
CL_INVALID_GLOBAL_OFFSET if the value specified in global_work_size + the
corresponding values in global_work_offset for any dimensions is greater than the
sizeof(size t) for the device on which the kernel execution will be enqueued.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: "Xing, Homer" <homer.xing@intel.com>
if (global_work_offset != NULL)
for (i = 0; i < work_dim; ++i) {
- if (UNLIKELY(~0LL - global_work_offset[i] > global_work_size[i])) {
+ if (UNLIKELY(global_work_offset[i] + global_work_size[i] > (size_t)-1)) {
err = CL_INVALID_GLOBAL_OFFSET;
goto error;
}