yum-mirror/slang

Making it easier to work with shaders

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

Sai Praveen BangaruIssue diagnostic for incorrect parameter types & directionality when defining custom derivatives (#2947)a3ad4dd77

master
247 B17 linesraw
1//DIAGNOSTIC_TEST:SIMPLE:
2
3[BackwardDerivative(__d_f)]
4float f(float x)
5{
6    return x * x;
7}
8
9void __d_f(float x, float.Differential dout)
10{
11}
12
13float main(float x)
14{
15    DifferentialPair<float> dpx = diffPair(x, 1.f);
16    bwd_diff(f)(dpx, 1.f);
17}