Error when localworksize to small


I just use a example which in increment local variable.

When the localworksize variable are smaller than the globalworksize the execution gave me that error :


on that line :

ciErrNum = clEnqueueNDRangeKernel(cqCommandQueue, ckKernel, 1, NULL, &szGlobalWorkSize, &szLocalWorkSize, 0, NULL, NULL);

on that example I have szGlobalWorkSize = 10 and szLocalWorkSize = 20;

Can someone help me?

Best regard.

Global size should be a multiple of local size. If you don’t actually need interthread communication, you’d better leave it as NULL or as 20.