gcc/libgomp
Frederik Harwath 7d593fd672 Add runtime ISA check for amdgcn offloading
The HSA/ROCm runtime rejects binaries not built for the exact GPU device
present. So far, the libgomp amdgcn plugin does not verify that the GPU ISA
and the ISA specified at compile time match before handing over the binary to
the runtime.  In case of a mismatch, the user is confronted with an unhelpful
runtime error.

This commit implements a runtime ISA check. In case of an ISA mismatch, the
execution is aborted with a clear error message and a hint at the correct
compilation parameters for the GPU on which the execution has been attempted.

libgomp/
	* plugin/plugin-gcn.c (EF_AMDGPU_MACH): New enum.
	* (EF_AMDGPU_MACH_MASK): New constant.
	* (gcn_isa): New typedef.
	* (gcn_gfx801_s): New constant.
	* (gcn_gfx803_s): New constant.
	* (gcn_gfx900_s): New constant.
	* (gcn_gfx906_s): New constant.
	* (gcn_isa_name_len): New constant.
	* (elf_gcn_isa_field): New function.
	* (isa_hsa_name): New function.
	* (isa_gcc_name): New function.
	* (isa_code): New function.
	* (struct agent_info): Add field "device_isa" and remove field
	"gfx900_p".
	* (GOMP_OFFLOAD_init_device): Adapt agent init to "agent_info"
	field changes, fail if device has unknown ISA.
	* (parse_target_attributes): Replace "gfx900_p" by "device_isa".
	* (isa_matches_agent): New function ...
	* (create_and_finalize_hsa_program): ... used from here to check
	that the GPU ISA and the code-object ISA match.
2020-01-21 07:41:45 +01:00
..
config Rename acc_device_gcn to acc_device_radeon 2020-01-17 18:11:52 +00:00
plugin Add runtime ISA check for amdgcn offloading 2020-01-21 07:41:45 +01:00
testsuite Update OpenACC tests for amdgcn 2020-01-20 16:51:06 +00:00
ChangeLog Update OpenACC tests for amdgcn 2020-01-20 16:51:06 +00:00
ChangeLog.graphite
Makefile.am GCN libgomp port 2019-11-13 12:38:04 +00:00
Makefile.in GCN Libgomp Plugin 2019-11-13 12:38:18 +00:00
acc_prof.h Update copyright years. 2020-01-01 12:51:42 +01:00
acinclude.m4 re PR other/79543 (Inappropriate "ld --version" checking) 2019-09-03 14:10:26 +00:00
aclocal.m4 configure.ac: Remove GCC_HEADER_STDINT(gstdint.h). 2019-10-01 09:51:46 +02:00
affinity-fmt.c re PR libgomp/93219 (unused return value in affinity-fmt.c) 2020-01-10 21:42:00 +01:00
affinity.c Update copyright years. 2020-01-01 12:51:42 +01:00
alloc.c Update copyright years. 2020-01-01 12:51:42 +01:00
atomic.c Update copyright years. 2020-01-01 12:51:42 +01:00
barrier.c Update copyright years. 2020-01-01 12:51:42 +01:00
config.h.in GCN libgomp port 2019-11-13 12:38:04 +00:00
configure GCN Libgomp Plugin 2019-11-13 12:38:18 +00:00
configure.ac GCN libgomp port 2019-11-13 12:38:04 +00:00
configure.tgt musl: Fix invalid tls model in libgomp and libitm PR91938 2019-12-03 11:13:38 +00:00
critical.c Update copyright years. 2020-01-01 12:51:42 +01:00
env.c Update copyright years. 2020-01-01 12:51:42 +01:00
error.c Update copyright years. 2020-01-01 12:51:42 +01:00
fortran.c Update copyright years. 2020-01-01 12:51:42 +01:00
hashtab.h Update copyright years. 2020-01-01 12:51:42 +01:00
icv-device.c Update copyright years. 2020-01-01 12:51:42 +01:00
icv.c Update copyright years. 2020-01-01 12:51:42 +01:00
iter.c Update copyright years. 2020-01-01 12:51:42 +01:00
iter_ull.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp-plugin.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp-plugin.h OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
libgomp.h OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
libgomp.map Add OpenACC 2.6 `acc_get_property' support 2019-12-22 19:54:09 +00:00
libgomp.spec.in
libgomp.texi libgomp.texi: Fix typos, use https (actual change) 2020-01-08 16:00:39 +01:00
libgomp_f.h.in Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp_g.h Update copyright years. 2020-01-01 12:51:42 +01:00
lock.c Update copyright years. 2020-01-01 12:51:42 +01:00
loop.c Update copyright years. 2020-01-01 12:51:42 +01:00
loop_ull.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-async.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-cuda.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-host.c OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
oacc-init.c OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
oacc-int.h Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-mem.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-parallel.c OpenACC – support "if" + "if_present" clauses with "host_data" 2020-01-10 16:08:41 +01:00
oacc-plugin.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-plugin.h Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-profiling.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-target.c GCN libgomp port 2019-11-13 12:38:04 +00:00
omp.h.in Update copyright years. 2020-01-01 12:51:42 +01:00
omp_lib.f90.in Update copyright years. 2020-01-01 12:51:42 +01:00
omp_lib.h.in Update copyright years. 2020-01-01 12:51:42 +01:00
openacc.f90 Rename acc_device_gcn to acc_device_radeon 2020-01-17 18:11:52 +00:00
openacc.h Rename acc_device_gcn to acc_device_radeon 2020-01-17 18:11:52 +00:00
openacc_lib.h Rename acc_device_gcn to acc_device_radeon 2020-01-17 18:11:52 +00:00
ordered.c Update copyright years. 2020-01-01 12:51:42 +01:00
parallel.c Update copyright years. 2020-01-01 12:51:42 +01:00
priority_queue.c Update copyright years. 2020-01-01 12:51:42 +01:00
priority_queue.h Update copyright years. 2020-01-01 12:51:42 +01:00
sections.c Update copyright years. 2020-01-01 12:51:42 +01:00
secure_getenv.h Update copyright years. 2020-01-01 12:51:42 +01:00
single.c Update copyright years. 2020-01-01 12:51:42 +01:00
splay-tree.c Update copyright years. 2020-01-01 12:51:42 +01:00
splay-tree.h Update copyright years. 2020-01-01 12:51:42 +01:00
target.c OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
task.c Update copyright years. 2020-01-01 12:51:42 +01:00
taskloop.c Update copyright years. 2020-01-01 12:51:42 +01:00
team.c Update copyright years. 2020-01-01 12:51:42 +01:00
teams.c Update copyright years. 2020-01-01 12:51:42 +01:00
work.c Update copyright years. 2020-01-01 12:51:42 +01:00