diff options
| author | Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> | 2023-03-15 22:26:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-15 19:26:58 -0700 |
| commit | 71efd949fa5276e2464416fcf237f8fd2c486281 (patch) | |
| tree | a5b24cd077f2ecc3f74d4dd4671c8260eb6e9b67 /tests/autodiff/reverse-control-flow.slang | |
| parent | 38e62199cc75ce34608491c8dd299eb330bde518 (diff) | |
AD: Primal-Hoisting Rework + Checkpoint Policy Framework (#2702)
Diffstat (limited to 'tests/autodiff/reverse-control-flow.slang')
| -rw-r--r-- | tests/autodiff/reverse-control-flow.slang | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/tests/autodiff/reverse-control-flow.slang b/tests/autodiff/reverse-control-flow.slang deleted file mode 100644 index 7d2f518be..000000000 --- a/tests/autodiff/reverse-control-flow.slang +++ /dev/null @@ -1,42 +0,0 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type - -//TEST_INPUT:ubuffer(data=[0 0 0 0 0], stride=4):out,name=outputBuffer -RWStructuredBuffer<float> outputBuffer; - -typedef DifferentialPair<float> dpfloat; -typedef float.Differential dfloat; - -[BackwardDifferentiable] -float test_single_branch(float y) -{ - float o; - if (y > 0.5) - { - o = y * 2.0f; - } - else - { - o = y + 1.0f; - } - - return o; -} - -[numthreads(1, 1, 1)] -void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) -{ - { - dpfloat dpa = dpfloat(1.0, 0.0); - - __bwd_diff(test_single_branch)(dpa, 1.0f); - outputBuffer[0] = dpa.d; // Expect: 2.0 - } - - { - dpfloat dpa = dpfloat(0.4, 0.0); - - __bwd_diff(test_single_branch)(dpa, 1.0f); - outputBuffer[1] = dpa.d; // Expect: 1.0 - } -} |
