This is a minor cleanup for goacc_enter_datum. Unchanged from previous
posting, but including for completeness:

https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546331.html

OK?

Julian

ChangeLog

        libgomp/
        * oacc-mem.c (goacc_enter_datum): Use scalar kind argument instead of
        kinds array.
        (acc_create, acc_create_async, acc_copyin, acc_copyin_async): Update
        calls to goacc_enter_datum.
---
 libgomp/oacc-mem.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c
index bc64bebe6c1..05998ebc6de 100644
--- a/libgomp/oacc-mem.c
+++ b/libgomp/oacc-mem.c
@@ -501,7 +501,8 @@ acc_unmap_data (void *h)
 /* Enter dynamic mapping for a single datum.  Return the device pointer.  */
 
 static void *
-goacc_enter_datum (void **hostaddrs, size_t *sizes, void *kinds, int async)
+goacc_enter_datum (void **hostaddrs, size_t *sizes, unsigned short kind,
+                  int async)
 {
   void *d;
   splay_tree_key n;
@@ -560,7 +561,7 @@ goacc_enter_datum (void **hostaddrs, size_t *sizes, void 
*kinds, int async)
 
       struct target_mem_desc *tgt
        = gomp_map_vars_async (acc_dev, aq, mapnum, hostaddrs, NULL, sizes,
-                              kinds, true, GOMP_MAP_VARS_ENTER_DATA);
+                              &kind, true, GOMP_MAP_VARS_ENTER_DATA);
       assert (tgt);
       assert (tgt->list_count == 1);
       n = tgt->list[0].key;
@@ -584,15 +585,13 @@ goacc_enter_datum (void **hostaddrs, size_t *sizes, void 
*kinds, int async)
 void *
 acc_create (void *h, size_t s)
 {
-  unsigned short kinds[1] = { GOMP_MAP_ALLOC };
-  return goacc_enter_datum (&h, &s, &kinds, acc_async_sync);
+  return goacc_enter_datum (&h, &s, GOMP_MAP_ALLOC, acc_async_sync);
 }
 
 void
 acc_create_async (void *h, size_t s, int async)
 {
-  unsigned short kinds[1] = { GOMP_MAP_ALLOC };
-  goacc_enter_datum (&h, &s, &kinds, async);
+  goacc_enter_datum (&h, &s, GOMP_MAP_ALLOC, async);
 }
 
 /* acc_present_or_create used to be what acc_create is now.  */
@@ -617,15 +616,13 @@ acc_pcreate (void *h, size_t s)
 void *
 acc_copyin (void *h, size_t s)
 {
-  unsigned short kinds[1] = { GOMP_MAP_TO };
-  return goacc_enter_datum (&h, &s, &kinds, acc_async_sync);
+  return goacc_enter_datum (&h, &s, GOMP_MAP_TO, acc_async_sync);
 }
 
 void
 acc_copyin_async (void *h, size_t s, int async)
 {
-  unsigned short kinds[1] = { GOMP_MAP_TO };
-  goacc_enter_datum (&h, &s, &kinds, async);
+  goacc_enter_datum (&h, &s, GOMP_MAP_TO, async);
 }
 
 /* acc_present_or_copyin used to be what acc_copyin is now.  */
-- 
2.23.0

Reply via email to