diff options
| author | Yong He <yonghe@outlook.com> | 2022-10-27 11:49:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-27 11:49:58 -0700 |
| commit | 351e78f3abc54f114237d4af64f8199476ebf176 (patch) | |
| tree | c9729a3e7b6469d8f12259dc436eb9c59b9e5cb4 /tests | |
| parent | 8e11063bfcec528e70f5e80e5db9fca7d4016737 (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.slang | 4 | ||||
| -rw-r--r-- | tests/autodiff/differential-method-synthesis.slang.expected.txt | 4 |
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 |
