[Piglit] [PATCH] Fix a bunch of CL tests on MacOS.

Aaron Watry awatry at gmail.com
Sat Nov 24 07:48:39 PST 2012


Any kernel without arguments is automatically optimized out by the compiler.
---
 tests/cl/program/build/disable-warnings.cl         |    6 ++++--
 tests/cl/program/build/include-directories.cl      |    7 ++-----
 .../program/build/macro-definitions-with-values.cl |    6 ++----
 tests/cl/program/build/macro-definitions.cl        |    4 ++--
 tests/cl/program/build/math-intrinsics.cl          |    4 ++--
 tests/cl/program/build/mixed-macro-definitions.cl  |    6 ++----
 tests/cl/program/build/optimization-options.cl     |    2 +-
 tests/cl/program/build/other-data-types.cl         |    2 +-
 .../program/build/scalar-and-vector-operators.cl   |    2 +-
 tests/cl/program/build/scalar-data-types.cl        |    2 +-
 tests/cl/program/build/scalar-operators.cl         |    2 +-
 tests/cl/program/build/vector-data-types.cl        |    2 +-
 tests/cl/program/build/vector-operators.cl         |    2 +-
 tests/cl/program/build/version-declaration.cl      |    2 +-
 14 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/tests/cl/program/build/disable-warnings.cl b/tests/cl/program/build/disable-warnings.cl
index c5719e3..f9fbaee 100644
--- a/tests/cl/program/build/disable-warnings.cl
+++ b/tests/cl/program/build/disable-warnings.cl
@@ -5,8 +5,10 @@ clc_version_min: 10
 build_options: -w
 !*/
 
-void dummy_function() { int i = 0; }
+void dummy_function() {
+    int i = 0; //unused variable
+}
 
-kernel void dummy_kernel() {
+kernel void dummy_kernel(global int* out) {
     dummy_function();
 }
\ No newline at end of file
diff --git a/tests/cl/program/build/include-directories.cl b/tests/cl/program/build/include-directories.cl
index 59b7882..40ed944 100644
--- a/tests/cl/program/build/include-directories.cl
+++ b/tests/cl/program/build/include-directories.cl
@@ -7,9 +7,6 @@ build_options: -I . -I tests/cl/program/build
 
 #include "include_test.h"
 
-void dummy_function() {}
-
-kernel void dummy_kernel() {
-    dummy_function();
-    int test = BUILD_OPT;
+kernel void dummy_kernel(global int* out) {
+    *out = BUILD_OPT;
 }
diff --git a/tests/cl/program/build/macro-definitions-with-values.cl b/tests/cl/program/build/macro-definitions-with-values.cl
index eb36d4d..85244a5 100644
--- a/tests/cl/program/build/macro-definitions-with-values.cl
+++ b/tests/cl/program/build/macro-definitions-with-values.cl
@@ -5,8 +5,6 @@ clc_version_min: 10
 build_options: -D BUILD_OPT1=1 -D BUILD_OPT2=2
 !*/
 
-
-
-kernel void dummy_kernel(){
-    int var1 = BUILD_OPT1; int var2 = BUILD_OPT2;
+kernel void dummy_kernel(global int* out){
+    *out = BUILD_OPT1 + BUILD_OPT2;
 }
\ No newline at end of file
diff --git a/tests/cl/program/build/macro-definitions.cl b/tests/cl/program/build/macro-definitions.cl
index 1758c3f..1ef8808 100644
--- a/tests/cl/program/build/macro-definitions.cl
+++ b/tests/cl/program/build/macro-definitions.cl
@@ -5,6 +5,6 @@ clc_version_min: 10
 build_options: -D BUILD_OPT1 -D BUILD_OPT2
 !*/
 
-kernel void dummy_kernel(){
-    int var1 = BUILD_OPT1; int var2 = BUILD_OPT2;
+kernel void dummy_kernel(global int *out){
+    *out = BUILD_OPT1 + BUILD_OPT2;
 }
diff --git a/tests/cl/program/build/math-intrinsics.cl b/tests/cl/program/build/math-intrinsics.cl
index 374a05d..19e1f31 100644
--- a/tests/cl/program/build/math-intrinsics.cl
+++ b/tests/cl/program/build/math-intrinsics.cl
@@ -7,6 +7,6 @@ build_options: -cl-single-precision-constant -cl-denorms-are-zero
 
 void dummy_function() {}
 
-kernel void dummy_kernel() {
-    dummy_function();
+kernel void dummy_kernel(global int* out){
+    *out = 1;
 }
\ No newline at end of file
diff --git a/tests/cl/program/build/mixed-macro-definitions.cl b/tests/cl/program/build/mixed-macro-definitions.cl
index 274f813..01ee1ac 100644
--- a/tests/cl/program/build/mixed-macro-definitions.cl
+++ b/tests/cl/program/build/mixed-macro-definitions.cl
@@ -5,8 +5,6 @@ clc_version_min: 10
 build_options: -D BUILD_OPT1 -D BUILD_OPT2=2
 !*/
 
-
-
-kernel void dummy_kernel(){
-    int var1 = BUILD_OPT1; int var2 = BUILD_OPT2;
+kernel void dummy_kernel(global int* out){
+    *out = BUILD_OPT1 + BUILD_OPT2;
 }
\ No newline at end of file
diff --git a/tests/cl/program/build/optimization-options.cl b/tests/cl/program/build/optimization-options.cl
index 90440b0..9d73fb4 100644
--- a/tests/cl/program/build/optimization-options.cl
+++ b/tests/cl/program/build/optimization-options.cl
@@ -7,6 +7,6 @@ build_options: -cl-opt-disable -cl-strict-aliasing -cl-mad-enable -cl-finite-mat
 
 void dummy_function() {}
 
-kernel void dummy_kernel() {
+kernel void dummy_kernel(global int* out) {
     dummy_function();
 }
\ No newline at end of file
diff --git a/tests/cl/program/build/other-data-types.cl b/tests/cl/program/build/other-data-types.cl
index 31d14a2..b5da11f 100644
--- a/tests/cl/program/build/other-data-types.cl
+++ b/tests/cl/program/build/other-data-types.cl
@@ -7,7 +7,7 @@ name: Other data types declarations (image, sampler, event)
 clc_version_min: 10
 !*/
 
-kernel void test() {
+kernel void test(global int* out) {
 	image2d_t i2;
 	image3d_t i3;
 	sampler_t s;
diff --git a/tests/cl/program/build/scalar-and-vector-operators.cl b/tests/cl/program/build/scalar-and-vector-operators.cl
index 8583faa..6a099ef 100644
--- a/tests/cl/program/build/scalar-and-vector-operators.cl
+++ b/tests/cl/program/build/scalar-and-vector-operators.cl
@@ -4,7 +4,7 @@ name: Scalar and vector operators
 clc_version_min: 10
 !*/
 
-void test() {
+kernel void test(global int* out) {
 	int a;
 	int4 b;
 
diff --git a/tests/cl/program/build/scalar-data-types.cl b/tests/cl/program/build/scalar-data-types.cl
index d23ebb1..d3c5061 100644
--- a/tests/cl/program/build/scalar-data-types.cl
+++ b/tests/cl/program/build/scalar-data-types.cl
@@ -4,7 +4,7 @@ name: Scalar data types declarations
 clc_version_min: 10
 !*/
 
-kernel void test() {
+kernel void test(global int* out) {
 	bool b;
 	char c;
 	unsigned char uc1; uchar uc2;
diff --git a/tests/cl/program/build/scalar-operators.cl b/tests/cl/program/build/scalar-operators.cl
index a46ff70..ae653e4 100644
--- a/tests/cl/program/build/scalar-operators.cl
+++ b/tests/cl/program/build/scalar-operators.cl
@@ -4,7 +4,7 @@ name: Scalar operators
 clc_version_min: 10
 !*/
 
-void test() {
+kernel void test(global int* out) {
 	int a;
 	int b;
 
diff --git a/tests/cl/program/build/vector-data-types.cl b/tests/cl/program/build/vector-data-types.cl
index 8c84f4c..1d77c59 100644
--- a/tests/cl/program/build/vector-data-types.cl
+++ b/tests/cl/program/build/vector-data-types.cl
@@ -4,7 +4,7 @@ name: Vector data types declarations
 clc_version_min: 10
 !*/
 
-kernel void test() {
+kernel void test(global int* out) {
 	char2    c2; char4    c4; char8    c8; char16    c16;
 	uchar2  uc2; uchar4  uc4; uchar8  uc8; uchar16  uc16;
 	short2   s2; short4   s4; short8   s8; short16   s16;
diff --git a/tests/cl/program/build/vector-operators.cl b/tests/cl/program/build/vector-operators.cl
index 454486f..f620bcf 100644
--- a/tests/cl/program/build/vector-operators.cl
+++ b/tests/cl/program/build/vector-operators.cl
@@ -4,7 +4,7 @@ name: Vector operators
 clc_version_min: 10
 !*/
 
-void test() {
+kernel void test(global int* out) {
 	int4 a;
 	int4 b;
 
diff --git a/tests/cl/program/build/version-declaration.cl b/tests/cl/program/build/version-declaration.cl
index a460c97..6ebfcc2 100644
--- a/tests/cl/program/build/version-declaration.cl
+++ b/tests/cl/program/build/version-declaration.cl
@@ -7,6 +7,6 @@ build_options: -cl-std=CL1.1
 
 void dummy_function() {}
 
-kernel void dummy_kernel() {
+kernel void dummy_kernel(global int* out) {
     dummy_function();
 }
\ No newline at end of file
-- 
1.7.4.4



More information about the Piglit mailing list