Subgroup built-ins¶
Import: import system.gpu;
This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation. Shader-only declarations can be used only inside @compute, @vertex, @fragment, inferred helpers and ray tracing shader functions; using them elsewhere is a compile error.
subgroup_size¶
The number of threads in a subgroup, the group of threads the GPU runs in lockstep: for example 32 on NVIDIA, 32 or 64 on AMD and 32 on Apple GPUs. Subgroup functions need GpuFeature.Subgroups and are not available with GpuTarget.Dx11.
subgroup_invocation_id¶
This thread's lane within its subgroup, from 0 to subgroup_size() - 1.
subgroup_add¶
The sum of value over every active lane of the subgroup.
subgroup_min¶
The smallest value among the active lanes.
subgroup_max¶
The largest value among the active lanes.
subgroup_prefix_add¶
The sum of value over the active lanes below this one.
subgroup_prefix_count¶
The number of active lanes below this one where condition is true.
subgroup_count¶
The number of active lanes where condition is true.
subgroup_ballot¶
One bit per lane, set where condition is true.
subgroup_broadcast¶
value from lane lane, the same lane for every thread.
subgroup_shuffle¶
value from lane lane, which may differ per thread.
subgroup_all¶
True when condition is true on every active lane.
subgroup_any¶
True when condition is true on any active lane.
subgroup_elect¶
True on exactly one active lane, the lowest.