CL_INVALID_WORK_GROUP_SIZE not set correctly

Hi,
Im trying to include OpenCL in my Application/Bundle and i’ve ran into this issue:
CL_INVALID_WORK_GROUP_SIZE

I tried to fix this and came to several hints what the Problem might be.
But first of all the general situation:

The Error is caused when launching a kernel:

error=clEnqueueNDRangeKernel(cq, kernels[kernelId], 3, NULL, gws, lws, 0, NULL, NULL);

Work size specs:
gws (globalWorkSize) = [64,64,64]
lws (localWorkSize) = [8,8,8]

CL_DEVICE_MAX_WORK_GROUP_SIZE = 1024

If I run the kernel without specifying the local work size following happens:

  1. It executes without an error
  2. global size is set to [64,1,1] due to get_local_size(0) = 64, get_local_size(1) = 1 and get_local_size(2) = 1

Do you have an Idea why i can’t declare the local work size and get the desired result?
I hope my question is stated clearly enough.
Every help is much appreciated!

Greetings,
Cery

Your platform might have limitations on the local work size in the second and third dimensions. You can check this by retrieving the CL_DEVICE_MAX_WORK_ITEM_SIZES property, which returns a list of (at least) 3 values, indicating the maximum local size in each dimension.

Thanks a lot! That was actually the case. The device was only capable of a [1024,1,1] work size.
I was apparently using the wrong device. Maybe the CPU?
Either way i switched to another with [1024,64,8] and now its working like a charm!
Thank you, have a wonderful weekend.
Cery

I’ve seen 1024,1,1 only for the Apple CPU device, so I agree with your guess that it was that device. Switch to the GPU device for better dimensions.