You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What kinds of reduction intrinsics does CUDA support? AMDGPU has wfred, which reduces a single value across all active lanes. I figure this could be easy to support, like result = @reduce_warp op input
Even if there is no portable access to lower-level reduction primitives it would be good to have an example of a reduction operation (e.g. sum, maximum), probably implemented via local memory. The histogram example does that but it's more complicated than a straightforward reduction.
Implemented for KA 0.10: @groupreduce and @groupscan (#830) reduce and scan over a workgroup on every backend, and KernelInterface has sub-group reductions and scans (KI.sub_group_reduce, #831), which @groupreduce uses where the backend can shuffle. See the "Reductions and scans" section of the kernel docs for an example. Device-wide reductions are left to mapreduce in GPUArrays.jl or AcceleratedKernels.jl.
Activity
jpsamaroo commentedon Apr 6, 2021
What kinds of reduction intrinsics does CUDA support? AMDGPU has
wfred, which reduces a single value across all active lanes. I figure this could be easy to support, likeresult = @reduce_warp op inputrveltz commentedon Sep 4, 2022
maybe something like in FoldsCUDA?
eschnett commentedon Dec 22, 2023
Even if there is no portable access to lower-level reduction primitives it would be good to have an example of a reduction operation (e.g.
sum,maximum), probably implemented via local memory. The histogram example does that but it's more complicated than a straightforward reduction.maleadt commentedon Oct 19, 2026
Implemented for KA 0.10:
@groupreduceand@groupscan(#830) reduce and scan over a workgroup on every backend, and KernelInterface has sub-group reductions and scans (KI.sub_group_reduce, #831), which@groupreduceuses where the backend can shuffle. See the "Reductions and scans" section of the kernel docs for an example. Device-wide reductions are left tomapreducein GPUArrays.jl or AcceleratedKernels.jl.