@@ -1,4 +1,17 @@
2014-12-17 Thomas Schwinge <thomas@codesourcery.com>
+ Tom de Vries <tom@codesourcery.com>
+
+ * testsuite/lib/libgomp.exp: Set offload_targets_s, and
+ offload_targets_s_openacc.
+ (check_effective_target_openacc_nvidia_accel_selected): Look for
+ global offload_target_openacc instead of ACC_DEVICE_TYPE
+ environment variable.
+ * testsuite/libgomp.oacc-c++/c++.exp: Loop through
+ offload_targets_s_openacc.
+ * testsuite/libgomp.oacc-c/c.exp: Likewise.
+ * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
+
+2014-12-17 Thomas Schwinge <thomas@codesourcery.com>
* testsuite/Makefile.am: Don't export OFFLOAD_TARGETS,
OFFLOAD_ADDITIONAL_OPTIONS, and OFFLOAD_ADDITIONAL_LIB_PATHS...
@@ -35,6 +35,21 @@ load_gcc_lib fortran-modules.exp
# Try to load a test support file, built during libgomp configuration.
load_file libgomp-test-support.exp
+# Populate offload_targets_s (offloading targets separated by a space), and
+# offload_targets_s_openacc (the same, but with OpenACC names).
+set offload_targets_s [split $offload_targets ","]
+# OpenACC spells some of them a little differently.
+set offload_targets_s_openacc {}
+foreach offload_target_openacc $offload_targets_s {
+ switch $offload_target_openacc {
+ nvptx {
+ set offload_target_openacc "nvidia"
+ }
+ }
+ lappend offload_targets_s_openacc "$offload_target_openacc"
+}
+lappend offload_targets_s_openacc "host"
+
set dg-do-what-default run
#
@@ -320,10 +335,8 @@ proc check_effective_target_openacc_nvidia_accel_selected { } {
if { ![check_effective_target_openacc_nvidia_accel_present] } {
return 0;
}
- if { ![info exists ::env(ACC_DEVICE_TYPE)] } {
- return 0;
- }
- if { $::env(ACC_DEVICE_TYPE) == "nvidia" } {
+ global offload_target_openacc
+ if { $offload_target_openacc == "nvidia" } {
return 1;
}
return 0;
@@ -68,18 +68,12 @@ if { $lang_test_file_found } {
set libstdcxx_includes ""
}
- # Todo: get list of accelerators from configure options --enable-accelerator.
- set accels { "nvidia" "host_nonshm" }
-
- # Run on host (or fallback) accelerator.
- lappend accels "host"
-
# Test OpenACC with available accelerators.
- foreach accel $accels {
- set tagopt "-DACC_DEVICE_TYPE_$accel=1"
+ foreach offload_target_openacc $offload_targets_s_openacc {
+ set tagopt "-DACC_DEVICE_TYPE_$offload_target_openacc=1"
# Todo: Determine shared memory or not using run-time test.
- switch $accel {
+ switch $offload_target_openacc {
host {
set acc_mem_shared 1
}
@@ -102,7 +96,7 @@ if { $lang_test_file_found } {
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
# Todo: Verify that this works for both local and remote testing.
- setenv ACC_DEVICE_TYPE $accel
+ setenv ACC_DEVICE_TYPE $offload_target_openacc
dg-runtest $tests "$tagopt" $libstdcxx_includes
}
@@ -34,20 +34,14 @@ set ld_library_path $always_ld_library_path
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars
-# Todo: get list of accelerators from configure options --enable-accelerator.
-set accels { "nvidia" "host_nonshm" }
-
-# Run on host (or fallback) accelerator.
-lappend accels "host"
-
# Test OpenACC with available accelerators.
set SAVE_ALWAYS_CFLAGS "$ALWAYS_CFLAGS"
-foreach accel $accels {
+foreach offload_target_openacc $offload_targets_s_openacc {
set ALWAYS_CFLAGS "$SAVE_ALWAYS_CFLAGS"
- set tagopt "-DACC_DEVICE_TYPE_$accel=1"
+ set tagopt "-DACC_DEVICE_TYPE_$offload_target_openacc=1"
# Todo: Determine shared memory or not using run-time test.
- switch $accel {
+ switch $offload_target_openacc {
host {
set acc_mem_shared 1
}
@@ -70,7 +64,7 @@ foreach accel $accels {
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
# Todo: Verify that this works for both local and remote testing.
- setenv ACC_DEVICE_TYPE $accel
+ setenv ACC_DEVICE_TYPE $offload_target_openacc
dg-runtest $tests "$tagopt" $DEFAULT_CFLAGS
}
@@ -65,18 +65,12 @@ if { $lang_test_file_found } {
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars
- # Todo: get list of accelerators from configure options --enable-accelerator.
- set accels { "nvidia" "host_nonshm" }
-
- # Run on host (or fallback) accelerator.
- lappend accels "host"
-
# Test OpenACC with available accelerators.
- foreach accel $accels {
- set tagopt "-DACC_DEVICE_TYPE_$accel=1"
+ foreach offload_target_openacc $offload_targets_s_openacc {
+ set tagopt "-DACC_DEVICE_TYPE_$offload_target_openacc=1"
# Todo: Determine shared memory or not using run-time test.
- switch $accel {
+ switch $offload_target_openacc {
host {
set acc_mem_shared 1
}
@@ -93,7 +87,7 @@ if { $lang_test_file_found } {
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
# Todo: Verify that this works for both local and remote testing.
- setenv ACC_DEVICE_TYPE $accel
+ setenv ACC_DEVICE_TYPE $offload_target_openacc
# For Fortran we're doing torture testing, as Fortran has far more tests
# with arrays etc. that testing just -O0 or -O2 is insufficient, that is