From b4a1d618b8d850a579af2840db2df6bee312172c Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:06:45 -0700 Subject: Enable coopvec tests with dxc backend (#6726) This PR enables existing CoopVec tests with DX12 backend. In order to use the CoopVec feature with DX12 backend, we have to use an option, "-dx12-experimental", because the current implementation of CoopVec feature in dxcompiler.dll requires "experimental feature". Note that when the "experimental feature" is enabled, slang-test becomes less stable. For that reason, we should use the option "-dx12-experimental" only when it is needed. All tests for GLSL are deleted because CoopVec support for GLSL in Slang is deprecated and no longer supported. Some of CoopVec tests are still disabled for DX12 backend because: DXC doesn't support 8bit integer types and Some of CoopVec features are not implemented in DXC backend. --- .../outer-product-structuredbuffer.slang | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 tests/cooperative-vector/outer-product-structuredbuffer.slang (limited to 'tests/cooperative-vector/outer-product-structuredbuffer.slang') diff --git a/tests/cooperative-vector/outer-product-structuredbuffer.slang b/tests/cooperative-vector/outer-product-structuredbuffer.slang new file mode 100644 index 000000000..0a862ffd2 --- /dev/null +++ b/tests/cooperative-vector/outer-product-structuredbuffer.slang @@ -0,0 +1,69 @@ +//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type + +// These platforms don't support these operations into structured buffers +//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. +//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type + +// CHECK: type: half +// CHECK-NEXT: 112.000000 +// CHECK-NEXT: 2.000000 +// CHECK-NEXT: 3.000000 +// CHECK-NEXT: 4.000000 +// CHECK-NEXT: 5.000000 +// CHECK-NEXT: 6.000000 +// CHECK-NEXT: 7.000000 +// CHECK-NEXT: 8.000000 +// CHECK-NEXT: 2.000000 +// CHECK-NEXT: 4.000000 +// CHECK-NEXT: 6.000000 +// CHECK-NEXT: 8.000000 +// CHECK-NEXT: 10.000000 +// CHECK-NEXT: 12.000000 +// CHECK-NEXT: 14.000000 +// CHECK-NEXT: 16.000000 +// CHECK-NEXT: 3.000000 +// CHECK-NEXT: 6.000000 +// CHECK-NEXT: 9.000000 +// CHECK-NEXT: 12.000000 +// CHECK-NEXT: 15.000000 +// CHECK-NEXT: 18.000000 +// CHECK-NEXT: 21.000000 +// CHECK-NEXT: 24.000000 +// CHECK-NEXT: 4.000000 +// CHECK-NEXT: 8.000000 +// CHECK-NEXT: 12.000000 +// CHECK-NEXT: 16.000000 +// CHECK-NEXT: 20.000000 +// CHECK-NEXT: 24.000000 +// CHECK-NEXT: 28.000000 +// CHECK-NEXT: 32.000000 + +//TEST_INPUT:ubuffer(data=[ 0x40003C00 0x44004200 ], stride=4),name=inputA +// [1,2,3,4] +StructuredBuffer inputA; + +//TEST_INPUT:ubuffer(data=[ 0x40003C00 0x44004200 0x46004500 0x48004700 ], stride=4),name=inputB +// [1,2,3,4,5,6,7,8] +StructuredBuffer inputB; + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=output +RWStructuredBuffer output; + +[numthreads(1, 1, 1)] +void computeMain() +{ + let vecA = coopVecLoad<4>(inputA); + let vecB = coopVecLoad<8>(inputB); + + output[0] = half(111); + + coopVecOuterProductAccumulate( + vecA, + vecB, + output, + 0, + 32, + CoopVecMatrixLayout::RowMajor, + CoopVecComponentType::Float16, + ); +} -- cgit v1.2.3