-
Notifications
You must be signed in to change notification settings - Fork 854
[SM6.10] Add -fcgl variant to LinAlg Matrix codegen tests
#8262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e520d0a
[SM6.10] Implement groupshared Builtins
V-FEXrt 28f9487
Address comments
V-FEXrt 6ff022c
Rework based on feedback
V-FEXrt 36b93d5
Cleanup comments
V-FEXrt 2ab3146
[SM6.10] Add `-fcgl` variant to LinAlg Matrix codegen tests
hekota 28770b6
few more changes
hekota 3aeecb4
Add remaining 3 ops and fix test breaks
hekota 8bd55b0
Merge branch 'main' of https://github.com/microsoft/DirectXShaderComp…
hekota cc17cc4
Update tests after merge, add missing -fcgl case
hekota File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 7 additions & 1 deletion
8
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/fillmatrix/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,24 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32(i32 -2147483636, i32 {{.*}}) ; LinAlgFillMatrix(value) | ||
| // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgFillMatrix.mC4M5N4U1S2.i32 | ||
| // CHECK-SAME: (i32 -2147483636, i32 {{.*}}) ; LinAlgFillMatrix(value) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, i32)" | ||
| // CHECK2-SAME: (i32 406, %dx.types.LinAlgMatrixC4M5N4U1S2* {{.*}}, i32 5), | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; | ||
| __builtin_LinAlg_FillMatrix(mat1, 5); | ||
| // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC5M3N4U0S0 @dx.op.linAlgFillMatrix.mC5M3N4U0S0.f32(i32 -2147483636, float {{.*}}) ; LinAlgFillMatrix(value) | ||
|
|
||
| // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC5M3N4U0S0 @dx.op.linAlgFillMatrix.mC5M3N4U0S0.f32 | ||
| // CHECK-SAME: (i32 -2147483636, float {{.*}}) ; LinAlgFillMatrix(value) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M3N4U0S0*, float)" | ||
| // CHECK2-SAME: (i32 406, %dx.types.LinAlgMatrixC5M3N4U0S0* {{.*}}, float 0x40091EB860000000) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat2; | ||
| __builtin_LinAlg_FillMatrix(mat2, 3.14); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,19 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| RWByteAddressBuffer outbuf; | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U1S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle %{{.*}}, i32 5, i32 5, i32 5) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) | ||
| // CHECK: call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U1S2(i32 -2147483621, | ||
| // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle %{{.*}}, i32 5, i32 5, i32 5) | ||
| // CHECK-SAME: ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, %dx.types.Handle, i32, i32, i32)" | ||
| // CHECK2-SAME: (i32 419, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle {{.*}}, i32 5, i32 5, i32 5) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; | ||
| __builtin_LinAlg_MatrixAccumulateToDescriptor(mat, outbuf, 5, 5, 5); | ||
| } |
13 changes: 11 additions & 2 deletions
13
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,23 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -HV 202x -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -HV 202x -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| // CHECK: @{{.*}} = external addrspace(3) global [64 x float] | ||
| // CHECK: @"\01?SharedArr@@3PAMA" = external addrspace(3) global [64 x float], align 4 | ||
| groupshared float SharedArr[64]; | ||
|
|
||
| [numthreads(4,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U1S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, float addrspace(3)* getelementptr {{.*}}, i32 1, i32 2, i32 3) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) | ||
| // CHECK: call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U1S2.f32(i32 -2147483620, | ||
| // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, float addrspace(3)* getelementptr inbounds ([64 x float], | ||
| // CHECK-SAME: [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 1, i32 2, i32 3) | ||
| // CHECK-SAME: ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, | ||
| // CHECK2-SAME: [64 x float] addrspace(3)*, i32, i32, i32)"(i32 420, | ||
| // CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", | ||
| // CHECK2-SAME: i32 1, i32 2, i32 3) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; | ||
| __builtin_LinAlg_MatrixAccumulateToMemory(mat, SharedArr, 1, 2, 3); | ||
| } |
8 changes: 7 additions & 1 deletion
8
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,17 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U1S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) | ||
| // CHECK: call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U1S2(i32 -2147483631, | ||
| // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) | ||
| // CHECK-SAME: ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) | ||
|
|
||
| // CHECK2: call <2 x i32> @"dx.hl.op..<2 x i32> (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" | ||
| // CHECK2-SAME: (i32 407, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; | ||
| uint2 coord = __builtin_LinAlg_MatrixGetCoordinate(mat, 1); | ||
| } |
16 changes: 14 additions & 2 deletions
16
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,28 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; | ||
|
|
||
| // CHECK: call i32 @dx.op.linAlgMatrixGetElement.i32.mC4M5N4U1S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) | ||
| // CHECK: call i32 @dx.op.linAlgMatrixGetElement.i32.mC4M5N4U1S2(i32 -2147483630, | ||
| // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 0) | ||
| // CHECK-SAME: ; LinAlgMatrixGetElement(matrix,threadLocalIndex) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, i32*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" | ||
| // CHECK2-SAME: (i32 408, i32* %elem1, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 0) | ||
| uint elem1; | ||
| __builtin_LinAlg_MatrixGetElement(elem1, mat, 0); | ||
| // CHECK: call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U1S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) | ||
|
|
||
| // CHECK: call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U1S2(i32 -2147483630, | ||
| // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) | ||
| // CHECK-SAME: ; LinAlgMatrixGetElement(matrix,threadLocalIndex) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, float*, %dx.types.LinAlgMatrixC4M5N4U1S2, i32)" | ||
| // CHECK2-SAME: (i32 408, float* %elem2, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, i32 1) | ||
| float elem2; | ||
| __builtin_LinAlg_MatrixGetElement(elem2, mat, 1); | ||
| } |
7 changes: 6 additions & 1 deletion
7
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,16 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: call i32 @dx.op.linAlgMatrixLength.mC4M5N4U1S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixLength(matrix) | ||
| // CHECK: call i32 @dx.op.linAlgMatrixLength.mC4M5N4U1S2(i32 -2147483632, | ||
| // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixLength(matrix) | ||
|
|
||
| // CHECK2: call i32 @"dx.hl.op..i32 (i32, %dx.types.LinAlgMatrixC4M5N4U1S2)" | ||
| // CHECK2-SAME: (i32 409, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; | ||
| uint len = __builtin_LinAlg_MatrixLength(mat); | ||
| } |
8 changes: 7 additions & 1 deletion
8
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfromdescriptor/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,19 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| ByteAddressBuffer inbuf; | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC1M1N1U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC1M1N1U0S0(i32 -2147483634, %dx.types.Handle %{{.*}}, i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) | ||
| // CHECK: %{{.*}} = call %dx.types.LinAlgMatrixC1M1N1U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC1M1N1U0S0 | ||
| // CHECK-SAME: (i32 -2147483634, %dx.types.Handle %{{.*}}, i32 0, i32 0, i32 0) | ||
| // CHECK-SAME: ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC1M1N1U0S0*, %dx.types.Handle, i32, i32, i32) | ||
| // CHECK2-SAME: "(i32 410, %dx.types.LinAlgMatrixC1M1N1U0S0* %mat, %dx.types.Handle {{.*}}, i32 0, i32 0, i32 0) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(1, 1, 1, 0, 0)]] mat; | ||
| __builtin_LinAlg_MatrixLoadFromDescriptor(mat, inbuf, 0, 0, 0); | ||
| } |
12 changes: 10 additions & 2 deletions
12
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfrommemory/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,22 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -HV 202x -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -HV 202x -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| // CHECK: @{{.*}} = external addrspace(3) global [64 x float] | ||
| // CHECK: @"\01?SharedArr@@3PAMA" = external addrspace(3) global [64 x float], align 4 | ||
| groupshared float SharedArr[64]; | ||
|
|
||
| [numthreads(4,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U1S2.f32(i32 -2147483633, float addrspace(3)* getelementptr {{.*}}, i32 1, i32 2, i32 3) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) | ||
| // CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U1S2.f32 | ||
| // CHECK-SAME; (i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], | ||
| // CHECK-SAME: [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 1, i32 2, i32 3) | ||
| // CHECK-SAME: ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2*, [64 x float] addrspace(3)*, | ||
| // CHECK2-SAME: i32, i32, i32)"(i32 411, %dx.types.LinAlgMatrixC4M5N4U1S2* %mat, [64 x float] addrspace(3)* | ||
| // CHECK2-SAME: @"\01?SharedArr@@3PAMA", i32 1, i32 2, i32 3) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat; | ||
| __builtin_LinAlg_MatrixLoadFromMemory(mat, SharedArr, 1, 2, 3); | ||
| } | ||
8 changes: 7 additions & 1 deletion
8
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
...s/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,22 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: call %dx.types.LinAlgMatrixC4M5N4U1S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U1S2.mC4M5N4U1S2.mC4M5N4U1S2.mC4M5N4U1S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) | ||
| // CHECK: call %dx.types.LinAlgMatrixC4M5N3U1S2 | ||
| // CHECK-SAME: @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N3U1S2.mC4M5N4U1S2.mC4M4N3U1S2.mC4M5N3U1S2 | ||
| // CHECK-SAME: (i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U1S2 undef, %dx.types.LinAlgMatrixC4M4N3U1S2 undef, | ||
| // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N3U1S2 undef) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N3U1S2*, %dx.types.LinAlgMatrixC4M5N4U1S2, | ||
| // CHECK2-SAME: %dx.types.LinAlgMatrixC4M4N3U1S2, %dx.types.LinAlgMatrixC4M5N3U1S2)"(i32 417, | ||
| // CHECK2-SAME: %dx.types.LinAlgMatrixC4M5N3U1S2* {{.*}}, %dx.types.LinAlgMatrixC4M5N4U1S2 %{{[0-9]+}}, | ||
| // CHECK2-SAME: %dx.types.LinAlgMatrixC4M4N3U1S2 %{{[0-9]+}}, %dx.types.LinAlgMatrixC4M5N3U1S2 %{{[0-9]+}}) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat2; | ||
| __builtin_LinAlg_MatrixMatrixMultiplyAccumulate(mat2, mat1, mat1, mat1); | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 4, 3, 1, 2)]] mat2; | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 3, 1, 2)]] mat3; | ||
| __builtin_LinAlg_MatrixMatrixMultiplyAccumulate(mat3, mat1, mat2, mat3); | ||
| } |
8 changes: 7 additions & 1 deletion
8
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixouterproduct/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,19 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| float4 lhs = {1,2,3,4}; | ||
| float4 rhs = {4,3,2,1}; | ||
| // CHECK: call %dx.types.LinAlgMatrixC2M2N2U2S2 @dx.op.linAlgMatrixOuterProduct.mC2M2N2U2S2.v4f32.v4f32(i32 -2147483619, <4 x float> {{.*}}, <4 x float> {{.*}}) ; LinAlgMatrixOuterProduct(vectorA,vectorB) | ||
|
|
||
| // CHECK: call %dx.types.LinAlgMatrixC2M2N2U2S2 @dx.op.linAlgMatrixOuterProduct.mC2M2N2U2S2.v4f32.v4f32 | ||
| // CHECK-SAME: (i32 -2147483619, <4 x float> {{.*}}, <4 x float> {{.*}}) ; LinAlgMatrixOuterProduct(vectorA,vectorB) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC2M2N2U2S2*, <4 x float>, <4 x float>)" | ||
| // CHECK2: (i32 421, %dx.types.LinAlgMatrixC2M2N2U2S2* {{.*}}, <4 x float> {{.*}}, <4 x float> {{.*}}) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(2, 2, 2, 2, 2)]] mat; | ||
| __builtin_LinAlg_MatrixOuterProduct(mat, lhs, rhs); | ||
| } |
3 changes: 3 additions & 0 deletions
3
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixqueryaccumulatorlayout/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() | ||
|
|
||
| // CHECK2: call i32 @"dx.hl.op..i32 (i32)"(i32 418) | ||
| uint layout = __builtin_LinAlg_MatrixQueryAccumulatorLayout(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,19 @@ | ||
| // REQUIRES: dxil-1-10 | ||
| // RUN: %dxc -T cs_6_10 -E main %s | FileCheck %s | ||
| // RUN: %dxc -T cs_6_10 -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 | ||
|
|
||
| RWByteAddressBuffer outbuf; | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| // CHECK-LABEL: define void @main() | ||
|
|
||
| // CHECK: call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U1S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle %{{.*}}, i32 1, i32 1, i32 0) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout) | ||
| // CHECK: call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U1S2(i32 -2147483628, | ||
| // CHECK-SAME: %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle %{{.*}}, i32 1, i32 1, i32 0) | ||
| // CHECK-SAME: ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout) | ||
|
|
||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC4M5N4U1S2, %dx.types.Handle, i32, i32, i32) | ||
| // CHECK2-SAME: "(i32 413, %dx.types.LinAlgMatrixC4M5N4U1S2 {{.*}}, %dx.types.Handle {{.*}}, i32 1, i32 1, i32 0) | ||
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(4, 5, 4, 1, 2)]] mat1; | ||
| __builtin_LinAlg_MatrixStoreToDescriptor(mat1, outbuf, 1, 1, 0); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.