]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp: Add OpenACC's acc_memcpy_device{,_async} routines [PR93226]
authorTobias Burnus <tburnus@baylibre.com>
Thu, 29 May 2025 20:47:06 +0000 (22:47 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Thu, 29 May 2025 20:47:06 +0000 (22:47 +0200)
commitf4aa6b5a8d63050f5d61fcec222ed87be4c0a266
treef98657825b7ca7b1534499fb3fd8c3daed32092f
parent2047aa4ce2ed9976fb36e984b43864fcd6f3a65d
libgomp: Add OpenACC's acc_memcpy_device{,_async} routines [PR93226]

libgomp/ChangeLog:

PR libgomp/93226
* libgomp-plugin.h (GOMP_OFFLOAD_openacc_async_dev2dev): New
prototype.
* libgomp.h (struct acc_dispatch_t): Add dev2dev_func.
(gomp_copy_dev2dev): New prototype.
* libgomp.map (OACC_2.6.1): New; add acc_memcpy_device{,_async}.
* libgomp.texi (acc_memcpy_device): New.
* oacc-mem.c (memcpy_tofrom_device): Change to take from/to
device boolean; use memcpy not memmove; add early return if
size == 0 or same device + same ptr.
(acc_memcpy_to_device, acc_memcpy_to_device_async,
acc_memcpy_from_device, acc_memcpy_from_device_async): Update.
(acc_memcpy_device, acc_memcpy_device_async): New.
* openacc.f90 (acc_memcpy_device, acc_memcpy_device_async):
Add interface.
* openacc_lib.h (acc_memcpy_device, acc_memcpy_device_async):
Likewise.
* openacc.h (acc_memcpy_device, acc_memcpy_device_async): Add
prototype.
* plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_async_host2dev):
Update comment.
(GOMP_OFFLOAD_openacc_async_dev2host): Update call.
(GOMP_OFFLOAD_openacc_async_dev2dev): New.
* plugin/plugin-nvptx.c (cuda_memcpy_dev_sanity_check): New.
(GOMP_OFFLOAD_dev2dev): Call it.
(GOMP_OFFLOAD_openacc_async_dev2dev): New.
* target.c (gomp_copy_dev2dev): New.
(gomp_load_plugin_for_device): Load dev2dev and async_dev2dev.
* testsuite/libgomp.oacc-c-c++-common/acc_memcpy_device-1.c: New test.
* testsuite/libgomp.oacc-fortran/acc_memcpy_device-1.f90: New test.
13 files changed:
libgomp/libgomp-plugin.h
libgomp/libgomp.h
libgomp/libgomp.map
libgomp/libgomp.texi
libgomp/oacc-mem.c
libgomp/openacc.f90
libgomp/openacc.h
libgomp/openacc_lib.h
libgomp/plugin/plugin-gcn.c
libgomp/plugin/plugin-nvptx.c
libgomp/target.c
libgomp/testsuite/libgomp.oacc-c-c++-common/acc_memcpy_device-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/acc_memcpy_device-1.f90 [new file with mode: 0644]