From 351e78f3abc54f114237d4af64f8199476ebf176 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 27 Oct 2022 11:49:58 -0700 Subject: Extend test coverage for differential method synthesis. (#2470) Co-authored-by: Yong He --- tests/autodiff/differential-method-synthesis.slang | 4 +++- tests/autodiff/differential-method-synthesis.slang.expected.txt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3