gcc/libgomp
Kwok Cheung Yeung b52643ab90 libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof
The version of nvprof in CUDA 9.0 causes a hang when used to profile an
OpenACC program.  This is because it calls acc_get_device_type from
a callback called during device initialization, which then attempts
to acquire acc_device_lock while it is already taken, resulting in
deadlock.  This works around the issue by returning acc_device_none
from acc_get_device_type without attempting to acquire the lock when
initialization has not completed yet.

2020-07-14  Tom de Vries  <tom@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>
	    Kwok Cheung Yeung  <kcy@codesourcery.com>

	libgomp/
	* oacc-init.c (acc_init_state_lock, acc_init_state, acc_init_thread):
	New variable.
	(acc_init_1): Set acc_init_thread to pthread_self ().  Set
	acc_init_state to initializing at the start, and to initialized at the
	end.
	(self_initializing_p): New function.
	(acc_get_device_type): Return acc_device_none if called by thread that
	is currently executing acc_init_1.
	* libgomp.texi (acc_get_device_type): Update documentation.
	(Implementation Status and Implementation-Defined Behavior): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-init-2.c: New.
2020-07-14 10:31:35 -07:00
..
config aix: FAT libraries: test native compiler mode directly 2020-07-14 10:41:40 -04:00
plugin amdgcn: Switch to HSACO v3 binary format 2020-06-17 10:06:21 +01:00
testsuite libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof 2020-07-14 10:31:35 -07:00
.gitattributes
ChangeLog Daily bump. 2020-07-14 00:16:30 +00:00
ChangeLog.graphite
Makefile.am build: Use -include instead of conditional include. 2020-06-22 21:31:48 +00:00
Makefile.in build: Use -include instead of conditional include. 2020-06-22 21:31:48 +00:00
acc_prof.h
acinclude.m4
aclocal.m4
affinity-fmt.c
affinity.c
alloc.c
allocator.c openmp: Change omp_atv_default value and rename omp_atv_sequential to omp_atv_serialized. 2020-07-09 11:29:30 +02:00
atomic.c
barrier.c
config.h.in
configure aix: Add GCC64 configuration and FAT target libraries. 2020-06-21 14:14:46 -04:00
configure.ac aix: Add GCC64 configuration and FAT target libraries. 2020-06-21 14:14:46 -04:00
configure.tgt aix: Add GCC64 configuration and FAT target libraries. 2020-06-21 14:14:46 -04:00
critical.c
env.c openmp: Add basic library allocator support. 2020-05-19 10:11:01 +02:00
error.c
fortran.c
hashtab.h
icv-device.c
icv.c openmp: Add basic library allocator support. 2020-05-19 10:11:01 +02:00
iter.c
iter_ull.c
libgomp-plugin.c
libgomp-plugin.h
libgomp.h openacc: Adjust dynamic reference count semantics 2020-07-10 08:07:12 -07:00
libgomp.map openmp: Add basic library allocator support. 2020-05-19 10:11:01 +02:00
libgomp.spec.in
libgomp.texi libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof 2020-07-14 10:31:35 -07:00
libgomp_f.h.in
libgomp_g.h
lock.c
loop.c
loop_ull.c
oacc-async.c
oacc-cuda.c
oacc-host.c
oacc-init.c libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof 2020-07-14 10:31:35 -07:00
oacc-int.h
oacc-mem.c openacc: Adjust dynamic reference count semantics 2020-07-10 08:07:12 -07:00
oacc-parallel.c
oacc-plugin.c
oacc-plugin.h
oacc-profiling.c
oacc-target.c
omp.h.in openmp: Change omp_atv_default value and rename omp_atv_sequential to omp_atv_serialized. 2020-07-09 11:29:30 +02:00
omp_lib.f90.in
omp_lib.h.in
openacc.f90 [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
openacc.h [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
openacc_lib.h [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
ordered.c
parallel.c
priority_queue.c
priority_queue.h
sections.c
secure_getenv.h
single.c
splay-tree.c
splay-tree.h
target.c openacc: Adjust dynamic reference count semantics 2020-07-10 08:07:12 -07:00
task.c
taskloop.c
team.c openmp: Add basic library allocator support. 2020-05-19 10:11:01 +02:00
teams.c
work.c