summaryrefslogtreecommitdiffstats
path: root/tests/autodiff/reverse-struct-types.slang
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2022-12-12 17:33:44 -0500
committerGitHub <noreply@github.com>2022-12-12 14:33:44 -0800
commit9d048351d283f8df2a68aca52b3573dcbb8cdb9b (patch)
tree71b869fd3d460193a1dccc77b9c0b6e3511ab53b /tests/autodiff/reverse-struct-types.slang
parentc2dc1a86ed2f5e160749fe9f99b70db6c3e4d7a6 (diff)
Added support for nested calls (#2562)
* Added initial support for nested calls * removed comments Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/autodiff/reverse-struct-types.slang')
-rw-r--r--tests/autodiff/reverse-struct-types.slang23
1 files changed, 1 insertions, 22 deletions
diff --git a/tests/autodiff/reverse-struct-types.slang b/tests/autodiff/reverse-struct-types.slang
index 699e50480..d2b52a008 100644
--- a/tests/autodiff/reverse-struct-types.slang
+++ b/tests/autodiff/reverse-struct-types.slang
@@ -9,27 +9,6 @@ struct A : IDifferentiable
{
float x;
float y;
-
- [__unsafeForceInlineEarly]
- static Differential dzero()
- {
- Differential b = {0.0, float.dzero()};
- return b;
- }
-
- [__unsafeForceInlineEarly]
- static Differential dadd(Differential a, Differential b)
- {
- Differential o = {a.x + b.x, 0.0};
- return o;
- }
-
- [__unsafeForceInlineEarly]
- static Differential dmul(This a, Differential b)
- {
- Differential o = {a.x * b.x, 0.0};
- return o;
- }
};
typedef DifferentialPair<A> dpA;
@@ -56,7 +35,7 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
A.Differential dout = {1.0, 1.0};
__bwd_diff(f)(dpa, dout);
- outputBuffer[0] = dpa.d.x; // Expect: 10
+ outputBuffer[0] = dpa.d.x; // Expect: 7
outputBuffer[1] = dpa.d.y; // Expect: 0
}
}