I've read, that OpenCL kernels are grouped like OpenGL compute shaders. That means, that you can define how many invocations should be executed within a workgroup. These invocations which are in the same workgroup, can communicate with so called
In OpenCL there is the CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE also called warp size. Which is 32 for my GPU. That means, when allocating less than 32 invocations per workgroup (OpenCL), your GPU is not fully used. As far as I understood, it has to do with hardware specifications. Where 32 cores on my GPU are grouped together as a warp and also executed together. When allocating less than 32 invocations, the rest of the cores within that hardware group are not used or idle.
Do I have the same restrictions on OpenGL compute shaders? My GPU has 3072 shader units, when executing a post processing algorithm on OpenGL compute shader, does it make sense to allocate the workgroup size to be a multiple of 32? Even, when no interaction between neighboring pixels exists?
For example we have a 1024 x 1024 rgb32f image, and we only want to apply some calculation to it ... we could define workgroup size to be x,y,z = 1. and execute 1024 x 1024 x 1 workgroups. Or, we can define workgroup size to be x = 32 and y,z = 1 and execute 32 x 1024 x 1 workgroups.
maybe your answer is: Yes of cause, it is hardware specified... but I also think about the shader compiler... maybe it is trying to perfectly spread the work to the cores.