diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-24 20:17:46 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-24 20:17:46 -0700 |
| commit | 666af0962b6ab41489a3a3287db83f77c2f6461a (patch) | |
| tree | 81a1247188ac03f1e8132e58ec31ae0f28c8c530 /tests/autodiff | |
| parent | 7292edbd3eba3da7e8490ad19169a7d18283057a (diff) | |
Switch to short circuiting semantics for scalar `?:` operator. (#2733)
Diffstat (limited to 'tests/autodiff')
| -rw-r--r-- | tests/autodiff/select.slang | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/autodiff/select.slang b/tests/autodiff/select.slang index 261c170db..20abab977 100644 --- a/tests/autodiff/select.slang +++ b/tests/autodiff/select.slang @@ -10,7 +10,7 @@ typedef float.Differential dfloat; [BackwardDifferentiable] float f(float x, float y) { - return x > 0.5 ? x : y; + return x > 0.0 ? sqrt(x)*sqrt(x) : y; } [numthreads(1, 1, 1)] @@ -27,7 +27,7 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) } { - dpfloat dpa = dpfloat(0.3, 1.0); + dpfloat dpa = dpfloat(-0.3, 1.0); dpfloat dpb = dpfloat(0.3, 1.0); __bwd_diff(f)(dpa, dpb, 1.0); |
