yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Harsh Aggarwal (NVIDIA)Fix#8086: Batch-10: Enable cuda tests (#8270)639978008

master
860 B20 linesraw
1//TEST:SIMPLE(filecheck=CHECK_HLSL): -target hlsl -stage compute -entry computeMain
2//TEST:SIMPLE(filecheck=CHECK_CUDA): -target cuda -stage compute -entry computeMain
3
4//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer
5RWStructuredBuffer<int> outputBuffer;
6
7// HLSL preserves WaveSize attribute in generated code
8// CHECK_HLSL: [WaveSize(4)]
9
10// CUDA doesn't emit WaveSize attribute but generates valid compute kernel
11// CHECK_CUDA: RWStructuredBuffer<int> [[OUTPUTBUFFER:outputBuffer[_0-9]*]];
12// CHECK_CUDA: extern "C" __global__ void computeMain()
13// CHECK_CUDA: *(&([[GLOBALPARAMS:globalParams[_0-9]*]]->[[OUTPUTBUFFER]])[[[TID:tid[_0-9]*]]]) = [[TID]];
14[WaveSize(4)]
15[numthreads(4, 1, 1)]
16void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
17{
18	int tid = dispatchThreadID.x;
19	outputBuffer[tid] = tid;
20}