[Piglit] [PATCH 2/3] CL: Fix other-data-types image tests

Aaron Watry awatry at gmail.com
Tue Jun 25 09:34:54 PDT 2013


These were throwing errors (windows, catalyst, clc 1.2) because image
data types are not allowed to be declared within a kernel, only as
kernel parameters.

Re-structure the test so that we always test event_t, and progressively
check the additional types that are supported based on the declared CLC
version and image support declaration.

Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 tests/cl/program/build/other-data-types.cl | 32 ++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 11 deletions(-)
 mode change 100644 => 100755 tests/cl/program/build/other-data-types.cl

diff --git a/tests/cl/program/build/other-data-types.cl b/tests/cl/program/build/other-data-types.cl
old mode 100644
new mode 100755
index b5da11f..23d2f56
--- a/tests/cl/program/build/other-data-types.cl
+++ b/tests/cl/program/build/other-data-types.cl
@@ -1,6 +1,10 @@
 /*!
-# This test is only valid if the device supports images
-# i.e. CL_DEVICE_IMAGE_SUPPORT is CL_TRUE
+# This test checks for other data types that are defined in the OpenCL
+# specification.
+#
+# event_t is always expected to work.
+# image2d_t, image3d_t, and sampler_t require image support
+# image1d* and image2d_array_t require image support and CL 1.2+
 
 [config]
 name: Other data types declarations (image, sampler, event)
@@ -8,15 +12,21 @@ clc_version_min: 10
 !*/
 
 kernel void test(global int* out) {
-	image2d_t i2;
-	image3d_t i3;
-	sampler_t s;
-	event_t   e;
+    event_t e;
+}
+
+#ifdef __IMAGE_SUPPORT__
+kernel void test_images_100(global int *out, image2d_t i2,
+        image3d_t i3, sampler_t s) {
+}
 
 #if __OPENCL_C_VERSION__ >= 120
-	image1d_t        i1;
-	image1d_array_t  i1a;
-	image1d_buffer_t i1b;
-	image2d_array_t  i2a;
-#endif
+kernel void test_images_120(
+        global int* out,
+        image1d_t i1,
+        image1d_array_t i1a,
+        image1d_buffer_t i1b,
+        image2d_array_t i2a) {
 }
+#endif
+#endif
\ No newline at end of file
-- 
1.8.1.2



More information about the Piglit mailing list