]> git.ipfire.org Git - thirdparty/gcc.git/commit
Use 'GOMP_MAP_VARS_TARGET' for OpenACC compute constructs [PR90596]
authorThomas Schwinge <thomas@codesourcery.com>
Fri, 10 Mar 2023 17:14:44 +0000 (18:14 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 10 Mar 2023 17:15:19 +0000 (18:15 +0100)
commitc64e8a52af5f05d03b6d68e2fe6deb60f71adc6c
tree61e48bad9c54cdc19019f76ed5ac91e87d5eafae
parentac859ac4df59373db27f2b39ef37a50c51c14e64
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.

(cherry picked from commit f8332e52a498df480f72303de32ad0751ad899fe)
libgomp/ChangeLog.omp
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