aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2019-02-22 11:51:20 +0100
committerThomas Schwinge <tschwinge@gcc.gnu.org>2019-02-22 11:51:20 +0100
commit0a0384b43ad3f5abb1382bbd2ad2ade5fea7ff77 (patch)
treeb6b0847e784e9606c84e27b44db790b4e3bf86fc
parentee332b4a9a19552d160a23155f59b11692d8f07e (diff)
downloadgcc-0a0384b43ad3f5abb1382bbd2ad2ade5fea7ff77.zip
gcc-0a0384b43ad3f5abb1382bbd2ad2ade5fea7ff77.tar.gz
gcc-0a0384b43ad3f5abb1382bbd2ad2ade5fea7ff77.tar.bz2
[libgomp] In OpenACC testing, cycle though all offload targets
... instead of through offload plugins. libgomp/ * plugin/configfrag.ac: Populate and AC_SUBST offload_targets. * testsuite/libgomp-test-support.exp.in: Adjust. * testsuite/lib/libgomp.exp: Likewise. Don't populate openacc_device_types_s. (offload_target_to_openacc_device_type): New proc. * testsuite/libgomp.oacc-c++/c++.exp: Adjust. * testsuite/libgomp.oacc-c/c.exp: Likewise. * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. From-SVN: r269108
-rw-r--r--libgomp/ChangeLog12
-rw-r--r--libgomp/Makefile.in1
-rwxr-xr-xlibgomp/configure10
-rw-r--r--libgomp/plugin/configfrag.ac5
-rw-r--r--libgomp/testsuite/Makefile.in1
-rw-r--r--libgomp/testsuite/lib/libgomp.exp51
-rw-r--r--libgomp/testsuite/libgomp-test-support.exp.in1
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/c++.exp19
-rw-r--r--libgomp/testsuite/libgomp.oacc-c/c.exp19
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/fortran.exp15
10 files changed, 86 insertions, 48 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 344e83f..53a5511 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,5 +1,17 @@
2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
+ * plugin/configfrag.ac: Populate and AC_SUBST offload_targets.
+ * testsuite/libgomp-test-support.exp.in: Adjust.
+ * testsuite/lib/libgomp.exp: Likewise. Don't populate
+ openacc_device_types_s.
+ (offload_target_to_openacc_device_type): New proc.
+ * testsuite/libgomp.oacc-c++/c++.exp: Adjust.
+ * testsuite/libgomp.oacc-c/c.exp: Likewise.
+ * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
+ * Makefile.in: Regenerate.
+ * configure: Likewise.
+ * testsuite/Makefile.in: Likewise.
+
* plugin/configfrag.ac: Populate and AC_SUBST offload_plugins
instead of offload_targets, and AC_DEFINE_UNQUOTED OFFLOAD_PLUGINS
instead of OFFLOAD_TARGETS.
diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
index 12ce8d0..c7e63f1 100644
--- a/libgomp/Makefile.in
+++ b/libgomp/Makefile.in
@@ -494,6 +494,7 @@ multi_basedir = @multi_basedir@
offload_additional_lib_paths = @offload_additional_lib_paths@
offload_additional_options = @offload_additional_options@
offload_plugins = @offload_plugins@
+offload_targets = @offload_targets@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
diff --git a/libgomp/configure b/libgomp/configure
index 1033ae4..b4bc4f4 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -667,6 +667,7 @@ PLUGIN_NVPTX_FALSE
PLUGIN_NVPTX_TRUE
offload_additional_lib_paths
offload_additional_options
+offload_targets
offload_plugins
PLUGIN_HSA_LIBS
PLUGIN_HSA_LDFLAGS
@@ -11392,7 +11393,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11395 "configure"
+#line 11396 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11498,7 +11499,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11501 "configure"
+#line 11502 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15621,7 +15622,10 @@ PLUGIN_HSA_LIBS=
# Parse '--enable-offload-targets', figure out the corresponding libgomp
# plugins, and configure to find the corresponding offload compilers.
+# 'offload_plugins' and 'offload_targets' will be populated in the same order.
offload_plugins=
+offload_targets=
+
offload_additional_options=
offload_additional_lib_paths=
@@ -15737,8 +15741,10 @@ rm -f core conftest.err conftest.$ac_objext \
continue
elif test x"$offload_plugins" = x; then
offload_plugins=$tgt_plugin
+ offload_targets=$tgt
else
offload_plugins=$offload_plugins,$tgt_plugin
+ offload_targets=$offload_targets,$tgt
fi
# Configure additional search paths.
if test "$tgt_plugin" = hsa; then
diff --git a/libgomp/plugin/configfrag.ac b/libgomp/plugin/configfrag.ac
index c49d179..9718ac7 100644
--- a/libgomp/plugin/configfrag.ac
+++ b/libgomp/plugin/configfrag.ac
@@ -139,8 +139,11 @@ AC_SUBST(PLUGIN_HSA_LIBS)
# Parse '--enable-offload-targets', figure out the corresponding libgomp
# plugins, and configure to find the corresponding offload compilers.
+# 'offload_plugins' and 'offload_targets' will be populated in the same order.
offload_plugins=
+offload_targets=
AC_SUBST(offload_plugins)
+AC_SUBST(offload_targets)
offload_additional_options=
offload_additional_lib_paths=
AC_SUBST(offload_additional_options)
@@ -244,8 +247,10 @@ if test x"$enable_offload_targets" != x; then
continue
elif test x"$offload_plugins" = x; then
offload_plugins=$tgt_plugin
+ offload_targets=$tgt
else
offload_plugins=$offload_plugins,$tgt_plugin
+ offload_targets=$offload_targets,$tgt
fi
# Configure additional search paths.
if test "$tgt_plugin" = hsa; then
diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in
index 7e0e830..80315b1 100644
--- a/libgomp/testsuite/Makefile.in
+++ b/libgomp/testsuite/Makefile.in
@@ -272,6 +272,7 @@ multi_basedir = @multi_basedir@
offload_additional_lib_paths = @offload_additional_lib_paths@
offload_additional_options = @offload_additional_options@
offload_plugins = @offload_plugins@
+offload_targets = @offload_targets@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 766e9dd..cb75e06 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -41,31 +41,6 @@ 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_plugins_s (offload plugins, separated by a space), and
-# openacc_device_types_s (OpenACC device type names for suitable offload
-# plugins, separated by a space).
-set offload_plugins_s [split $offload_plugins ","]
-set openacc_device_types_s {}
-foreach offload_plugin $offload_plugins_s {
- # Translate to OpenACC names, or skip if not yet supported.
- switch $offload_plugin {
- intelmic {
- continue
- }
- nvptx {
- set offload_plugin "nvidia"
- }
- hsa {
- continue
- }
- default {
- error "Unknown offload target: $offload_target_openacc"
- }
- }
- lappend openacc_device_types_s "$offload_plugin"
-}
-lappend openacc_device_types_s "host"
-
set dg-do-what-default run
#
@@ -325,6 +300,28 @@ proc libgomp_option_proc { option } {
}
}
+# Translate offload target to OpenACC device type. Return the empty string if
+# not supported, and 'host' for offload target 'disable'.
+proc offload_target_to_openacc_device_type { offload_target } {
+ switch -glob $offload_target {
+ disable {
+ return "host"
+ }
+ hsa* {
+ return ""
+ }
+ *-intelmic* {
+ return ""
+ }
+ nvptx* {
+ return "nvidia"
+ }
+ default {
+ error "Unknown offload target: $offload_target"
+ }
+ }
+}
+
# Return 1 if offload device is available.
proc check_effective_target_offload_device { } {
return [check_runtime_nocache offload_device_available_ {
@@ -368,8 +365,8 @@ proc check_effective_target_offload_device_shared_as { } {
# Return 1 if configured for 'nvptx' offloading.
proc check_effective_target_openacc_nvidia_accel_configured { } {
- global offload_plugins
- if { ![string match "*,nvptx,*" ",$offload_plugins,"] } {
+ global offload_targets
+ if { ![string match "*,nvptx*,*" ",$offload_targets,"] } {
return 0
}
# PR libgomp/65099: Currently, we only support offloading in 64-bit
diff --git a/libgomp/testsuite/libgomp-test-support.exp.in b/libgomp/testsuite/libgomp-test-support.exp.in
index 6cf31ae..98fb442 100644
--- a/libgomp/testsuite/libgomp-test-support.exp.in
+++ b/libgomp/testsuite/libgomp-test-support.exp.in
@@ -3,3 +3,4 @@ set cuda_driver_lib "@CUDA_DRIVER_LIB@"
set hsa_runtime_lib "@HSA_RUNTIME_LIB@"
set offload_plugins "@offload_plugins@"
+set offload_targets "@offload_targets@"
diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
index 0854f60..29805c6 100644
--- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp
+++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
@@ -77,19 +77,24 @@ if { $lang_test_file_found } {
set libstdcxx_includes ""
}
- # Test with available OpenACC device types.
- global openacc_device_type
- foreach openacc_device_type $openacc_device_types_s {
+ # Test with all available offload targets, and with offloading disabled.
+ foreach offload_target [concat [split $offload_targets ","] "disable"] {
+ global openacc_device_type
+ set openacc_device_type [offload_target_to_openacc_device_type $offload_target]
set tagopt "-DACC_DEVICE_TYPE_$openacc_device_type=1"
switch $openacc_device_type {
+ "" {
+ unsupported "$subdir $offload_target offloading"
+ continue
+ }
host {
set acc_mem_shared 1
}
nvidia {
if { ![check_effective_target_openacc_nvidia_accel_present] } {
# Don't bother; execution testing is going to FAIL.
- untested "$subdir $openacc_device_type offloading: supported, but hardware not accessible"
+ untested "$subdir $offload_target offloading: supported, but hardware not accessible"
continue
}
@@ -102,7 +107,7 @@ if { $lang_test_file_found } {
set acc_mem_shared 0
}
default {
- error "Unknown OpenACC device type: $openacc_device_type"
+ error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
}
}
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
@@ -116,8 +121,8 @@ if { $lang_test_file_found } {
# -O0 and -O2 only, to avoid testing times exploding too much, under
# the assumption that between -O0 and -O[something] there is the
# biggest difference in the overall structure of the generated code.
- switch $openacc_device_type {
- host {
+ switch -glob $offload_target {
+ disable {
set-torture-options [list \
{ -O2 } ]
}
diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp
index 2e0c050..2cd75be 100644
--- a/libgomp/testsuite/libgomp.oacc-c/c.exp
+++ b/libgomp/testsuite/libgomp.oacc-c/c.exp
@@ -38,21 +38,26 @@ 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
-# Test with available OpenACC device types.
+# Test with all available offload targets, and with offloading disabled.
set SAVE_ALWAYS_CFLAGS "$ALWAYS_CFLAGS"
-global openacc_device_type
-foreach openacc_device_type $openacc_device_types_s {
+foreach offload_target [concat [split $offload_targets ","] "disable"] {
set ALWAYS_CFLAGS "$SAVE_ALWAYS_CFLAGS"
+ global openacc_device_type
+ set openacc_device_type [offload_target_to_openacc_device_type $offload_target]
set tagopt "-DACC_DEVICE_TYPE_$openacc_device_type=1"
switch $openacc_device_type {
+ "" {
+ unsupported "$subdir $offload_target offloading"
+ continue
+ }
host {
set acc_mem_shared 1
}
nvidia {
if { ![check_effective_target_openacc_nvidia_accel_present] } {
# Don't bother; execution testing is going to FAIL.
- untested "$subdir $openacc_device_type offloading: supported, but hardware not accessible"
+ untested "$subdir $offload_target offloading: supported, but hardware not accessible"
continue
}
@@ -65,7 +70,7 @@ foreach openacc_device_type $openacc_device_types_s {
set acc_mem_shared 0
}
default {
- error "Unknown OpenACC device type: $openacc_device_type"
+ error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
}
}
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"
@@ -79,8 +84,8 @@ foreach openacc_device_type $openacc_device_types_s {
# -O0 and -O2 only, to avoid testing times exploding too much, under
# the assumption that between -O0 and -O[something] there is the
# biggest difference in the overall structure of the generated code.
- switch $openacc_device_type {
- host {
+ switch -glob $offload_target {
+ disable {
set-torture-options [list \
{ -O2 } ]
}
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
index 83f4f6b..b2baa73 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
@@ -65,26 +65,31 @@ if { $lang_test_file_found } {
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars
- # Test with available OpenACC device types.
- global openacc_device_type
- foreach openacc_device_type $openacc_device_types_s {
+ # Test with all available offload targets, and with offloading disabled.
+ foreach offload_target [concat [split $offload_targets ","] "disable"] {
+ global openacc_device_type
+ set openacc_device_type [offload_target_to_openacc_device_type $offload_target]
set tagopt "-DACC_DEVICE_TYPE_$openacc_device_type=1"
switch $openacc_device_type {
+ "" {
+ unsupported "$subdir $offload_target offloading"
+ continue
+ }
host {
set acc_mem_shared 1
}
nvidia {
if { ![check_effective_target_openacc_nvidia_accel_present] } {
# Don't bother; execution testing is going to FAIL.
- untested "$subdir $openacc_device_type offloading: supported, but hardware not accessible"
+ untested "$subdir $offload_target offloading: supported, but hardware not accessible"
continue
}
set acc_mem_shared 0
}
default {
- error "Unknown OpenACC device type: $openacc_device_type"
+ error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
}
}
set tagopt "$tagopt -DACC_MEM_SHARED=$acc_mem_shared"