[Piglit] [PATCH] CL: Add v2i32 stack and constant load tests

Aaron Watry awatry at gmail.com
Thu Jun 20 14:51:04 PDT 2013


Based on the v3i32-stack.cl test but for the int2 data type.

Also tests that v2i32 load from constant address space with a store to
the global address space works correctly.

Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 tests/cl/program/execute/v2i32-stack.cl | 38 +++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 tests/cl/program/execute/v2i32-stack.cl

diff --git a/tests/cl/program/execute/v2i32-stack.cl b/tests/cl/program/execute/v2i32-stack.cl
new file mode 100644
index 0000000..f60cf1f
--- /dev/null
+++ b/tests/cl/program/execute/v2i32-stack.cl
@@ -0,0 +1,38 @@
+/*!
+[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
+
+[test]
+kernel_name: constant_load_global_store
+name: constant load global write
+arg_out: 0 buffer int2[1] 1 2
+arg_in:  1 buffer int2[1] 1 2
+
+!*/
+
+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];
+}
+
+kernel void constant_load_global_store(global int2 *out, constant int2 *in){
+    out[0] = *in;
+}
\ No newline at end of file
-- 
1.8.1.2



More information about the Piglit mailing list