]> git.ipfire.org Git - thirdparty/gcc.git/commit
Use 'GOMP_MAP_VARS_TARGET' for OpenACC compute constructs [PR90596]
authorThomas Schwinge <thomas@codesourcery.com>
Mon, 27 Feb 2023 14:56:18 +0000 (15:56 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 10 Mar 2023 17:05:27 +0000 (18:05 +0100)
commitf8332e52a498df480f72303de32ad0751ad899fe
tree78eb3ca7cb7351b8eb5cc74f338b4bd9b6d4ec69
parent14f5e56a8a766c6f48c2a07b301fce2db1a19a3c
Use 'GOMP_MAP_VARS_TARGET' for OpenACC compute constructs [PR90596]

Thereby considerably simplify the device plugins' 'GOMP_OFFLOAD_openacc_exec',
'GOMP_OFFLOAD_openacc_async_exec' functions: in terms of lines of code, but in
particular conceptually: no more device memory allocation, host to device data
copying, device memory deallocation -- 'GOMP_MAP_VARS_TARGET' does all that for
us.

This depends on commit 2b2340e236c0bba8aaca358ea25a5accd8249fbd
"Allow libgomp 'cbuf' buffering with OpenACC 'async' for 'ephemeral' data",
where I said that "a use will emerge later", which is this one here.

PR libgomp/90596
libgomp/
* target.c (gomp_map_vars_internal): Allow for
'param_kind == GOMP_MAP_VARS_OPENACC | GOMP_MAP_VARS_TARGET'.
* oacc-parallel.c (GOACC_parallel_keyed): Pass
'GOMP_MAP_VARS_TARGET' to 'goacc_map_vars'.
* plugin/plugin-gcn.c (alloc_by_agent, gcn_exec)
(GOMP_OFFLOAD_openacc_exec, GOMP_OFFLOAD_openacc_async_exec):
Adjust, simplify.
(gomp_offload_free): Remove.
* plugin/plugin-nvptx.c (nvptx_exec, GOMP_OFFLOAD_openacc_exec)
(GOMP_OFFLOAD_openacc_async_exec): Adjust, simplify.
(cuda_free_argmem): Remove.
* testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c:
Adjust.
libgomp/oacc-parallel.c
libgomp/plugin/plugin-gcn.c
libgomp/plugin/plugin-nvptx.c
libgomp/target.c
libgomp/testsuite/libgomp.oacc-c-c++-common/acc_prof-parallel-1.c