clEnqueueNDRangeKernel: avoid a goto
We can refactor the logic to skip the goto. While this isn't
necessarily better, it's a necessary cleanup in preparation for the
next commit that introduces the reqd_work_group_size check.
@@ -115,10 +115,10 @@ POname(clEnqueueNDRangeKernel)(cl_command_queue command_queue,
local_x = local_work_size[0];
local_y = work_dim > 1 ? local_work_size[1] : 1;
local_z = work_dim > 2 ? local_work_size[2] : 1;
- if (local_x > global_x || local_y > global_y || local_z > global_z)
- goto DETERMINE_LOCAL_SIZE;
}
- else
+
+ if (local_work_size == NULL ||
+ (local_x > global_x || local_y > global_y || local_z > global_z))
{
/* Embarrassingly parallel kernel with a free work-group
size. Try to figure out one which utilizes all the
@@ -129,7 +129,6 @@ POname(clEnqueueNDRangeKernel)(cl_command_queue command_queue,
SIMD instruction utilization).
*/
size_t preferred_wg_multiple;
-DETERMINE_LOCAL_SIZE:
POname(clGetKernelWorkGroupInfo)
(kernel, command_queue->device,
CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE,
