diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-08-20 20:56:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-20 17:56:04 -0700 |
| commit | 03e1e17745920c8e3a7b6f4e3b1e64062589604a (patch) | |
| tree | 716e80dc2bed17cccb8f00b75f165b83a615622e /tests | |
| parent | bcb53910875e787773e7b60f31ded3afba3aa843 (diff) | |
Fix `tests\autodiff\reverse-while-loop-3.slang` test (#4886)
* Fix `tests\autodiff\reverse-while-loop-3.slang` test
Fixes: #4876
Fix `tests\autodiff\reverse-while-loop-3.slang` test to have correct listed output values
* set default to 1 (different val)
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/autodiff/reverse-while-loop-3.slang | 19 | ||||
| -rw-r--r-- | tests/autodiff/reverse-while-loop-3.slang.expected.txt | 6 |
2 files changed, 12 insertions, 13 deletions
diff --git a/tests/autodiff/reverse-while-loop-3.slang b/tests/autodiff/reverse-while-loop-3.slang index 67f030030..0a27437e9 100644 --- a/tests/autodiff/reverse-while-loop-3.slang +++ b/tests/autodiff/reverse-while-loop-3.slang @@ -1,12 +1,12 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj -output-using-type -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -output-using-type -//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -output-using-type -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-slang -compute -shaderobj -output-using-type +//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-vk -compute -shaderobj -output-using-type +//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cpu -compute -output-using-type -shaderobj -//TEST_INPUT:ubuffer(data=[0 0 0 0 0], stride=4):out,name=outputBuffer +//TEST_INPUT:ubuffer(data=[1], stride=4):out,name=outputBuffer RWStructuredBuffer<float> outputBuffer; // This test isn't actually testing the output, but rather that the compiler doesn't crash upon -// encountering a specific loop pattern. ('Data' is non-differentiable here, so the expected output is 0)s +// encountering a specific loop pattern. ('Data' is non-differentiable here, so the expected output is 0) // typedef DifferentialPair<float> dpfloat; @@ -21,6 +21,10 @@ struct P struct Data { + __init(float dataIn) + { + this.t = dataIn; + } float t; }; @@ -32,7 +36,7 @@ void updateData(Data data) [BackwardDifferentiable] float test_simple_while(float y, uint n) { - Data d = { y }; + Data d = Data(y); P p; p.terminated = false; int i = n; @@ -61,6 +65,7 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) dpfloat dpa = dpfloat(1.0, 0.0); __bwd_diff(test_simple_while)(dpa, 2, 1.0f); - outputBuffer[0] = dpa.d; // Expect: 8.0 + outputBuffer[0] = dpa.d; + //BUF: 0 } } diff --git a/tests/autodiff/reverse-while-loop-3.slang.expected.txt b/tests/autodiff/reverse-while-loop-3.slang.expected.txt deleted file mode 100644 index ca54c9afe..000000000 --- a/tests/autodiff/reverse-while-loop-3.slang.expected.txt +++ /dev/null @@ -1,6 +0,0 @@ -type: float -1.000000 -0.000000 -0.000000 -0.000000 -0.000000 |
