gcc/libgomp
Tom de Vries 4a75460b00 [nvptx, libgomp] Fix cuMemAlloc with size zero
Consider test-case:
...
int
main (void)
{
  #pragma acc parallel async
  ;
  #pragma acc parallel async
  ;
  #pragma acc wait

  return 0;
}
...

This fails with:
...
libgomp: cuMemAlloc error: invalid argument
Segmentation fault (core dumped)
...
The cuMemAlloc error is due to the fact that we're try to allocate 0 bytes.

Fix this by preventing calling map_push with size zero argument in nvptx_exec.

This also has the consequence that for the abort-1.c test-case, we end up
calling cuMemFree during map_fini for the struct cuda_map allocated in
map_init, which fails because an abort happened.  Fix this by calling
cuMemFree with CUDA_CALL_NOCHECK in cuda_map_destroy.

2019-01-23  Tom de Vries  <tdevries@suse.de>

	PR target/PR88946
	* plugin/plugin-nvptx.c (cuda_map_destroy): Use CUDA_CALL_NOCHECK for
	cuMemFree.
	(nvptx_exec): Don't call map_push if mapnum == 0.
	* testsuite/libgomp.oacc-c-c++-common/pr88946.c: New test.

From-SVN: r268178
2019-01-23 08:16:56 +00:00
..
config libgomp: Reduce copy and paste for RTEMS 2019-01-09 06:16:05 +00:00
plugin [nvptx, libgomp] Fix cuMemAlloc with size zero 2019-01-23 08:16:56 +00:00
testsuite [nvptx, libgomp] Fix cuMemAlloc with size zero 2019-01-23 08:16:56 +00:00
ChangeLog [nvptx, libgomp] Fix cuMemAlloc with size zero 2019-01-23 08:16:56 +00:00
ChangeLog.graphite
Makefile.am builtin-types.def (BT_FN_VOID_BOOL, [...]): New. 2018-11-08 18:13:04 +01:00
Makefile.in Makefile.am (AUTOMAKE_OPTIONS): Drop dejagnu. 2018-11-26 22:03:41 +01:00
acinclude.m4
aclocal.m4 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
affinity-fmt.c Update copyright years. 2019-01-01 13:31:55 +01:00
affinity.c Update copyright years. 2019-01-01 13:31:55 +01:00
alloc.c Update copyright years. 2019-01-01 13:31:55 +01:00
atomic.c Update copyright years. 2019-01-01 13:31:55 +01:00
barrier.c Update copyright years. 2019-01-01 13:31:55 +01:00
config.h.in builtin-types.def (BT_FN_VOID_BOOL, [...]): New. 2018-11-08 18:13:04 +01:00
configure builtin-types.def (BT_FN_VOID_BOOL, [...]): New. 2018-11-08 18:13:04 +01:00
configure.ac builtin-types.def (BT_FN_VOID_BOOL, [...]): New. 2018-11-08 18:13:04 +01:00
configure.tgt builtin-types.def (BT_FN_VOID_BOOL, [...]): New. 2018-11-08 18:13:04 +01:00
critical.c Update copyright years. 2019-01-01 13:31:55 +01:00
env.c Update copyright years. 2019-01-01 13:31:55 +01:00
error.c Update copyright years. 2019-01-01 13:31:55 +01:00
fortran.c Update copyright years. 2019-01-01 13:31:55 +01:00
hashtab.h Update copyright years. 2019-01-01 13:31:55 +01:00
icv-device.c Update copyright years. 2019-01-01 13:31:55 +01:00
icv.c Update copyright years. 2019-01-01 13:31:55 +01:00
iter.c Update copyright years. 2019-01-01 13:31:55 +01:00
iter_ull.c Update copyright years. 2019-01-01 13:31:55 +01:00
libgomp-plugin.c Update copyright years. 2019-01-01 13:31:55 +01:00
libgomp-plugin.h Update copyright years. 2019-01-01 13:31:55 +01:00
libgomp.h Update copyright years. 2019-01-01 13:31:55 +01:00
libgomp.map builtin-types.def (BT_FN_VOID_BOOL, [...]): New. 2018-11-08 18:13:04 +01:00
libgomp.spec.in
libgomp.texi Better distinguish OpenACC and OpenMP sections in libgomp.texi 2019-01-11 13:55:01 +00:00
libgomp_f.h.in Update copyright years. 2019-01-01 13:31:55 +01:00
libgomp_g.h Update copyright years. 2019-01-01 13:31:55 +01:00
lock.c Update copyright years. 2019-01-01 13:31:55 +01:00
loop.c Update copyright years. 2019-01-01 13:31:55 +01:00
loop_ull.c Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-async.c Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-cuda.c Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-host.c Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-init.c Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-int.h Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-mem.c Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-parallel.c Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-plugin.c Update copyright years. 2019-01-01 13:31:55 +01:00
oacc-plugin.h Update copyright years. 2019-01-01 13:31:55 +01:00
omp.h.in Update copyright years. 2019-01-01 13:31:55 +01:00
omp_lib.f90.in Update copyright years. 2019-01-01 13:31:55 +01:00
omp_lib.h.in Update copyright years. 2019-01-01 13:31:55 +01:00
openacc.f90 Update copyright years. 2019-01-01 13:31:55 +01:00
openacc.h Update copyright years. 2019-01-01 13:31:55 +01:00
openacc_lib.h Update copyright years. 2019-01-01 13:31:55 +01:00
ordered.c Update copyright years. 2019-01-01 13:31:55 +01:00
parallel.c Update copyright years. 2019-01-01 13:31:55 +01:00
priority_queue.c Update copyright years. 2019-01-01 13:31:55 +01:00
priority_queue.h Update copyright years. 2019-01-01 13:31:55 +01:00
sections.c Update copyright years. 2019-01-01 13:31:55 +01:00
secure_getenv.h Update copyright years. 2019-01-01 13:31:55 +01:00
single.c Update copyright years. 2019-01-01 13:31:55 +01:00
splay-tree.c Update copyright years. 2019-01-01 13:31:55 +01:00
splay-tree.h Update copyright years. 2019-01-01 13:31:55 +01:00
target.c Update copyright years. 2019-01-01 13:31:55 +01:00
task.c Update copyright years. 2019-01-01 13:31:55 +01:00
taskloop.c Update copyright years. 2019-01-01 13:31:55 +01:00
team.c Update copyright years. 2019-01-01 13:31:55 +01:00
teams.c Update copyright years. 2019-01-01 13:31:55 +01:00
work.c Update copyright years. 2019-01-01 13:31:55 +01:00