Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is clGetKernelWorkGroupInfo - CL_KERNEL_WORK_GROUP_SIZE the size OpenCL uses when not specifying it in clEnqueueNDRange Kernel?

Tags:

opencl

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!

like image 299
Simbi Avatar asked Nov 21 '12 15:11

Simbi


1 Answers

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.

like image 57
Pragmateek Avatar answered Oct 20 '22 18:10

Pragmateek