Description
- Implement
WaveMultiPrefixSum
clang builtin,LinkWaveMultiPrefixSum
clang builtin withhlsl_intrinsics.h
Add sema checks forWaveMultiPrefixSum
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
Add codegen forWaveMultiPrefixSum
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
Add codegen tests toclang/test/CodeGenHLSL/builtins/WaveMultiPrefixSum.hlsl
Add sema tests toclang/test/SemaHLSL/BuiltIns/WaveMultiPrefixSum-errors.hlsl
Create theint_dx_WaveMultiPrefixSum
intrinsic inIntrinsicsDirectX.td
Create theDXILOpMapping
ofint_dx_WaveMultiPrefixSum
to166
inDXIL.td
Create theWaveMultiPrefixSum.ll
andWaveMultiPrefixSum_errors.ll
tests inllvm/test/CodeGen/DirectX/
Create theint_spv_WaveMultiPrefixSum
intrinsic inIntrinsicsSPIRV.td
In SPIRVInstructionSelector.cpp create theWaveMultiPrefixSum
lowering and map it toint_spv_WaveMultiPrefixSum
inSPIRVInstructionSelector::selectIntrinsic
.Create SPIR-V backend test case inllvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveMultiPrefixSum.ll
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
166 | WaveMultiPrefixOp | 6.5 | ('library', 'compute', 'amplification', 'mesh', 'pixel', 'vertex', 'hull', 'domain', 'geometry', 'raygeneration', 'intersection', 'anyhit', 'closesthit', 'miss', 'callable', 'node') |
SPIR-V
OpGroupNonUniformFAdd:
Description:
A floating point add group operation of all Value
operands contributed by active invocations in the
group.
Result Type must be a scalar or vector of floating-point
type.
Execution is a Scope that identifies the group of
invocations affected by this command. It must be Subgroup.
The identity I for Operation is 0. If Operation is
ClusteredReduce, ClusterSize must be present.
The type of Value must be the same as Result Type. The method used
to perform the group operation on the contributed Value(s) from active
invocations is implementation defined.
ClusterSize is the size of cluster to use. ClusterSize must be a
scalar of integer type, whose Signedness operand is 0.
ClusterSize must come from a constant
instruction. Behavior is undefined unless
ClusterSize is at least 1 and a power of 2. If ClusterSize is
greater than the size of the group, executing this instruction
results in undefined behavior.
Capability:
GroupNonUniformArithmetic, GroupNonUniformClustered,
GroupNonUniformPartitionedNV
Missing before version 1.3.
Word Count | Opcode | Results | Operands | ||||
---|---|---|---|---|---|---|---|
6 + variable |
350 |
<id> |
Scope <id> |
Group Operation |
<id> |
Optional |
Test Case(s)
Example 1
//dxc WaveMultiPrefixSum_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export float4 fn(float4 p1, uint4 p2) {
return WaveMultiPrefixSum(p1, p2);
}
Example 2
//dxc WaveMultiPrefixSum_1_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export uint4 fn(uint4 p1, uint4 p2) {
return WaveMultiPrefixSum(p1, p2);
}
Example 3
//dxc WaveMultiPrefixSum_2_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export int4 fn(int4 p1, uint4 p2) {
return WaveMultiPrefixSum(p1, p2);
}
HLSL:
Syntax
numeric<> WaveMultiPrefixSum(numeric<> value, uint<4> mask);
Type Description
Name | Template Type | Component Type | Size |
---|---|---|---|
ret | scalar, vector, or matrix | float or int | any |
value | scalar, vector, or matrix | float or int | any |
mask | vector | uint | 4 |
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 6.5 and higher shader models | yes |
Shader Stages
- Library Shader
- Compute Shader
- Amplification Shader
- Mesh Shader
- Pixel Shader
- Vertex Shader
- Hull Shader
- Domain Shader
- Geometry Shader
- Raygeneration Shader
- Intersection Shader
- Anyhit Shader
- Closesthit Shader
- Miss Shader
- Callable Shader
- Node Shader
See also
Metadata
Metadata
Assignees
Type
Projects
Status
Activity