[Piglit] [PATCH 8/8] cl: add image attribute test

Zoltan Gilian zoltan.gilian at gmail.com
Sat Aug 15 06:38:07 PDT 2015


---
 Note: I'm new to contributing to piglit, and I don't have commit access.
 tests/cl/program/execute/image-attributes.cl | 31 ++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 tests/cl/program/execute/image-attributes.cl

diff --git a/tests/cl/program/execute/image-attributes.cl b/tests/cl/program/execute/image-attributes.cl
new file mode 100644
index 0000000..a629b95
--- /dev/null
+++ b/tests/cl/program/execute/image-attributes.cl
@@ -0,0 +1,31 @@
+/*!
+[config]
+name: 2D image attributes
+
+dimensions:  1
+global_size: 1 0 0
+local_size:  1 0 0
+
+[test]
+name: write unsigned integer to CL_UNSIGNED_INT8 CL_RGBA image.
+kernel_name: attr
+
+arg_out: 0 buffer int[6]  2 3 2 3 1 1
+arg_in:  1 image uchar4  0 0 0 0  0 0 0 0        \
+                         0 0 0 0  0 0 0 0        \
+                         0 0 0 0  0 0 0 0        \
+           image_type 2d                         \
+           image_width 2                         \
+           image_height 3                        \
+           image_channel_order RGBA              \
+           image_channel_data_type UNSIGNED_INT8
+!*/
+
+kernel void attr(global int *out, image2d_t img) {
+	out[0] = get_image_width(img);
+	out[1] = get_image_height(img);
+	out[2] = get_image_dim(img).x;
+	out[3] = get_image_dim(img).y;
+	out[4] = get_image_channel_order(img) == CLK_RGBA;
+	out[5] = get_image_channel_data_type(img) == CLK_UNSIGNED_INT8;
+}
-- 
2.4.6



More information about the Piglit mailing list