This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gomp4] Skip nvidia accelerator if not present


Thomas,

this patch skips the nvidia accelerator in testing libgomp, if the nvidia accelerator is not present.

OK for gomp-4_0-branch?

Thanks,
- Tom
2014-11-03  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c++/c++.exp: Only use nvidia accelerator if
	present.
	* testsuite/libgomp.oacc-c/c.exp: Same.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Same.

diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
index da81deb..19104ca 100644
--- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp
+++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
@@ -67,8 +67,16 @@ if { $lang_test_file_found } {
     }
     puts "Using LIBGOMP_PLUGIN_PATH $env(LIBGOMP_PLUGIN_PATH)"
 
-    # Todo: get list of accelerators from configure options --enable-accelerator.
-    set accels { "nvidia" "host_nonshm" }
+    set accels { }
+
+    # Todo: get list of accelerators from configure options
+    # --enable-accelerator.
+    if { [check_effective_target_openacc_nvidia_accel_present] } {
+	lappend accels "nvidia"
+    }
+
+    # Present as plugin in LIBGOMP_PLUGIN_PATH
+    lappend accels "host_nonshm"
 
     # Run on host (or fallback) accelerator.
     lappend accels "host"
diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp
index feb57fd..a98dcf6 100644
--- a/libgomp/testsuite/libgomp.oacc-c/c.exp
+++ b/libgomp/testsuite/libgomp.oacc-c/c.exp
@@ -38,8 +38,16 @@ if { ![info exists env(LIBGOMP_PLUGIN_PATH)] } {
 }
 puts "Using LIBGOMP_PLUGIN_PATH $env(LIBGOMP_PLUGIN_PATH)"
 
-# Todo: get list of accelerators from configure options --enable-accelerator.
-set accels { "nvidia" "host_nonshm" }
+set accels { }
+
+# Todo: get list of accelerators from configure options
+# --enable-accelerator.
+if { [check_effective_target_openacc_nvidia_accel_present] } {
+    lappend accels "nvidia"
+}
+
+# Present as plugin in LIBGOMP_PLUGIN_PATH
+lappend accels "host_nonshm"
 
 # Run on host (or fallback) accelerator.
 lappend accels "host"
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
index 156ae56..8d341c8 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
@@ -71,8 +71,16 @@ if { $lang_test_file_found } {
     }
     puts "Using LIBGOMP_PLUGIN_PATH $env(LIBGOMP_PLUGIN_PATH)"
 
-    # Todo: get list of accelerators from configure options --enable-accelerator.
-    set accels { "nvidia" "host_nonshm" }
+    set accels { }
+
+    # Todo: get list of accelerators from configure options
+    # --enable-accelerator.
+    if { [check_effective_target_openacc_nvidia_accel_present] } {
+	lappend accels "nvidia"
+    }
+
+    # Present as plugin in LIBGOMP_PLUGIN_PATH
+    lappend accels "host_nonshm"
 
     # Run on host (or fallback) accelerator.
     lappend accels "host"
-- 
1.9.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]