I read that when not specifying the work group size when enqueueing a kernel, OpenCL chooses one for me.
e.g:
//don't know which workgroup size OpenCl will use!
clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &global_size, NULL, 0, NULL, NULL);
Is there a way to get the workgroup size OpenCL is using here? Is the workgroup size OpenCL chooses the one which is returned by clGetKernelWorkGroupInfo?
Thank you in advance!
CL_KERNEL_GLOBAL_WORK_SIZE is the MAXIMUM work-group size you can get, which depends on the memory requirements of your kernel.
If you do not specify a work-group size when executing a kernel OpenCL will try to choose the best one for you, which MAY or MAY NOT be the maximum size.
Indeed using the maximum size is optimal only if you have a lot of work-items compared to the number of compute-units of the device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With