[Piglit] [PATCH] CL: Add int* vload*(constant/local/private) tests

Aaron Watry awatry at gmail.com
Fri Aug 9 10:59:31 PDT 2013


Only tests integer loads, and assumes that global vstore works correctly.
---
 tests/cl/program/execute/vload-constant-int.cl |  65 +++++++++++++++
 tests/cl/program/execute/vload-local-int.cl    | 107 +++++++++++++++++++++++++
 tests/cl/program/execute/vload-private-int.cl  | 107 +++++++++++++++++++++++++
 3 files changed, 279 insertions(+)
 create mode 100644 tests/cl/program/execute/vload-constant-int.cl
 create mode 100644 tests/cl/program/execute/vload-local-int.cl
 create mode 100644 tests/cl/program/execute/vload-private-int.cl

diff --git a/tests/cl/program/execute/vload-constant-int.cl b/tests/cl/program/execute/vload-constant-int.cl
new file mode 100644
index 0000000..80a9a6f
--- /dev/null
+++ b/tests/cl/program/execute/vload-constant-int.cl
@@ -0,0 +1,65 @@
+/*!
+[config]
+name: constant vload int4
+clc_version_min: 10
+
+dimensions: 1
+global_size: 1 0 0
+
+[test]
+name: vector load2
+kernel_name: vecload2
+arg_out: 0 buffer int[2] 1 2
+arg_in: 1 buffer int[2] 1 2
+
+[test]
+name: vector load3
+kernel_name: vecload3
+arg_out: 0 buffer int[3] 1 2 3
+arg_in: 1 buffer int[3] 1 2 3
+
+[test]
+name: vector load4
+kernel_name: vecload4
+arg_out: 0 buffer int[4] 1 2 3 4
+arg_in: 1 buffer int[4] 1 2 3 4
+
+[test]
+name: vector load8
+kernel_name: vecload8
+arg_out: 0 buffer int[8] 1 2 3 4 5 6 7 8
+arg_in: 1 buffer int[8] 1 2 3 4 5 6 7 8
+
+[test]
+name: vector load16
+kernel_name: vecload16
+arg_out: 0 buffer int[16] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+arg_in: 1 buffer int[16] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+
+
+!*/
+
+kernel void load1(global int* out, constant int* input) {
+	out[0] = input[0];
+}
+
+kernel void vecload2(global int* out, constant int* input) {
+	vstore2(vload2(0, input), 0, out);
+}
+
+kernel void vecload3(global int* out, constant int* input) {
+	vstore3(vload3(0, input), 0, out);
+}
+
+kernel void vecload4(global int* out, constant int* input) {
+	vstore4(vload4(0, input), 0, out);
+}
+
+kernel void vecload8(global int* out, constant int* input) {
+	vstore8(vload8(0, input), 0, out);
+}
+
+kernel void vecload16(global int* out, constant int* input) {
+	vstore16(vload16(0, input), 0, out);
+}
+
diff --git a/tests/cl/program/execute/vload-local-int.cl b/tests/cl/program/execute/vload-local-int.cl
new file mode 100644
index 0000000..f904ecc
--- /dev/null
+++ b/tests/cl/program/execute/vload-local-int.cl
@@ -0,0 +1,107 @@
+/*!
+[config]
+name: local_memory
+
+dimensions: 1
+global_size: 1 0 0
+local_size:  1 0 0
+
+[test]
+name: Scalar (sanity) test
+kernel_name: scalar_test
+arg_out: 0 buffer int[1] 1
+
+
+[test]
+name: vload2 local
+kernel_name: vecload2
+arg_out: 0 buffer int[2] 1 2
+
+[test]
+name: vload3 local
+kernel_name: vecload3
+arg_out: 0 buffer int[3] 1 2 3
+
+[test]
+name: vload4 local
+kernel_name: vecload4
+arg_out: 0 buffer int[4] 1 2 3 4
+
+[test]
+name: vload8 local
+kernel_name: vecload8
+arg_out: 0 buffer int[8] 1 2 3 4 5 6 7 8
+
+[test]
+name: vload16 local
+kernel_name: vecload16
+arg_out: 0 buffer int[16] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+
+
+!*/
+
+kernel void scalar_test(global int* out){
+	local int local_mem[1];
+	local_mem[0] = 1;
+	out[0] = local_mem[0];
+}
+
+kernel void vecload2(global int *out) {
+	local int local_mem[2];
+	local_mem[0] = 1;
+	local_mem[1] = 2;
+	vstore2(vload2(0, local_mem), 0, out);
+}
+
+kernel void vecload3(global int *out) {
+	local int local_mem[3];
+	local_mem[0] = 1;
+	local_mem[1] = 2;
+	local_mem[2] = 3;
+	vstore3(vload3(0, local_mem), 0, out);
+}
+
+kernel void vecload4(global int *out) {
+	local int local_mem[4];
+	local_mem[0] = 1;
+	local_mem[1] = 2;
+	local_mem[2] = 3;
+	local_mem[3] = 4;
+	vstore4(vload4(0, local_mem), 0, out);
+}
+
+kernel void vecload8(global int *out) {
+	local int local_mem[8];
+	local_mem[0] = 1;
+	local_mem[1] = 2;
+	local_mem[2] = 3;
+	local_mem[3] = 4;
+	local_mem[4] = 5;
+	local_mem[5] = 6;
+	local_mem[6] = 7;
+	local_mem[7] = 8;
+	vstore8(vload8(0, local_mem), 0, out);
+}
+
+kernel void vecload16(global int *out) {
+	local int local_mem[16];
+	local_mem[0] = 1;
+	local_mem[1] = 2;
+	local_mem[2] = 3;
+	local_mem[3] = 4;
+	local_mem[4] = 5;
+	local_mem[5] = 6;
+	local_mem[6] = 7;
+	local_mem[7] = 8;
+	local_mem[8] = 9;
+	local_mem[9] = 10;
+	local_mem[10] = 11;
+	local_mem[11] = 12;
+	local_mem[12] = 13;
+	local_mem[13] = 14;
+	local_mem[14] = 15;
+	local_mem[15] = 16;
+	vstore16(vload16(0, local_mem), 0, out);
+}
+
+
diff --git a/tests/cl/program/execute/vload-private-int.cl b/tests/cl/program/execute/vload-private-int.cl
new file mode 100644
index 0000000..f3b16c1
--- /dev/null
+++ b/tests/cl/program/execute/vload-private-int.cl
@@ -0,0 +1,107 @@
+/*!
+[config]
+name: private_memory
+
+dimensions: 1
+global_size: 1 0 0
+local_size:  1 0 0
+
+[test]
+name: Scalar (sanity) test
+kernel_name: scalar_test
+arg_out: 0 buffer int[1] 1
+
+
+[test]
+name: vload2 private
+kernel_name: vecload2
+arg_out: 0 buffer int[2] 1 2
+
+[test]
+name: vload3 private
+kernel_name: vecload3
+arg_out: 0 buffer int[3] 1 2 3
+
+[test]
+name: vload4 private
+kernel_name: vecload4
+arg_out: 0 buffer int[4] 1 2 3 4
+
+[test]
+name: vload8 private
+kernel_name: vecload8
+arg_out: 0 buffer int[8] 1 2 3 4 5 6 7 8
+
+[test]
+name: vload16 private
+kernel_name: vecload16
+arg_out: 0 buffer int[16] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+
+
+!*/
+
+kernel void scalar_test(global int* out){
+	private int private_mem[1];
+	private_mem[0] = 1;
+	out[0] = private_mem[0];
+}
+
+kernel void vecload2(global int *out) {
+	private int private_mem[2];
+	private_mem[0] = 1;
+	private_mem[1] = 2;
+	vstore2(vload2(0, private_mem), 0, out);
+}
+
+kernel void vecload3(global int *out) {
+	private int private_mem[3];
+	private_mem[0] = 1;
+	private_mem[1] = 2;
+	private_mem[2] = 3;
+	vstore3(vload3(0, private_mem), 0, out);
+}
+
+kernel void vecload4(global int *out) {
+	private int private_mem[4];
+	private_mem[0] = 1;
+	private_mem[1] = 2;
+	private_mem[2] = 3;
+	private_mem[3] = 4;
+	vstore4(vload4(0, private_mem), 0, out);
+}
+
+kernel void vecload8(global int *out) {
+	private int private_mem[8];
+	private_mem[0] = 1;
+	private_mem[1] = 2;
+	private_mem[2] = 3;
+	private_mem[3] = 4;
+	private_mem[4] = 5;
+	private_mem[5] = 6;
+	private_mem[6] = 7;
+	private_mem[7] = 8;
+	vstore8(vload8(0, private_mem), 0, out);
+}
+
+kernel void vecload16(global int *out) {
+	private int private_mem[16];
+	private_mem[0] = 1;
+	private_mem[1] = 2;
+	private_mem[2] = 3;
+	private_mem[3] = 4;
+	private_mem[4] = 5;
+	private_mem[5] = 6;
+	private_mem[6] = 7;
+	private_mem[7] = 8;
+	private_mem[8] = 9;
+	private_mem[9] = 10;
+	private_mem[10] = 11;
+	private_mem[11] = 12;
+	private_mem[12] = 13;
+	private_mem[13] = 14;
+	private_mem[14] = 15;
+	private_mem[15] = 16;
+	vstore16(vload16(0, private_mem), 0, out);
+}
+
+
-- 
1.8.1.2



More information about the Piglit mailing list