]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp: Merge 'gomp_map_vars_openacc' into 'goacc_map_vars' [PR76739]
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 2 Mar 2023 17:36:47 +0000 (18:36 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 10 Mar 2023 13:15:59 +0000 (14:15 +0100)
Upstream has 'goacc_map_vars'; merge the new 'gomp_map_vars_openacc' into it.
(Maybe the latter didn't exist yet when the former was originally added?)
No functional change.

Clean-up for og12 commit 15d0f61a7fecdc8fd12857c40879ea3730f6d99f
"Merge non-contiguous array support patches".

PR other/76739
libgomp/
* libgomp.h (goacc_map_vars): Add 'struct goacc_ncarray_info *'
formal parameter.
(gomp_map_vars_openacc): Remove.
* target.c (goacc_map_vars): Adjust.
(gomp_map_vars_openacc): Remove.
* oacc-mem.c (acc_map_data, goacc_enter_datum)
(goacc_enter_data_internal): Adjust.
* oacc-parallel.c (GOACC_parallel_keyed, GOACC_data_start):
Adjust.

libgomp/ChangeLog.omp
libgomp/libgomp.h
libgomp/oacc-mem.c
libgomp/oacc-parallel.c
libgomp/target.c

index 0e984754bb01b2275d277fc99e60ce39dc5b6ae5..be21ec39428ac5212987e39130e901675c14ee5e 100644 (file)
@@ -1,5 +1,16 @@
 2023-03-10  Thomas Schwinge  <thomas@codesourcery.com>
 
+       PR other/76739
+       * libgomp.h (goacc_map_vars): Add 'struct goacc_ncarray_info *'
+       formal parameter.
+       (gomp_map_vars_openacc): Remove.
+       * target.c (goacc_map_vars): Adjust.
+       (gomp_map_vars_openacc): Remove.
+       * oacc-mem.c (acc_map_data, goacc_enter_datum)
+       (goacc_enter_data_internal): Adjust.
+       * oacc-parallel.c (GOACC_parallel_keyed, GOACC_data_start):
+       Adjust.
+
        * oacc-host.c: Revert
        "OpenACC profiling-interface fixes for asynchronous operations"
        changes.
index ba12d558465ba014da0f4f32214522ccdff94ac6..92f6f14960f168c446c14b8cbe8ddc9fc011d97d 100644 (file)
@@ -1445,15 +1445,14 @@ extern void gomp_attach_pointer (struct gomp_device_descr *,
 extern void gomp_detach_pointer (struct gomp_device_descr *,
                                 struct goacc_asyncqueue *, splay_tree_key,
                                 uintptr_t, bool, struct gomp_coalesce_buf *);
+struct goacc_ncarray_info;
 extern struct target_mem_desc *goacc_map_vars (struct gomp_device_descr *,
                                               struct goacc_asyncqueue *,
                                               size_t, void **, void **,
-                                              size_t *, void *, bool,
+                                              size_t *, void *,
+                                              struct goacc_ncarray_info *,
+                                              bool,
                                               enum gomp_map_vars_kind);
-extern struct target_mem_desc *gomp_map_vars_openacc (struct gomp_device_descr *,
-                                                     struct goacc_asyncqueue *,
-                                                     size_t, void **, size_t *,
-                                                     unsigned short *, void *);
 extern void goacc_unmap_vars (struct target_mem_desc *, bool,
                              struct goacc_asyncqueue *);
 extern void gomp_init_device (struct gomp_device_descr *);
index 6fb8be98542ccf2bad663100ca26b88c62b5ab7c..bd82beefcdb57c366ecc0f21f7ba67a9c91b55fd 100644 (file)
@@ -403,7 +403,7 @@ acc_map_data (void *h, void *d, size_t s)
 
       struct target_mem_desc *tgt
        = goacc_map_vars (acc_dev, NULL, mapnum, &hostaddrs, &devaddrs, &sizes,
-                         &kinds, true, GOMP_MAP_VARS_ENTER_DATA);
+                         &kinds, NULL, true, GOMP_MAP_VARS_ENTER_DATA);
       assert (tgt);
       assert (tgt->list_count == 1);
       splay_tree_key n = tgt->list[0].key;
@@ -572,7 +572,7 @@ goacc_enter_datum (void **hostaddrs, size_t *sizes, void *kinds, int async)
 
       struct target_mem_desc *tgt
        = goacc_map_vars (acc_dev, aq, mapnum, hostaddrs, NULL, sizes,
-                         kinds, true, GOMP_MAP_VARS_ENTER_DATA);
+                         kinds, NULL, true, GOMP_MAP_VARS_ENTER_DATA);
       assert (tgt);
       assert (tgt->list_count == 1);
       n = tgt->list[0].key;
@@ -1247,7 +1247,7 @@ goacc_enter_data_internal (struct gomp_device_descr *acc_dev, size_t mapnum,
              gomp_mutex_unlock (&acc_dev->lock);
              struct target_mem_desc *tgt_
                = goacc_map_vars (acc_dev, aq, groupnum, &hostaddrs[i], NULL,
-                                 &sizes[i], &kinds[i], true,
+                                 &sizes[i], &kinds[i], NULL, true,
                                  GOMP_MAP_VARS_ENTER_DATA);
              assert (tgt_ == NULL);
              gomp_mutex_lock (&acc_dev->lock);
@@ -1297,7 +1297,7 @@ goacc_enter_data_internal (struct gomp_device_descr *acc_dev, size_t mapnum,
 
          struct target_mem_desc *tgt
            = goacc_map_vars (acc_dev, aq, groupnum, &hostaddrs[i], NULL,
-                             &sizes[i], &kinds[i], true,
+                             &sizes[i], &kinds[i], NULL, true,
                              GOMP_MAP_VARS_ENTER_DATA);
          assert (tgt);
 
index d66bc882a5f0b202ace366e2704975bf8b0f36fb..9c1db402c82bc5ee3ce2cfbadba070f827a5bfee 100644 (file)
@@ -468,8 +468,8 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *),
 
   goacc_aq aq = get_goacc_asyncqueue (async);
 
-  tgt = gomp_map_vars_openacc (acc_dev, aq, mapnum, hostaddrs, sizes, kinds,
-                              nca_info);
+  tgt = goacc_map_vars (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, kinds,
+                       nca_info, true, 0);
   free (nca_info);
 
   if (profiling_p)
@@ -635,7 +635,7 @@ GOACC_data_start (int flags_m, size_t mapnum,
     {
       prof_info.device_type = acc_device_host;
       api_info.device_type = prof_info.device_type;
-      tgt = gomp_map_vars_openacc (NULL, NULL, 0, NULL, NULL, NULL, NULL);
+      tgt = goacc_map_vars (NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, true, 0);
       tgt->prev = thr->mapped_data;
       thr->mapped_data = tgt;
 
@@ -652,8 +652,8 @@ GOACC_data_start (int flags_m, size_t mapnum,
     }
 
   gomp_debug (0, "  %s: prepare mappings\n", __FUNCTION__);
-  tgt = gomp_map_vars_openacc (acc_dev, NULL, mapnum, hostaddrs, sizes, kinds,
-                              nca_info);
+  tgt = goacc_map_vars (acc_dev, NULL, mapnum, hostaddrs, NULL, sizes, kinds,
+                       nca_info, true, 0);
   free (nca_info);
   gomp_debug (0, "  %s: mappings prepared\n", __FUNCTION__);
   tgt->prev = thr->mapped_data;
index fcc5b9dabcab4b14749b292e0b91a0bc479d95e2..e4fc7da6f07b72612220cea1b79403a04cf85177 100644 (file)
@@ -1986,18 +1986,6 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep,
   return tgt;
 }
 
-attribute_hidden struct target_mem_desc *
-gomp_map_vars_openacc (struct gomp_device_descr *devicep,
-                      struct goacc_asyncqueue *aq, size_t mapnum,
-                      void **hostaddrs, size_t *sizes, unsigned short *kinds,
-                      void *nca_info)
-{
-  return gomp_map_vars_internal (devicep, aq, mapnum, hostaddrs, NULL,
-                                sizes, (void *) kinds,
-                                (struct goacc_ncarray_info *) nca_info,
-                                true, NULL, GOMP_MAP_VARS_OPENACC);
-}
-
 static struct target_mem_desc *
 gomp_map_vars (struct gomp_device_descr *devicep, size_t mapnum,
               void **hostaddrs, void **devaddrs, size_t *sizes, void *kinds,
@@ -2027,11 +2015,12 @@ attribute_hidden struct target_mem_desc *
 goacc_map_vars (struct gomp_device_descr *devicep,
                struct goacc_asyncqueue *aq, size_t mapnum,
                void **hostaddrs, void **devaddrs, size_t *sizes,
-               void *kinds, bool short_mapkind,
+               void *kinds, struct goacc_ncarray_info *nca_info,
+               bool short_mapkind,
                enum gomp_map_vars_kind pragma_kind)
 {
   return gomp_map_vars_internal (devicep, aq, mapnum, hostaddrs, devaddrs,
-                                sizes, kinds, NULL, short_mapkind, NULL,
+                                sizes, kinds, nca_info, short_mapkind, NULL,
                                 GOMP_MAP_VARS_OPENACC | pragma_kind);
 }