Are there any voting features in OpenCL?

CUDA has __ballot() , __any() , __all() , __popc() and many lanemask functions for performing voting operations on boors on all tracks (usually with a size of 32) within the framework. I am wondering if there are such functions implemented in OpenCL to perform the same operations in one wavefront. If there is no such function, I may need to implement them as built-in functions for use in my project.

+4
source share
2 answers

According to the specification of OpenCL v. 1.1 , section 6.11 "Built-in functions", I think the answer is no.

However, on NVIDIA GPUs, you can probably use the built-in PTX to implement these things (or at least this blogger was able to use the built-in PTX ).

+3
source

Actually check OpenCL subgroups . They define some functions of the sub_group_all() , such as sub_group_all() and sub_group_any() , as well as something else interesting.

Subgroups are a relatively new criterion, and I'm not sure who supports it. The Intel GPU implementation (actually an extension) has several more interesting shuffle functions for swapping lanes (in the register file), as well as for creating an explicit block of writes and reads. I'm sure AMD also supports subgroups, but I'm not sure about NVidia.

+2
source

All Articles