Skip to content

[HLSL][DirectX] dot2add generating invalid DXILOpFunction #152585

@kmpeng

Description

@kmpeng

Discovered while running the offload-test-suite.

https://godbolt.org/z/MYhG9xhTT

StructuredBuffer<half2> A : register(t0);
StructuredBuffer<half2> B : register(t1);
StructuredBuffer<float> Acc : register(t2);

RWStructuredBuffer<float> Out : register(u3);

[numthreads(1,1,1)]
void main() {
  Out[0] = dot2add(A[0], B[0], Acc[0]);
}

This code is producing this error:

# .---command stdout------------
# | Function: main: error: 'dx.op.dot2AddHalf' is not a DXILOpFuncition for DXILOpcode 'Dot2AddHalf'.
# | note: at '%dx.dot2add.i47 = call float @dx.op.dot2AddHalf(i32 162, float %5, half %7, half %9, half %11, half %13) #3' in block 'entry' of function 'main'.
# | Function: dx.op.dot2AddHalf.f32: error: External function 'dx.op.dot2AddHalf.f32' is unused.
# | Validation failed.
# | 
# `-----------------------------
# .---command stderr------------
# | clang-dxc: error: dxv command failed with exit code 1 (use -v to see invocation)
# `-----------------------------
# error: command failed with exit status: 1

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions