Reply – Re: HelloJOCL Problems on MacOSX
Your Name
Subject
Message
or Cancel
In Reply To
Re: HelloJOCL Problems on MacOSX
— by Giovanni Idili Giovanni Idili
I experienced this as well when moving from Snow Leopard to Lion (and the problem was actually the CPU not the GPu because the localWorkSize was smaller then 256).

I can confirm changing the code to the following works OK:

int elementCount = ELEM_COUNT;                                  // Length of arrays to process
int localWorkSize = min((int)kernel.getWorkGroupSize(device), 256);  // Local work size dimensions
int globalWorkSize = roundUp(localWorkSize, elementCount);   // rounded up to the nearest multiple of the localWorkSize


I agree this should probably become the default code in the examples :)