From 2580bb02f7a079ab1c0106b5960a21ed1627bca0 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Thu, 15 May 2025 03:47:43 +0000 Subject: Add new coopmat2 functions: Reduce and Transpose (#7027) This commit adds three new functions for CoopMat as described in the proposal document, Cooperative matrix 2 proposal spec#12 The new functions are: CoopMat::Transpose CoopMat::ReduceRow CoopMat::ReduceColumn CoopMat::ReduceRowAndColumn CoopMat::Reduce2x2 --- .../cooperative-matrix/load-store-rwstructuredbuffer.slang | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/cooperative-matrix/load-store-rwstructuredbuffer.slang') diff --git a/tests/cooperative-matrix/load-store-rwstructuredbuffer.slang b/tests/cooperative-matrix/load-store-rwstructuredbuffer.slang index e161fb7b2..6a94fd30e 100644 --- a/tests/cooperative-matrix/load-store-rwstructuredbuffer.slang +++ b/tests/cooperative-matrix/load-store-rwstructuredbuffer.slang @@ -1,4 +1,5 @@ //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly -skip-spirv-validation +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly -skip-spirv-validation -Xslang -DRWSB // CHECK: type: int32_t // CHECK-NEXT: 1 @@ -11,17 +12,21 @@ // CHECK-NEXT: 8 //TEST_INPUT:ubuffer(data=[1 2 3 4 5 6 7 8], stride=4, count=256),name=buf +#if defined(RWSB) RWStructuredBuffer inputBuffer; +#else +StructuredBuffer inputBuffer; +#endif //TEST_INPUT:ubuffer(stride=4, count=256):out,name=outputBuffer RWStructuredBuffer outputBuffer; +using namespace linalg; + [numthreads(32, 1, 1)] void computeMain() { let stride = 16; - let matrixLayout = CoopMatMatrixLayout::RowMajor; - - let mat = coopMatLoad(inputBuffer, 0, stride, matrixLayout); - mat.store(outputBuffer, 0, stride, matrixLayout); + let mat = coopMatLoad(inputBuffer, 0, stride); + mat.Store(outputBuffer, 0, stride); } -- cgit v1.2.3