PDA

View Full Version : using workgroups



dlw
06-21-2011, 01:17 PM
Hey guys, I am just starting using OpenCl, and have been programming c++ for awhile. I just have some general questions on workgroups.

If I specify a number of workgroups in EnqueueNDRangeKernel, does it automatically split my work?

If so, as long as I dont have any "local" code, my kernel will still work?

Also, can I still use get_global_id(), or should I use something else that is quicker?

I am passing a large array of floats into global memory, but the access has to be faster, so I am trying to cut the NDRange into workgroups, so that multiple workgroups are accessing global memory. I just dont know if it will access everything the same way...

david.garcia
07-06-2011, 03:15 PM
If I specify a number of workgroups in EnqueueNDRangeKernel, does it automatically split my work?

clEnqueueNDRangeKernel() does not take the number of work-groups as an input. It takes the number of work-items. If you do not specify a given work-group size, then the implementation will automatically choose a work-group size for you.


If so, as long as I dont have any "local" code, my kernel will still work?

Right. As long as you are not using any local memory your code probably does not care about work-group size.


Also, can I still use get_global_id(), or should I use something else that is quicker?

get_global_id() works fine :)