yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
d58243d90
master
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly -render-feature cooperative-matrix-conversions 2 3//CHECK: type: int32_t 4//CHECK: 1 5//CHECK-COUNT-15: 0 6//CHECK: 2 7//CHECK-COUNT-15: 0 8//CHECK: 3 9//CHECK-COUNT-15: 0 10//CHECK: 4 11//CHECK-COUNT-15: 0 12//CHECK: 5 13//CHECK-COUNT-15: 0 14//CHECK: 6 15//CHECK-COUNT-15: 0 16//CHECK: 7 17//CHECK-COUNT-15: 0 18//CHECK: 8 19//CHECK-COUNT-15: 0 20 21//TEST_INPUT:ubuffer(data=[1 2 3 4 5 6 7 8], stride=4, count=256),name=buf 22StructuredBuffer<int32_t> inputBuffer; 23 24//TEST_INPUT:ubuffer(stride=4, count=256):out,name=outputBuffer 25RWStructuredBuffer<int32_t> outputBuffer; 26 27using namespace linalg; 28 29[numthreads(32, 1, 1)] 30void computeMain() 31{ 32 let stride = 16; 33 let mat = coopMatLoad<int32_t, MemoryScope.Subgroup, 16, 16, CoopMatMatrixUse.MatrixAccumulator, CoopMatMatrixLayout.RowMajor>(inputBuffer, 0, stride); 34 let result = mat.Transpose(); 35 result.Store<CoopMatMatrixLayout.RowMajor>(outputBuffer, 0, stride); 36}