[Piglit] [PATCH] CL: Add int2 stack and int2/int4 constant load tests

Aaron Watry awatry at gmail.com
Fri Jun 21 07:42:12 PDT 2013


v2: Split the constant load test into a separate file,
    and add int4 constant load test
---
 tests/cl/program/execute/constant-load.cl | 24 ++++++++++++++++++++++++
 tests/cl/program/execute/v2i32-stack.cl   | 28 ++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 tests/cl/program/execute/constant-load.cl
 create mode 100644 tests/cl/program/execute/v2i32-stack.cl

diff --git a/tests/cl/program/execute/constant-load.cl b/tests/cl/program/execute/constant-load.cl
new file mode 100644
index 0000000..68ac8c4
--- /dev/null
+++ b/tests/cl/program/execute/constant-load.cl
@@ -0,0 +1,24 @@
+/*!
+[config]
+
+[test]
+kernel_name: constant_load_global_store_2
+name: constant load global write
+arg_out: 0 buffer int2[1] 1 2
+arg_in:  1 buffer int2[1] 1 2
+
+[test]
+kernel_name: constant_load_global_store_4
+name: constant load global write
+arg_out: 0 buffer int4[1] 1 2 3 4
+arg_in:  1 buffer int4[1] 1 2 3 4
+
+!*/
+
+kernel void constant_load_global_store_2(global int2 *out, constant int2 *in){
+    out[0] = *in;
+}
+
+kernel void constant_load_global_store_4(global int4 *out, constant int4 *in){
+    out[0] = *in;
+}
diff --git a/tests/cl/program/execute/v2i32-stack.cl b/tests/cl/program/execute/v2i32-stack.cl
new file mode 100644
index 0000000..e61e386
--- /dev/null
+++ b/tests/cl/program/execute/v2i32-stack.cl
@@ -0,0 +1,28 @@
+/*!
+[config]
+
+[test]
+kernel_name: direct_write_indirect_read
+name: direct write - indirect read
+arg_out: 0 buffer int2[1] 0 1
+arg_in:  1 int 0
+
+[test]
+kernel_name: direct_write_indirect_read
+name: direct write - indirect read
+arg_out: 0 buffer int2[1] 2 3
+arg_in:  1 int 1
+
+!*/
+
+kernel void direct_write_indirect_read(global int2 *out, int index) {
+
+	int2 stack[2];
+	stack[0].s0 = 0;
+	stack[0].s1 = 1;
+
+	stack[1].s0 = 2;
+	stack[1].s1 = 3;
+
+	out[0] = stack[index];
+}
-- 
1.8.1.2



More information about the Piglit mailing list