Is clGetKernelWorkGroupInfo - CL_KERNEL_WORK_GROUP_SIZE Does the size of OpenCL use if you do not specify it in the kernel clEnqueueNDRange?

I read that when not specifying the size of the workgroup when placing the kernel, OpenCL selects one for me.

eg:

//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 size of an OpenCL workgroup? Is the OpenCL workgroup size the one that clGetKernelWorkGroupInfo returns?

Thank you in advance!

+7
source share
2 answers

CL_KERNEL_GLOBAL_WORK_SIZE is the size of the MAXIMUM workgroup, which depends on the memory requirements of your kernel.

If you do not specify the size of the workgroup when executing the kernel, OpenCL will try to choose the best option for you, the maximum MAY or CAN NOT size.

Indeed, using the maximum size is optimal only if you have a lot of work items compared to the number of computing units of the device.

+2
source

You specify the size when calling clEnqueueNDRangeKernel. here. The parameter that matters in this case is "local_work_size".

"The total number of work items in the workgroup is calculated as local_work_size [0] * ... * local_work_size [work_dim - 1]"

0
source

All Articles