Reputation: 53
I am begginer at OpenCL. I know that when one kernel is used, every work-item executes the same kernel. But when more than one different kernels are used and working in parallel, how are they distributed in work-items? Which of them will execute one kernel and which will execute the other(s)? How is this distinction made?
Thank you
Upvotes: 0
Views: 62
Reputation: 6343
Typically one kernel will finish before the next starts (they do not run in parallel). There are exceptions to that, but you have to opt-in to get there. Execution of a single kernel is in sets called work groups, which contain the individual work items. The work groups might run in any order, and can run in parallel (in lock step or not; doesn't matter). The kernel is "done" when the last work group is done. Then the next kernel starts.
Upvotes: 2