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=CHK):-vk -output-using-type -emit-spirv-directly 2 3// Note the length is NOT row * column. 4// When the memory scope is set to subgroup, each thread gets 16 * 16 / 32 = 8 where 32 is the value used in `numthreads`. 5 6//CHK:8 7 8//TEST_INPUT:ubuffer(stride=4, count=1):out,name=outputBuffer 9RWStructuredBuffer<int32_t> outputBuffer; 10 11using namespace linalg; 12 13// It appears that only Subgroup is supposed at the moment 14typealias CoopMatSubgroup = CoopMat<int32_t, MemoryScope.Subgroup, 16, 16, CoopMatMatrixUse.MatrixAccumulator>; 15 16[numthreads(32, 1, 1)] 17void computeMain() 18{ 19 outputBuffer[0] = CoopMatSubgroup.GetLength(); 20} 21