summaryrefslogtreecommitdiff
path: root/tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang')
-rw-r--r--tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang b/tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang
new file mode 100644
index 000000000..27d05a764
--- /dev/null
+++ b/tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang
@@ -0,0 +1,42 @@
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -xslang -skip-spirv-validation
+
+// These platforms don't support these operations from structured buffers
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+
+// CHECK: type: int32_t
+// CHECK-NEXT: 30
+// CHECK-NEXT: 70
+// CHECK-NEXT: 110
+// CHECK-NEXT: 150
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
+RWStructuredBuffer<int32_t> outputBuffer;
+
+//TEST_INPUT:ubuffer(data=[67305985], stride=4),name=input
+//[1 2 3 4]
+StructuredBuffer<int32_t> input;
+
+//TEST_INPUT:ubuffer(data=[67305985 134678021 202050057 269422093], stride=4),name=matrix
+//[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
+StructuredBuffer<uint8_t> matrix;
+
+[numthreads(1, 1, 1)]
+void computeMain()
+{
+ let vec = coopVecLoad<1, int32_t>(input);
+ let result = coopVecMatMulPacked<int32_t, 4>(
+ vec,
+ CoopVecComponentType::SignedInt8Packed,
+ 4,
+ matrix,
+ 0,
+ CoopVecComponentType::SignedInt8,
+ CoopVecMatrixLayout::RowMajor,
+ false,
+ 4
+ );
+
+ for(int i = 0; i < result.getCount(); ++i)
+ outputBuffer[i] = result[i];;
+}