This patch looks good to me. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Zhigang Gong Sent: Tuesday, October 29, 2013 11:22 AM To: [email protected] Cc: Zhigang Gong Subject: [Beignet] [PATCH] Runtime: fixed an incorrect error checking for CL_INVALID_GLOBAL_OFFSET.
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 <[email protected]> --- src/cl_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cl_api.c b/src/cl_api.c index f668ec6..173810b 100644 --- a/src/cl_api.c +++ b/src/cl_api.c @@ -2336,7 +2336,7 @@ clEnqueueNDRangeKernel(cl_command_queue command_queue, 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; } -- 1.7.9.5 _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
