From 7c195d3b31c85d8b53ad5848b7730bb2be6c6a89 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 6 Nov 2024 18:58:26 -0800 Subject: Fix CUDA prelude for makeMatrix (#5509) * Fix CUDA prelude for makeMatrix * Add regression test. --- tests/cuda/make-matrix.slang | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/cuda/make-matrix.slang (limited to 'tests/cuda') diff --git a/tests/cuda/make-matrix.slang b/tests/cuda/make-matrix.slang new file mode 100644 index 000000000..ef6358620 --- /dev/null +++ b/tests/cuda/make-matrix.slang @@ -0,0 +1,14 @@ +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -compute +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cuda -compute + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer outputBuffer : register(u0); + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint idx = dispatchThreadID.x + 1; + uint4x3 mat1 = uint4x3(idx, idx, idx, idx, idx, idx, idx, idx, idx, idx, idx, idx); + outputBuffer[0] = mat1; + // CHECK: 1 +} \ No newline at end of file -- cgit v1.2.3