yum-mirror/slang

Making it easier to work with shaders

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

Harsh Aggarwal (NVIDIA)Enable CUDA Test Enablement - Batch 1: Autodiff Tests (1-16) (#8139)c3df36043

master
629 B34 linesraw
1//TEST:COMPARE_COMPUTE(filecheck-buffer=CHK): -output-using-type
2//TEST:COMPARE_COMPUTE(filecheck-buffer=CHK): -output-using-type -cuda
3
4interface ITest
5{
6    __subscript(int i) -> float
7    {
8        [BackwardDifferentiable] get;
9    }
10}
11struct Test : ITest
12{
13    __subscript(int i) -> float
14    {
15        [BackwardDifferentiable] get { return 5.0f * i; }
16    }
17}
18
19[Differentiable]
20float test(ITest arg)
21{
22    return arg[1];
23}
24
25//TEST_INPUT:set output = out ubuffer(data=[0 0 0 0], stride=4)
26RWStructuredBuffer<float> output;
27
28[numthreads(1,1,1)]
29void computeMain()
30{
31    Test t = {};
32    output[0] = test(t);
33    // CHK: 5.0
34}