]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp: Add OpenMP's omp_target_memset/omp_target_memset_async
authorTobias Burnus <tburnus@baylibre.com>
Mon, 2 Jun 2025 15:43:57 +0000 (17:43 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Tue, 10 Jun 2025 19:57:24 +0000 (21:57 +0200)
commit7704131525574cd28bf3f779da1e1057c46a1f25
treecbc50a81895d23de243112cf5b5cd45e4cfd3fb9
parent682e7678f3d2b5b974bf564deea7a405f0fd37bf
libgomp: Add OpenMP's omp_target_memset/omp_target_memset_async

PR libgomp/120444

include/ChangeLog:

* cuda/cuda.h (cuMemsetD8, cuMemsetD8Async): Declare.

libgomp/ChangeLog:

* libgomp-plugin.h (GOMP_OFFLOAD_memset): Declare.
* libgomp.h (struct gomp_device_descr): Add memset_func.
* libgomp.map (GOMP_6.0.1): Add omp_target_memset{,_async}.
* libgomp.texi (Device Memory Routines): Document them.
* omp.h.in (omp_target_memset, omp_target_memset_async): Declare.
* omp_lib.f90.in (omp_target_memset, omp_target_memset_async):
Add interfaces.
* omp_lib.h.in (omp_target_memset, omp_target_memset_async): Likewise.
* plugin/cuda-lib.def: Add cuMemsetD8.
* plugin/plugin-gcn.c (struct hsa_runtime_fn_info): Add
hsa_amd_memory_fill_fn.
(init_hsa_runtime_functions): DLSYM_OPT_FN load it.
(GOMP_OFFLOAD_memset): New.
* plugin/plugin-nvptx.c (GOMP_OFFLOAD_memset): New.
* target.c (omp_target_memset_int, omp_target_memset,
omp_target_memset_async_helper, omp_target_memset_async): New.
(gomp_load_plugin_for_device): Add DLSYM (memset).
* testsuite/libgomp.c-c++-common/omp_target_memset.c: New test.
* testsuite/libgomp.c-c++-common/omp_target_memset-2.c: New test.
* testsuite/libgomp.c-c++-common/omp_target_memset-3.c: New test.
* testsuite/libgomp.fortran/omp_target_memset.f90: New test.
* testsuite/libgomp.fortran/omp_target_memset-2.f90: New test.

(cherry picked from commit 4e47e2f833732c5d9a3c3e69dc753f99b3a56737)
17 files changed:
include/cuda/cuda.h
libgomp/libgomp-plugin.h
libgomp/libgomp.h
libgomp/libgomp.map
libgomp/libgomp.texi
libgomp/omp.h.in
libgomp/omp_lib.f90.in
libgomp/omp_lib.h.in
libgomp/plugin/cuda-lib.def
libgomp/plugin/plugin-gcn.c
libgomp/plugin/plugin-nvptx.c
libgomp/target.c
libgomp/testsuite/libgomp.c-c++-common/omp_target_memset-2.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/omp_target_memset-3.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/omp_target_memset.c [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/omp_target_memset-2.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/omp_target_memset.f90 [new file with mode: 0644]