Do work items in the same work group execute the same instructions?

Do work items in the same work group execute the same instructions?

For Intel CPU and HD Graphics, do work items in the same work group execute the same instructions? If so, that means all the processing unit within the same compute unit share the same PC, but what confuses me is the "barrier", which will synchnize all the work items in the same work group, which means that while one thread is computing some other threads is waiting for it, which means they are not executing the same instruction. 

Anyone could help to answer me?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Sorry for the delay in responding. Not sure if you got your answer, but work items within the same work group (in fact all the workgroups) execute the same kernel. So, yes, they execute same instructions but on different data (hence the implicit parallelism). You need the barrier if you want to synchronize work-items within a workgroup. You are synchronizing the data (that the same instructions modify). Hope this answers your questions.

Thanks,
Raghu

 

Let me correct myself here. In cases where you have branches, for example, you are executing different set of instructions (this is called SPMD as opposed to SIMD). In the case of SIMD you are executing same instructions on different data so the PC is shared by all the processing elements. In the case of SPMD the PEs maintain their own program counters since the actual instructions executed could be different.

Leave a Comment

Please sign in to add a comment. Not a member? Join today