summaryrefslogtreecommitdiffstats
path: root/tests/compute
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-01-22 11:06:20 -0500
committerGitHub <noreply@github.com>2020-01-22 11:06:20 -0500
commitc74a700681b0be44a74f16b0f9eaad05bba159d2 (patch)
tree6855baa362b336f17e199f1ad33242e73e98f6a7 /tests/compute
parent346a56749c99e4e05d24ad6217f34dd5d44af189 (diff)
WIP HLSL intrinsic coverage (#1171)
* Added hlsl-intrinsic test folder. Enabled ceil as works across targets. * log10 support. * Fix float % on CPU/CUDA to match HLSL which is fmod (not fremainder). * Added log10 tests back to scalar-float.slang * Don't add the ( for $Sx - it's clearer what's going on without it. * Works on CUDA/CPU. Problem with asint/asuint do not seem to be found. * Only asuint exists for double. * Support countbits on CUDA and C++. * Fix typo in C++ population count. * First pass at int vector intrinsic tests. * Swizzle for int. * Bit cast tests on CUDA. * Fix warning on gcc. * Fix bit-cast-double execution on CUDA. * scalar-int test working on gcc release.
Diffstat (limited to 'tests/compute')
-rw-r--r--tests/compute/bit-cast-double.slang21
-rw-r--r--tests/compute/bit-cast-double.slang.expected.txt4
-rw-r--r--tests/compute/bit-cast.slang71
-rw-r--r--tests/compute/bit-cast.slang.expected.txt12
4 files changed, 0 insertions, 108 deletions
diff --git a/tests/compute/bit-cast-double.slang b/tests/compute/bit-cast-double.slang
deleted file mode 100644
index 6b0925a58..000000000
--- a/tests/compute/bit-cast-double.slang
+++ /dev/null
@@ -1,21 +0,0 @@
-//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -cpu
-//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute
-//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12
-//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute
-
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
-RWStructuredBuffer<int> outputBuffer;
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- double d = double(dispatchThreadID.x);
-
- uint hi, low;
- asuint(d, low, hi);
-
- // Reconstruct
- double r = asdouble(low, hi);
-
- outputBuffer[dispatchThreadID.x] = int(r);
-} \ No newline at end of file
diff --git a/tests/compute/bit-cast-double.slang.expected.txt b/tests/compute/bit-cast-double.slang.expected.txt
deleted file mode 100644
index bc856dafa..000000000
--- a/tests/compute/bit-cast-double.slang.expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-0
-1
-2
-3
diff --git a/tests/compute/bit-cast.slang b/tests/compute/bit-cast.slang
deleted file mode 100644
index a8fec61e3..000000000
--- a/tests/compute/bit-cast.slang
+++ /dev/null
@@ -1,71 +0,0 @@
-//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute
-//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute
-//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12
-//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute
-
-//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer
-
-RWStructuredBuffer<int> outputBuffer;
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- const int id = asint(dispatchThreadID.x);
-
- {
- int4 i4 = int4(id, id + 1, id + 2, id + 3);
-
- // Identity - int vector
- i4 = asint(i4);
-
- uint3 u3 = asuint(i4.xyz);
- // Identity - uint vec
- u3 = asuint(u3);
-
- int2 i2 = asint(u3.xy);
- uint u1 = asuint(i2.x);
-
- // Identity - uint scalar
- u1 = asuint(u1);
-
- outputBuffer[id + 0] = int(u1);
- }
-
- {
- uint v = asuint(id);
- uint4 u4 = uint4(v, v + 1, v + 2, v + 3);
- int3 i3 = asint(u4.xyz);
- uint2 u2 = asuint(i3.xy);
- int i1 = asint(u2.x);
-
- // Identity - int scalar
- i1 = asint(i1);
-
- outputBuffer[id + 4] = i1;
- }
-
- {
- // Make i4 holds id as floats so we know they are valid float values and not denormals
- int4 i4 = int4(asint(float(id)), asint(float(id + 1)), asint(float(id + 2)), asint(float(id + 3)));
- float4 f4 = asfloat(asfloat(i4));
-
- // Identity - float vector
- f4 = asfloat(f4);
-
- uint3 u3 = asuint(f4.xyz);
- float2 f2 = asfloat(u3.xy);
- uint u1 = asuint(f2.x);
-
- float f1 = asfloat(asfloat(u1));
-
- // Identity - float scalar
- f1 = asfloat(f1);
-
- int i1 = asint(f1);
-
- float f1_ = asfloat(i1);
- int i1_ = asint(f1_);
-
- outputBuffer[id + 8] = (int)asfloat(i1_);
- }
-} \ No newline at end of file
diff --git a/tests/compute/bit-cast.slang.expected.txt b/tests/compute/bit-cast.slang.expected.txt
deleted file mode 100644
index f5414793f..000000000
--- a/tests/compute/bit-cast.slang.expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-0
-1
-2
-3
-0
-1
-2
-3
-0
-1
-2
-3 \ No newline at end of file