summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-03-25 16:45:56 -0400
committerGitHub <noreply@github.com>2020-03-25 16:45:56 -0400
commitb3e6f1b2cffa8def593e97a00576eeba0f947ebc (patch)
treef953b64922bb3fe69ef1ac26bef0eda2741626d3 /tests
parent28a0ca96a1ad2a3f0e09cc97b866f3b6338a09fa (diff)
Unroll target improvements (#1291)
* Add unroll support for CUDA, and preliminary for C++. Document [unroll] support. * Fix loop-unroll to run on CPU, and test on CPU and elsewhere. Fix bug in emitting loop unroll condition. * Improved comment. * Added support for vk/glsl loop unrolling.
Diffstat (limited to 'tests')
-rw-r--r--tests/compute/loop-unroll.slang18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/compute/loop-unroll.slang b/tests/compute/loop-unroll.slang
index b8ec06768..25f25b0ec 100644
--- a/tests/compute/loop-unroll.slang
+++ b/tests/compute/loop-unroll.slang
@@ -1,7 +1,15 @@
//TEST(compute):COMPARE_COMPUTE:
+//TEST(compute):COMPARE_COMPUTE:-dx12
+//TODO(JS): This test fails with a crash in CreateComputePipelineState, so disabled for now
+//DISABLE_TEST(compute):COMPARE_COMPUTE:-dx12 -use-dxil
+//TEST(compute):COMPARE_COMPUTE:-cpu
+//TEST(compute):COMPARE_COMPUTE:-cuda
+// Note VK output is not loop unrolled
+//TEST(compute):COMPARE_COMPUTE:-vk
-//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):out
-//TEST_INPUT:ubuffer(data=[1 2 3 0], stride=4):
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out, name buffers[0]
+//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):name buffers[1]
+//TEST_INPUT:ubuffer(data=[1 2 3 0], stride=4):name buffers[2]
// Check that we propagate the `[unroll]` attribute
// through to HLSL output correctly.
@@ -10,7 +18,7 @@
// it will generate a warning output from fxc, and the
// test will fail to match the expected output.
-RWStructuredBuffer<int> buffers[2];
+RWStructuredBuffer<int> buffers[3];
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
@@ -20,12 +28,12 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
// Note: using `unroll` as a variable name to validate that
// the lookup process for attribute names doesn't run into
// problems because of local declarations with the same name.
- int unroll = buffers[1][tid];
+ int unroll = buffers[2][tid];
[unroll]
for(int ii = 0; ii < 2; ii++)
{
- unroll = buffers[ii][unroll];
+ unroll = buffers[ii + 1][unroll];
}
buffers[0][tid] = unroll;