aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/usm-4.c
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2022-06-20 15:51:15 +0100
committerAndrew Stubbs <ams@codesourcery.com>2022-06-27 17:28:04 +0100
commitcdddaf7fdffa444b108ad1e6c4cea25073f0db4e (patch)
treee818018eeb08fe566d211ef84f79f1ac2fa90d73 /libgomp/testsuite/libgomp.c/usm-4.c
parentd1eb334f7b24ee865601d3ab067e05a86802c4d1 (diff)
amdgcn: libgomp plugin USM implementationdevel/omp/gcc-11
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.
Diffstat (limited to 'libgomp/testsuite/libgomp.c/usm-4.c')
-rw-r--r--libgomp/testsuite/libgomp.c/usm-4.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/usm-4.c b/libgomp/testsuite/libgomp.c/usm-4.c
index 753908c8440..1ac5498f73f 100644
--- a/libgomp/testsuite/libgomp.c/usm-4.c
+++ b/libgomp/testsuite/libgomp.c/usm-4.c
@@ -1,4 +1,5 @@
/* { dg-do run } */
+/* { dg-require-effective-target omp_usm } */
#include <omp.h>
#include <stdint.h>