工作组之间的OpenCL同步 [英] OpenCL synchronization between work-groups
问题描述
是否可以同步OpenCL工作组?
Is it possible to synchronize OpenCL work-groups?
例如,我有100个工作组,每个工作组只有一个项目(不要问我为什么,这是一个例子),我需要对每个工作项目设置障碍,以确保所有工作在这100个工作组中的每个工作项目到达此障碍点之后,这些工作组将继续进行.
For example, I have 100 work-groups every work-groups have only one item (don't ask me why, this is an example), and I need to put barrier to every work-item which ensure that all work-groups will be continue after every work-item in this 100 work-groups reaches this barrier point.
推荐答案
不,您不能.您可以同步组内的线程,也可以同步命令队列内的内核执行.
No, you can't. You can synchronize threads inside a group, and you can synchronize kernel executions inside a command queue.
您可以同步少量的组,只要它们使用原子访问即可同时执行.但是,如果稍后安排一些小组,它将冻结,您对此无能为力.
You may be able to synchronize a small number of groups as long as they are all executed simutaneously, using atomic accesses. But it will freeze if some groups are scheduled later, and you have no control on this.
这篇关于工作组之间的OpenCL同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!