summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/autodiff-custom-diff-inout.slang
blob: 32f36dce485c815932be30d2ee05e398ac27469d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//DIAGNOSTIC_TEST:SIMPLE:

[BackwardDerivative(__d_f)]
float f(float x)
{
    return x * x;
}

void __d_f(float x, float.Differential dout)
{
}

float main(float x)
{
    DifferentialPair<float> dpx = diffPair(x, 1.f);
    bwd_diff(f)(dpx, 1.f);
}