summaryrefslogtreecommitdiff
path: root/tests/autodiff
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-12-09 09:09:53 -0800
committerGitHub <noreply@github.com>2022-12-09 09:09:53 -0800
commit8d359fc6133fa49d2d3b7f8bb4b37916e719c344 (patch)
tree9270ccd8ee1e9162a516c5c36e17e049fe8b6244 /tests/autodiff
parent41eb19e65a0974e23048bd7b3b1eb1e2f569b1d0 (diff)
Add `diffPair` stdlib function. (#2560)
Diffstat (limited to 'tests/autodiff')
-rw-r--r--tests/autodiff/matrix-arithmetic-fwd.slang6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/autodiff/matrix-arithmetic-fwd.slang b/tests/autodiff/matrix-arithmetic-fwd.slang
index 7a953cef8..ee909551a 100644
--- a/tests/autodiff/matrix-arithmetic-fwd.slang
+++ b/tests/autodiff/matrix-arithmetic-fwd.slang
@@ -27,8 +27,8 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
float3x3 da = float3x3(1.0);
outputBuffer[0] = __fwd_diff(g)(
- DifferentialPair<float3x3>(a, da),
- DifferentialPair<float3x3>(b, da)).d._11; // Expect: 8
+ diffPair(a, da),
+ diffPair(b, da)).d._11; // Expect: 8
float2x2 l = float2x2(1.0, 2.0, 3.0, 4.0);
float2x2 r = float2x2(10.0, 11.0, 12.0, 13.0);
@@ -37,5 +37,5 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
//float2x2 epsilon = d * 0.001f;
//outputBuffer[1] = (h(l + epsilon, r + epsilon) - h(l - epsilon, r - epsilon)) / (epsilon[0][0] * 2.0));
- outputBuffer[1] = __fwd_diff(h)(DifferentialPair<float2x2>(l, d), DifferentialPair<float2x2>(r, d)).d; // Expect 83.0
+ outputBuffer[1] = __fwd_diff(h)(diffPair(l, d), diffPair(r, d)).d; // Expect 83.0
}