diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-05-15 03:47:43 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-14 20:47:43 -0700 |
| commit | 2580bb02f7a079ab1c0106b5960a21ed1627bca0 (patch) | |
| tree | c4fe31e6314f514c9bb079d0fa15ee53adf7396f /tests/cooperative-matrix/struct.slang | |
| parent | b4d3d3017640581c21b52a12413d3f074ab1c5c1 (diff) | |
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<T,S,M,N,R>::Transpose
CoopMat<T,S,M,N,R>::ReduceRow
CoopMat<T,S,M,N,R>::ReduceColumn
CoopMat<T,S,M,N,R>::ReduceRowAndColumn
CoopMat<T,S,M,N,R>::Reduce2x2
Diffstat (limited to 'tests/cooperative-matrix/struct.slang')
| -rw-r--r-- | tests/cooperative-matrix/struct.slang | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/cooperative-matrix/struct.slang b/tests/cooperative-matrix/struct.slang index 38d98b44f..592e553ae 100644 --- a/tests/cooperative-matrix/struct.slang +++ b/tests/cooperative-matrix/struct.slang @@ -19,7 +19,9 @@ ByteAddressBuffer input2; //TEST_INPUT:ubuffer(stride=4, count=256):out,name=outputBuffer RWStructuredBuffer<float> outputBuffer; -typealias CoopMatType = CoopMat<float, CoopMatScope::Subgroup, 16, 16, CoopMatMatrixUse::MatrixAccumulator>; +using namespace linalg; + +typealias CoopMatType = CoopMat<float, MemoryScope.Subgroup, 16, 16, CoopMatMatrixUse::MatrixAccumulator>; struct MyStruct { @@ -34,9 +36,9 @@ void computeMain() let matrixLayout = CoopMatMatrixLayout::RowMajor; MyStruct s; - s.mat1 = CoopMatType.load(input1, 0, stride, matrixLayout); - s.mat2 = CoopMatType.load(input2, 0, stride, matrixLayout); + s.mat1 = CoopMatType.Load<CoopMatMatrixLayout::RowMajor>(input1, 0, stride); + s.mat2 = CoopMatType.Load<CoopMatMatrixLayout::RowMajor>(input2, 0, stride); - s.mat1.store(outputBuffer, 0, stride, matrixLayout); - s.mat2.store(outputBuffer, 4, stride, matrixLayout); + s.mat1.Store<CoopMatMatrixLayout::RowMajor>(outputBuffer, 0, stride); + s.mat2.Store<CoopMatMatrixLayout::RowMajor>(outputBuffer, 4, stride); } |
