mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 07:10:30 +08:00
GCN Libgomp Plugin
2019-11-13 Andrew Stubbs <ams@codesourcery.com> Kwok Cheung Yeung <kcy@codesourcery.com> Julian Brown <julian@codesourcery.com> Tom de Vries <tom@codesourcery.com> libgomp/ * plugin/Makefrag.am: Add amdgcn plugin support. * plugin/configfrag.ac: Likewise. * plugin/plugin-gcn.c: New file. * configure: Regenerate. * Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. Co-Authored-By: Julian Brown <julian@codesourcery.com> Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com> Co-Authored-By: Tom de Vries <tom@codesourcery.com> From-SVN: r278138
This commit is contained in:
parent
fe22e0d4f1
commit
237957cc2c
@ -1,3 +1,15 @@
|
||||
2019-11-13 Andrew Stubbs <ams@codesourcery.com>
|
||||
Kwok Cheung Yeung <kcy@codesourcery.com>
|
||||
Julian Brown <julian@codesourcery.com>
|
||||
Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
* plugin/Makefrag.am: Add amdgcn plugin support.
|
||||
* plugin/configfrag.ac: Likewise.
|
||||
* plugin/plugin-gcn.c: New file.
|
||||
* configure: Regenerate.
|
||||
* Makefile.in: Regenerate.
|
||||
* testsuite/Makefile.in: Regenerate.
|
||||
|
||||
2019-11-13 Andrew Stubbs <ams@codesourcery.com>
|
||||
|
||||
* config/gcn/team.c (gomp_gcn_enter_kernel): Set up the team arena
|
||||
|
@ -120,7 +120,8 @@ host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
@PLUGIN_NVPTX_TRUE@am__append_1 = libgomp-plugin-nvptx.la
|
||||
@PLUGIN_HSA_TRUE@am__append_2 = libgomp-plugin-hsa.la
|
||||
@USE_FORTRAN_TRUE@am__append_3 = openacc.f90
|
||||
@PLUGIN_GCN_TRUE@am__append_3 = libgomp-plugin-gcn.la
|
||||
@USE_FORTRAN_TRUE@am__append_4 = openacc.f90
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
@ -180,15 +181,26 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
|
||||
"$(DESTDIR)$(toolexeclibdir)"
|
||||
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
|
||||
am__DEPENDENCIES_1 =
|
||||
@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_DEPENDENCIES = libgomp.la \
|
||||
@PLUGIN_GCN_TRUE@ $(am__DEPENDENCIES_1)
|
||||
@PLUGIN_GCN_TRUE@am_libgomp_plugin_gcn_la_OBJECTS = \
|
||||
@PLUGIN_GCN_TRUE@ libgomp_plugin_gcn_la-plugin-gcn.lo
|
||||
libgomp_plugin_gcn_la_OBJECTS = $(am_libgomp_plugin_gcn_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
libgomp_plugin_gcn_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
||||
$(libgomp_plugin_gcn_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libgomp_plugin_gcn_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@PLUGIN_GCN_TRUE@am_libgomp_plugin_gcn_la_rpath = -rpath \
|
||||
@PLUGIN_GCN_TRUE@ $(toolexeclibdir)
|
||||
@PLUGIN_HSA_TRUE@libgomp_plugin_hsa_la_DEPENDENCIES = libgomp.la \
|
||||
@PLUGIN_HSA_TRUE@ $(am__DEPENDENCIES_1)
|
||||
@PLUGIN_HSA_TRUE@am_libgomp_plugin_hsa_la_OBJECTS = \
|
||||
@PLUGIN_HSA_TRUE@ libgomp_plugin_hsa_la-plugin-hsa.lo
|
||||
libgomp_plugin_hsa_la_OBJECTS = $(am_libgomp_plugin_hsa_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
libgomp_plugin_hsa_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
||||
$(libgomp_plugin_hsa_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
@ -265,7 +277,8 @@ AM_V_FCLD = $(am__v_FCLD_@AM_V@)
|
||||
am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@)
|
||||
am__v_FCLD_0 = @echo " FCLD " $@;
|
||||
am__v_FCLD_1 =
|
||||
SOURCES = $(libgomp_plugin_hsa_la_SOURCES) \
|
||||
SOURCES = $(libgomp_plugin_gcn_la_SOURCES) \
|
||||
$(libgomp_plugin_hsa_la_SOURCES) \
|
||||
$(libgomp_plugin_nvptx_la_SOURCES) $(libgomp_la_SOURCES)
|
||||
AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
|
||||
am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
|
||||
@ -428,6 +441,10 @@ PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PLUGIN_GCN = @PLUGIN_GCN@
|
||||
PLUGIN_GCN_CPPFLAGS = @PLUGIN_GCN_CPPFLAGS@
|
||||
PLUGIN_GCN_LDFLAGS = @PLUGIN_GCN_LDFLAGS@
|
||||
PLUGIN_GCN_LIBS = @PLUGIN_GCN_LIBS@
|
||||
PLUGIN_HSA = @PLUGIN_HSA@
|
||||
PLUGIN_HSA_CPPFLAGS = @PLUGIN_HSA_CPPFLAGS@
|
||||
PLUGIN_HSA_LDFLAGS = @PLUGIN_HSA_LDFLAGS@
|
||||
@ -527,7 +544,8 @@ libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
|
||||
AM_CPPFLAGS = $(addprefix -I, $(search_path))
|
||||
AM_CFLAGS = $(XCFLAGS)
|
||||
AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
|
||||
toolexeclib_LTLIBRARIES = libgomp.la $(am__append_1) $(am__append_2)
|
||||
toolexeclib_LTLIBRARIES = libgomp.la $(am__append_1) $(am__append_2) \
|
||||
$(am__append_3)
|
||||
nodist_toolexeclib_HEADERS = libgomp.spec
|
||||
|
||||
# -Wc is only a libtool option.
|
||||
@ -553,7 +571,7 @@ libgomp_la_SOURCES = alloc.c atomic.c barrier.c critical.c env.c \
|
||||
oacc-parallel.c oacc-host.c oacc-init.c oacc-mem.c \
|
||||
oacc-async.c oacc-plugin.c oacc-cuda.c priority_queue.c \
|
||||
affinity-fmt.c teams.c oacc-profiling.c oacc-target.c \
|
||||
$(am__append_3)
|
||||
$(am__append_4)
|
||||
|
||||
# Nvidia PTX OpenACC plugin.
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION)
|
||||
@ -576,6 +594,18 @@ libgomp_la_SOURCES = alloc.c atomic.c barrier.c critical.c env.c \
|
||||
@PLUGIN_HSA_TRUE@ $(lt_host_flags) $(PLUGIN_HSA_LDFLAGS)
|
||||
@PLUGIN_HSA_TRUE@libgomp_plugin_hsa_la_LIBADD = libgomp.la $(PLUGIN_HSA_LIBS)
|
||||
@PLUGIN_HSA_TRUE@libgomp_plugin_hsa_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
# AMD GCN plugin
|
||||
@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_version_info = -version-info $(libtool_VERSION)
|
||||
@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_SOURCES = plugin/plugin-gcn.c
|
||||
@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_GCN_CPPFLAGS) \
|
||||
@PLUGIN_GCN_TRUE@ -D_GNU_SOURCE
|
||||
|
||||
@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LDFLAGS = \
|
||||
@PLUGIN_GCN_TRUE@ $(libgomp_plugin_gcn_version_info) \
|
||||
@PLUGIN_GCN_TRUE@ $(lt_host_flags) $(PLUGIN_GCN_LDFLAGS)
|
||||
@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBADD = libgomp.la $(PLUGIN_GCN_LIBS)
|
||||
@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
nodist_noinst_HEADERS = libgomp_f.h
|
||||
nodist_libsubinclude_HEADERS = omp.h openacc.h acc_prof.h
|
||||
@USE_FORTRAN_TRUE@nodist_finclude_HEADERS = omp_lib.h omp_lib.f90 omp_lib.mod omp_lib_kinds.mod \
|
||||
@ -712,6 +742,9 @@ clean-toolexeclibLTLIBRARIES:
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
libgomp-plugin-gcn.la: $(libgomp_plugin_gcn_la_OBJECTS) $(libgomp_plugin_gcn_la_DEPENDENCIES) $(EXTRA_libgomp_plugin_gcn_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libgomp_plugin_gcn_la_LINK) $(am_libgomp_plugin_gcn_la_rpath) $(libgomp_plugin_gcn_la_OBJECTS) $(libgomp_plugin_gcn_la_LIBADD) $(LIBS)
|
||||
|
||||
libgomp-plugin-hsa.la: $(libgomp_plugin_hsa_la_OBJECTS) $(libgomp_plugin_hsa_la_DEPENDENCIES) $(EXTRA_libgomp_plugin_hsa_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libgomp_plugin_hsa_la_LINK) $(am_libgomp_plugin_hsa_la_rpath) $(libgomp_plugin_hsa_la_OBJECTS) $(libgomp_plugin_hsa_la_LIBADD) $(LIBS)
|
||||
|
||||
@ -742,6 +775,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iter.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iter_ull.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgomp-plugin.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgomp_plugin_gcn_la-plugin-gcn.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgomp_plugin_hsa_la-plugin-hsa.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgomp_plugin_nvptx_la-plugin-nvptx.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Plo@am__quote@
|
||||
@ -794,6 +828,13 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
libgomp_plugin_gcn_la-plugin-gcn.lo: plugin/plugin-gcn.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgomp_plugin_gcn_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgomp_plugin_gcn_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgomp_plugin_gcn_la-plugin-gcn.lo -MD -MP -MF $(DEPDIR)/libgomp_plugin_gcn_la-plugin-gcn.Tpo -c -o libgomp_plugin_gcn_la-plugin-gcn.lo `test -f 'plugin/plugin-gcn.c' || echo '$(srcdir)/'`plugin/plugin-gcn.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgomp_plugin_gcn_la-plugin-gcn.Tpo $(DEPDIR)/libgomp_plugin_gcn_la-plugin-gcn.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugin/plugin-gcn.c' object='libgomp_plugin_gcn_la-plugin-gcn.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgomp_plugin_gcn_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgomp_plugin_gcn_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgomp_plugin_gcn_la-plugin-gcn.lo `test -f 'plugin/plugin-gcn.c' || echo '$(srcdir)/'`plugin/plugin-gcn.c
|
||||
|
||||
libgomp_plugin_hsa_la-plugin-hsa.lo: plugin/plugin-hsa.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(libgomp_plugin_hsa_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgomp_plugin_hsa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgomp_plugin_hsa_la-plugin-hsa.lo -MD -MP -MF $(DEPDIR)/libgomp_plugin_hsa_la-plugin-hsa.Tpo -c -o libgomp_plugin_hsa_la-plugin-hsa.lo `test -f 'plugin/plugin-hsa.c' || echo '$(srcdir)/'`plugin/plugin-hsa.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgomp_plugin_hsa_la-plugin-hsa.Tpo $(DEPDIR)/libgomp_plugin_hsa_la-plugin-hsa.Plo
|
||||
|
59
libgomp/configure
vendored
59
libgomp/configure
vendored
@ -662,6 +662,8 @@ LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE
|
||||
LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE
|
||||
OPT_LDFLAGS
|
||||
SECTION_LDFLAGS
|
||||
PLUGIN_GCN_FALSE
|
||||
PLUGIN_GCN_TRUE
|
||||
PLUGIN_HSA_FALSE
|
||||
PLUGIN_HSA_TRUE
|
||||
PLUGIN_NVPTX_FALSE
|
||||
@ -670,6 +672,10 @@ offload_additional_lib_paths
|
||||
offload_additional_options
|
||||
offload_targets
|
||||
offload_plugins
|
||||
PLUGIN_GCN_LIBS
|
||||
PLUGIN_GCN_LDFLAGS
|
||||
PLUGIN_GCN_CPPFLAGS
|
||||
PLUGIN_GCN
|
||||
PLUGIN_HSA_LIBS
|
||||
PLUGIN_HSA_LDFLAGS
|
||||
PLUGIN_HSA_CPPFLAGS
|
||||
@ -11399,7 +11405,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11402 "configure"
|
||||
#line 11408 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -11505,7 +11511,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11508 "configure"
|
||||
#line 11514 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -15229,6 +15235,15 @@ PLUGIN_HSA_LIBS=
|
||||
|
||||
|
||||
|
||||
PLUGIN_GCN=0
|
||||
PLUGIN_GCN_CPPFLAGS=
|
||||
PLUGIN_GCN_LDFLAGS=
|
||||
PLUGIN_GCN_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.
|
||||
@ -15340,6 +15355,29 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
amdgcn*)
|
||||
case "${target}" in
|
||||
x86_64-*-*)
|
||||
case " ${CC} ${CFLAGS} " in
|
||||
*" -m32 "*)
|
||||
PLUGIN_GCN=0
|
||||
;;
|
||||
*)
|
||||
tgt_plugin=gcn
|
||||
PLUGIN_GCN=$tgt
|
||||
PLUGIN_GCN_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
|
||||
PLUGIN_GCN_LDFLAGS="$HSA_RUNTIME_LDFLAGS"
|
||||
PLUGIN_GCN_LIBS="-ldl"
|
||||
PLUGIN_GCN=1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*-*-*)
|
||||
PLUGIN_GCN=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
as_fn_error $? "unknown offload target specified" "$LINENO" 5
|
||||
;;
|
||||
@ -15404,6 +15442,19 @@ cat >>confdefs.h <<_ACEOF
|
||||
#define PLUGIN_HSA $PLUGIN_HSA
|
||||
_ACEOF
|
||||
|
||||
if test $PLUGIN_GCN = 1; then
|
||||
PLUGIN_GCN_TRUE=
|
||||
PLUGIN_GCN_FALSE='#'
|
||||
else
|
||||
PLUGIN_GCN_TRUE='#'
|
||||
PLUGIN_GCN_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define PLUGIN_GCN $PLUGIN_GCN
|
||||
_ACEOF
|
||||
|
||||
|
||||
if test "$HSA_RUNTIME_LIB" != ""; then
|
||||
HSA_RUNTIME_LIB="$HSA_RUNTIME_LIB/"
|
||||
@ -17122,6 +17173,10 @@ if test -z "${PLUGIN_HSA_TRUE}" && test -z "${PLUGIN_HSA_FALSE}"; then
|
||||
as_fn_error $? "conditional \"PLUGIN_HSA\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${PLUGIN_GCN_TRUE}" && test -z "${PLUGIN_GCN_FALSE}"; then
|
||||
as_fn_error $? "conditional \"PLUGIN_GCN\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE}" && test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE}"; then
|
||||
as_fn_error $? "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
|
@ -52,3 +52,17 @@ libgomp_plugin_hsa_la_LDFLAGS += $(PLUGIN_HSA_LDFLAGS)
|
||||
libgomp_plugin_hsa_la_LIBADD = libgomp.la $(PLUGIN_HSA_LIBS)
|
||||
libgomp_plugin_hsa_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
endif
|
||||
|
||||
if PLUGIN_GCN
|
||||
# AMD GCN plugin
|
||||
libgomp_plugin_gcn_version_info = -version-info $(libtool_VERSION)
|
||||
toolexeclib_LTLIBRARIES += libgomp-plugin-gcn.la
|
||||
libgomp_plugin_gcn_la_SOURCES = plugin/plugin-gcn.c
|
||||
libgomp_plugin_gcn_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_GCN_CPPFLAGS) \
|
||||
-D_GNU_SOURCE
|
||||
libgomp_plugin_gcn_la_LDFLAGS = $(libgomp_plugin_gcn_version_info) \
|
||||
$(lt_host_flags)
|
||||
libgomp_plugin_gcn_la_LDFLAGS += $(PLUGIN_GCN_LDFLAGS)
|
||||
libgomp_plugin_gcn_la_LIBADD = libgomp.la $(PLUGIN_GCN_LIBS)
|
||||
libgomp_plugin_gcn_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
endif
|
||||
|
@ -137,6 +137,15 @@ AC_SUBST(PLUGIN_HSA_CPPFLAGS)
|
||||
AC_SUBST(PLUGIN_HSA_LDFLAGS)
|
||||
AC_SUBST(PLUGIN_HSA_LIBS)
|
||||
|
||||
PLUGIN_GCN=0
|
||||
PLUGIN_GCN_CPPFLAGS=
|
||||
PLUGIN_GCN_LDFLAGS=
|
||||
PLUGIN_GCN_LIBS=
|
||||
AC_SUBST(PLUGIN_GCN)
|
||||
AC_SUBST(PLUGIN_GCN_CPPFLAGS)
|
||||
AC_SUBST(PLUGIN_GCN_LDFLAGS)
|
||||
AC_SUBST(PLUGIN_GCN_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.
|
||||
@ -237,6 +246,29 @@ if test x"$enable_offload_targets" != x; then
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
amdgcn*)
|
||||
case "${target}" in
|
||||
x86_64-*-*)
|
||||
case " ${CC} ${CFLAGS} " in
|
||||
*" -m32 "*)
|
||||
PLUGIN_GCN=0
|
||||
;;
|
||||
*)
|
||||
tgt_plugin=gcn
|
||||
PLUGIN_GCN=$tgt
|
||||
PLUGIN_GCN_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
|
||||
PLUGIN_GCN_LDFLAGS="$HSA_RUNTIME_LDFLAGS"
|
||||
PLUGIN_GCN_LIBS="-ldl"
|
||||
PLUGIN_GCN=1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*-*-*)
|
||||
PLUGIN_GCN=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([unknown offload target specified])
|
||||
;;
|
||||
@ -275,6 +307,9 @@ AC_DEFINE_UNQUOTED([PLUGIN_NVPTX_DYNAMIC], [$PLUGIN_NVPTX_DYNAMIC],
|
||||
AM_CONDITIONAL([PLUGIN_HSA], [test $PLUGIN_HSA = 1])
|
||||
AC_DEFINE_UNQUOTED([PLUGIN_HSA], [$PLUGIN_HSA],
|
||||
[Define to 1 if the HSA plugin is built, 0 if not.])
|
||||
AM_CONDITIONAL([PLUGIN_GCN], [test $PLUGIN_GCN = 1])
|
||||
AC_DEFINE_UNQUOTED([PLUGIN_GCN], [$PLUGIN_GCN],
|
||||
[Define to 1 if the GCN plugin is built, 0 if not.])
|
||||
|
||||
if test "$HSA_RUNTIME_LIB" != ""; then
|
||||
HSA_RUNTIME_LIB="$HSA_RUNTIME_LIB/"
|
||||
|
3985
libgomp/plugin/plugin-gcn.c
Normal file
3985
libgomp/plugin/plugin-gcn.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -207,6 +207,10 @@ PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PLUGIN_GCN = @PLUGIN_GCN@
|
||||
PLUGIN_GCN_CPPFLAGS = @PLUGIN_GCN_CPPFLAGS@
|
||||
PLUGIN_GCN_LDFLAGS = @PLUGIN_GCN_LDFLAGS@
|
||||
PLUGIN_GCN_LIBS = @PLUGIN_GCN_LIBS@
|
||||
PLUGIN_HSA = @PLUGIN_HSA@
|
||||
PLUGIN_HSA_CPPFLAGS = @PLUGIN_HSA_CPPFLAGS@
|
||||
PLUGIN_HSA_LDFLAGS = @PLUGIN_HSA_LDFLAGS@
|
||||
|
Loading…
x
Reference in New Issue
Block a user