]> git.ipfire.org Git - thirdparty/gcc.git/commit
amdgcn: libgomp plugin USM implementation devel/omp/gcc-11
authorAndrew Stubbs <ams@codesourcery.com>
Mon, 20 Jun 2022 14:51:15 +0000 (15:51 +0100)
committerAndrew Stubbs <ams@codesourcery.com>
Mon, 27 Jun 2022 16:28:04 +0000 (17:28 +0100)
commitcdddaf7fdffa444b108ad1e6c4cea25073f0db4e
treee818018eeb08fe566d211ef84f79f1ac2fa90d73
parentd1eb334f7b24ee865601d3ab067e05a86802c4d1
amdgcn: libgomp plugin USM implementation

Implement the Unified Shared Memory API calls in the GCN plugin.

The allocate and free are pretty straight-forward because all "target" memory
allocations are compatible with USM, on the right hardware.  However, there's
no known way to check what memory region was used, after the fact, so we use a
splay tree to record allocations so we can answer "is_usm_ptr" later.

libgomp/ChangeLog:

* plugin/plugin-gcn.c (struct usm_splay_tree_key_s): New.
(usm_splay_compare): New.
(splay_tree_prefix): New.
(GOMP_OFFLOAD_usm_alloc): New.
(GOMP_OFFLOAD_usm_free): New.
(GOMP_OFFLOAD_is_usm_ptr): New.
(GOMP_OFFLOAD_supported_features): Move into the OpenMP API fold.
Add GOMP_REQUIRES_UNIFIED_ADDRESS and
GOMP_REQUIRES_UNIFIED_SHARED_MEMORY.
(gomp_fatal): New.
(splay_tree_c): New.
* testsuite/lib/libgomp.exp (check_effective_target_omp_usm): New.
* testsuite/libgomp.c++/usm-1.C: Use dg-require-effective-target.
* testsuite/libgomp.c-c++-common/requires-1.c: Likewise.
* testsuite/libgomp.c/usm-1.c: Likewise.
* testsuite/libgomp.c/usm-2.c: Likewise.
* testsuite/libgomp.c/usm-3.c: Likewise.
* testsuite/libgomp.c/usm-4.c: Likewise.
* testsuite/libgomp.c/usm-5.c: Likewise.
* testsuite/libgomp.c/usm-6.c: Likewise.
libgomp/plugin/plugin-gcn.c
libgomp/testsuite/lib/libgomp.exp
libgomp/testsuite/libgomp.c++/usm-1.C
libgomp/testsuite/libgomp.c-c++-common/requires-1.c
libgomp/testsuite/libgomp.c/usm-1.c
libgomp/testsuite/libgomp.c/usm-2.c
libgomp/testsuite/libgomp.c/usm-3.c
libgomp/testsuite/libgomp.c/usm-4.c
libgomp/testsuite/libgomp.c/usm-5.c
libgomp/testsuite/libgomp.c/usm-6.c