[Piglit] [PATCH] cl: Add test cases from fdo bug 65822

Aaron Watry awatry at gmail.com
Tue Oct 15 22:58:24 CEST 2013


Adding four new test cases:
1) Add followed by a divide within a loop
2) Add followed by a divide
3) Test that code in else works correctly when true branch isn't taken
4) Unsigned integer divide

All pass on r600g (CEDAR). radeonsi (Pitcairn) still fails add-then-div-looped

https://bugs.freedesktop.org/show_bug.cgi?id=65822
---
 tests/cl/program/execute/add-then-div-looped.cl | 21 +++++++++++++++++++++
 tests/cl/program/execute/add-then-div.cl        | 19 +++++++++++++++++++
 tests/cl/program/execute/code-in-else.cl        | 20 ++++++++++++++++++++
 tests/cl/program/execute/divide-uint.cl         | 19 +++++++++++++++++++
 4 files changed, 79 insertions(+)
 create mode 100644 tests/cl/program/execute/add-then-div-looped.cl
 create mode 100644 tests/cl/program/execute/add-then-div.cl
 create mode 100644 tests/cl/program/execute/code-in-else.cl
 create mode 100644 tests/cl/program/execute/divide-uint.cl

diff --git a/tests/cl/program/execute/add-then-div-looped.cl b/tests/cl/program/execute/add-then-div-looped.cl
new file mode 100644
index 0000000..a24a76e
--- /dev/null
+++ b/tests/cl/program/execute/add-then-div-looped.cl
@@ -0,0 +1,21 @@
+/*!
+[config]
+name: (a+b) div 3 run 10 times
+kernel_name: test2
+clc_version_min: 10
+
+dimensions: 1
+global_size: 8 0 0
+
+[test]
+arg_in:  0 buffer int[80]  repeat 1 2 3 4  5  6  7  8
+arg_in:  1 buffer int[80]  repeat 2 4 6 8 10 12 14 16
+arg_out: 2 buffer int[80] repeat 1 2 3 4  5  6  7  8
+
+!*/
+__kernel void test2(__global const uint *a,  __global const uint *b, __global uint *c){
+    size_t id=get_global_id(0);
+    for(ulong i=0;i<10;i++){
+        c[8*i+id]=(a[id]+b[id])/3;
+    }
+}
diff --git a/tests/cl/program/execute/add-then-div.cl b/tests/cl/program/execute/add-then-div.cl
new file mode 100644
index 0000000..08cf41a
--- /dev/null
+++ b/tests/cl/program/execute/add-then-div.cl
@@ -0,0 +1,19 @@
+/*!
+[config]
+name: (a+b) div 3
+kernel_name: test1
+clc_version_min: 10
+
+dimensions: 1
+global_size: 8 0 0
+
+[test]
+arg_in:  0 buffer int[8]  1 2 3 4  5  6  7  8
+arg_in:  1 buffer int[8]  2 4 6 8 10 12 14 16
+arg_out: 2 buffer int[8] 1 2 3 4  5  6  7  8
+
+!*/
+__kernel void test1(__global const uint *a,  __global const uint *b, __global uint *c){
+    size_t id=get_global_id(0);
+    c[id]=(a[id]+b[id])/3;
+}
diff --git a/tests/cl/program/execute/code-in-else.cl b/tests/cl/program/execute/code-in-else.cl
new file mode 100644
index 0000000..e535f95
--- /dev/null
+++ b/tests/cl/program/execute/code-in-else.cl
@@ -0,0 +1,20 @@
+/*!
+[config]
+name: code in else block
+kernel_name: test4
+clc_version_min: 10
+
+dimensions: 1
+global_size: 8 0 0
+
+[test]
+arg_in: 0 buffer int[8]  1 2 3  4  5  6  7  8
+arg_in: 1 buffer int[8]  2 4 6  8 10 12 14 16
+arg_out: 2 buffer int[8] 3 6 9 12 15 18 21 24
+
+!*/
+__kernel void test4(__global const uint *a,  __global const uint *b, __global uint *c){
+    size_t id=get_global_id(0);
+    if(b[id]==0) c[id]=0;
+    else c[id]=a[id]+b[id];
+}
diff --git a/tests/cl/program/execute/divide-uint.cl b/tests/cl/program/execute/divide-uint.cl
new file mode 100644
index 0000000..446819e
--- /dev/null
+++ b/tests/cl/program/execute/divide-uint.cl
@@ -0,0 +1,19 @@
+/*!
+[config]
+name: a div b
+kernel_name: test3
+clc_version_min: 10
+
+dimensions: 1
+global_size: 8 0 0
+
+[test]
+arg_in:  0 buffer int[8] 1 2 3 4  5  6  7  8
+arg_in:  1 buffer int[8] 2 4 6 8 10 12 14 16
+arg_out: 2 buffer int[8] 2 2 2 2  2  2  2  2
+
+!*/
+__kernel void test3(__global const uint *a,  __global const uint *b, __global uint *c){
+    size_t id=get_global_id(0);
+    c[id]=b[id]/a[id];
+}
-- 
1.8.1.2



More information about the Piglit mailing list