summaryrefslogtreecommitdiffstats
path: root/tests/cooperative-matrix/subscript.slang
blob: efa65de87ea10956fd82ef88f8fd05c530a5aa89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type  -emit-spirv-directly

// CHECK: type: int32_t
// CHECK-NEXT: 2
// CHECK-NEXT: 4
// CHECK: 7
// CHECK-NEXT: 11

//TEST_INPUT:ubuffer(stride=4, count=256):out,name=outputBuffer
RWStructuredBuffer<int32_t> outputBuffer;

using namespace linalg;

typealias CoopMatType = CoopMat<int32_t, MemoryScope.Subgroup, 16, 16, CoopMatMatrixUse::MatrixAccumulator>;

[numthreads(32, 1, 1)]
void computeMain()
{
    CoopMatType mat;
    mat[0] = 2;
    mat[1] = mat[0]+2;
    mat[2] = mat[1]+3;
    mat[3] = mat[2]+4;
    mat.Store<CoopMatMatrixLayout::RowMajor>(outputBuffer, 0, 16);
}