summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-10-27 11:49:58 -0700
committerGitHub <noreply@github.com>2022-10-27 11:49:58 -0700
commit351e78f3abc54f114237d4af64f8199476ebf176 (patch)
treec9729a3e7b6469d8f12259dc436eb9c59b9e5cb4 /tests
parent8e11063bfcec528e70f5e80e5db9fca7d4016737 (diff)
Extend test coverage for differential method synthesis. (#2470)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/autodiff/differential-method-synthesis.slang4
-rw-r--r--tests/autodiff/differential-method-synthesis.slang.expected.txt4
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/autodiff/differential-method-synthesis.slang b/tests/autodiff/differential-method-synthesis.slang
index 73afc4411..53957fd91 100644
--- a/tests/autodiff/differential-method-synthesis.slang
+++ b/tests/autodiff/differential-method-synthesis.slang
@@ -40,6 +40,8 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
A a = {1.0, 2.0};
A.Differential b = {0.2};
dpA dpa = dpA(a, b);
- outputBuffer[0] = __jvp(f)(dpa).d().b.x; // Expect: 0
+ outputBuffer[0] = __jvp(f)(dpa).d().b.x; // Expect: 0
+ outputBuffer[1] = A.dadd(b, b).b.x; // Expect: 0.4
+ outputBuffer[2] = A.dmul(a, b).b.x; // Expect: 0.2
}
}
diff --git a/tests/autodiff/differential-method-synthesis.slang.expected.txt b/tests/autodiff/differential-method-synthesis.slang.expected.txt
index e070cf84d..5fbff9752 100644
--- a/tests/autodiff/differential-method-synthesis.slang.expected.txt
+++ b/tests/autodiff/differential-method-synthesis.slang.expected.txt
@@ -1,6 +1,6 @@
type: float
0.000000
-0.000000
-0.000000
+0.400000
+0.200000
0.000000
0.000000