... 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
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.
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@
PLUGIN_NVPTX_TRUE
offload_additional_lib_paths
offload_additional_options
+offload_targets
offload_plugins
PLUGIN_HSA_LIBS
PLUGIN_HSA_LDFLAGS
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
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
# 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=
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
# 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)
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
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@
# 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
#
}
}
+# 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_ {
# 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
set hsa_runtime_lib "@HSA_RUNTIME_LIB@"
set offload_plugins "@offload_plugins@"
+set offload_targets "@offload_targets@"
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
}
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"
# -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 } ]
}
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
}
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"
# -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 } ]
}
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"