diff mbox series

[4/9,OpenACC] Don't pass kind array via pointer to goacc_enter_datum

Message ID 57f10eb6f6449cb2b1676ef839c9b667e028f8de.1592343756.git.julian@codesourcery.com
State New
Headers show
Series Refcounting and manual deep copy improvements | expand

Commit Message

Julian Brown June 16, 2020, 10:38 p.m. UTC
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 mbox series

Patch

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.  */