summaryrefslogtreecommitdiff
path: root/tests/compute/semantic.slang
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-09-17 12:25:45 -0400
committerGitHub <noreply@github.com>2019-09-17 12:25:45 -0400
commit3af404da7f7f125464b78159940cb3fc06e69cc5 (patch)
treed1640fc1ac08be8a15420a8603eba991833a1792 /tests/compute/semantic.slang
parent3758a50dae81973b00541f2a151e3ee9cd2d1645 (diff)
CPU ABI improvements (#1056)
* WIP: Improving CPU performance/ABI * Optionally output code on CPU for groupThreadID and groupID. * Added ability to set compute dispatch size on command line for render-test. Dispatch compute tests taking into account dispatch size. Added test for semantics are working. * Test using GroupRange. * Fix problem with adding \n for externa diagnostic - to do it if there isn't a \n at the end. Change the ouput order (put result before) so last value is diagnostic string.
Diffstat (limited to 'tests/compute/semantic.slang')
-rw-r--r--tests/compute/semantic.slang13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/compute/semantic.slang b/tests/compute/semantic.slang
new file mode 100644
index 000000000..12b0ca853
--- /dev/null
+++ b/tests/compute/semantic.slang
@@ -0,0 +1,13 @@
+//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 -compute-dispatch 3,1,1
+//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -compute-dispatch 3,1,1
+//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -compute-dispatch 3,1,1
+//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -compute-dispatch 3,1,1
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0], stride=4):dxbinding(0),glbinding(0),out,name outputBuffer
+RWStructuredBuffer<int> outputBuffer;
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID, uint3 groupID : SV_GroupID, uint3 groupThreadID : SV_GroupThreadId)
+{
+ outputBuffer[dispatchThreadID.x] = (dispatchThreadID.x << 8) | (groupID.x << 4) | (groupThreadID.x);
+} \ No newline at end of file