Go to file
Andrew Stubbs d1eb334f7b amdgcn, openmp: Auto-detect USM mode and set HSA_XNACK
The AMD GCN runtime must be set to the correct mode for Unified Shared Memory
to work, but this is not always clear at compile and link time due to the split
nature of the offload compilation pipeline.

This patch sets a new attribute on OpenMP offload functions to ensure that the
information is passed all the way to the backend.  The backend then places a
marker in the assembler code for mkoffload to find. Finally mkoffload places a
constructor function into the final program to ensure that the HSA_XNACK
environment variable passes the correct mode to the GPU.

The HSA_XNACK variable must be set before the HSA runtime is even loaded, so
it makes more sense to have this set within the constructor than at some point
later within libgomp or the GCN plugin.

gcc/ChangeLog:

	* config/gcn/gcn.c (unified_shared_memory_enabled): New variable.
	(gcn_init_cumulative_args): Handle attribute "omp unified memory".
	(gcn_hsa_declare_function_name): Emit "MKOFFLOAD OPTIONS: USM+".
	* config/gcn/mkoffload.c (TEST_XNACK_OFF): New macro.
	(process_asm): Detect "MKOFFLOAD OPTIONS: USM+".
	Emit configure_xnack constructor, as required.
	* omp-low.c (create_omp_child_function): Add attribute "omp unified
	memory".
2022-06-27 17:28:03 +01:00
INSTALL
c++tools Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
config Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
contrib Update GMP/MPFR/MPC/ISL version in contrib/download_prerequisites 2021-11-24 12:37:32 +01:00
fixincludes Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
gcc amdgcn, openmp: Auto-detect USM mode and set HSA_XNACK 2022-06-27 17:28:03 +01:00
gnattools Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
gotools Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
include amdgcn: Change offload variable table discovery 2021-12-22 11:49:56 +00:00
intl Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libada Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libatomic Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libbacktrace Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libcc1 Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libcody Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libcpp Daily bump. 2021-08-17 00:18:10 +00:00
libdecnumber Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libffi Merge remote-tracking branch 'origin/releases/gcc-11' into devel/omp/gcc-11 2021-07-28 09:47:13 +02:00
libgcc [PATCH] GCN: Implement __atomic_compare_exchange_{1,2} in libgcc [PR102215] 2022-05-30 10:12:15 +00:00
libgfortran Fortran: Fix Bind(C) Array-Descriptor Conversion 2021-10-13 18:04:20 +02:00
libgo libgo: update to Go1.16.5 release 2021-06-10 14:42:37 -07:00
libgomp amdgcn: Add gfx90a support 2022-05-24 16:59:27 +01:00
libhsail-rt Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libiberty Daily bump. 2021-10-02 00:18:01 +00:00
libitm Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libobjc Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
liboffloadmic Merge remote-tracking branch 'origin/releases/gcc-11' into devel/omp/gcc-11 2021-07-28 09:47:13 +02:00
libphobos Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libquadmath Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libsanitizer Daily bump. 2021-08-13 00:18:24 +00:00
libssp Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
libstdc++-v3 Daily bump. 2021-11-02 00:17:59 +00:00
libvtv Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
lto-plugin Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
maintainer-scripts Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
zlib Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
.dir-locals.el .dir-locals.el: Set 'fill-column' to 80 for c-mode 2020-12-14 12:19:56 +01:00
.gitattributes Add *.md diff=md. 2020-01-15 14:29:53 +01:00
.gitignore Sync .gitignore with binutils-gdb 2020-12-02 11:04:01 -07:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Update ChangeLog and version files for release 2021-07-28 06:55:28 +00:00
ChangeLog.jit
ChangeLog.omp Disable libstdc++ dependency for libffi 2021-04-20 11:49:36 -07:00
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS: Add myself for write after approval 2021-04-11 12:09:11 +01:00
Makefile.def Disable libstdc++ dependency for libffi 2021-04-20 11:49:36 -07:00
Makefile.in Disable libstdc++ dependency for libffi 2021-04-20 11:49:36 -07:00
Makefile.tpl Add -fprofile-reproducible=parallel-runs to STAGEfeedback_CFLAGS to Makefile.tpl. 2021-03-11 16:18:56 +01:00
README
ar-lib
compile
config-ml.in config-ml.in: Suppress output from multi-do recipes 2020-11-09 14:28:37 +00:00
config.guess config.sub, config.guess : Import upstream 2021-01-25. 2021-02-23 17:21:10 +08:00
config.rpath
config.sub config.sub, config.guess : Import upstream 2021-01-25. 2021-02-23 17:21:10 +08:00
configure Add C++tools 2020-12-15 07:42:59 -08:00
configure.ac Add C++tools 2020-12-15 07:42:59 -08:00
depcomp
install-sh
libtool-ldflags
libtool.m4 Update GNU/Hurd configure support 2021-01-05 16:04:14 -07:00
ltgcc.m4
ltmain.sh Do not use HAVE_DOS_BASED_FILE_SYSTEM for Cygwin. 2020-04-17 09:22:51 +02:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
symlink-tree
test-driver
ylwrap

README

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.