The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

using workgroups

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...

Re: using workgroups

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.

Code :

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

Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.