I've committed this to gomp4 branch. It removes more now-obsolete bits of gang
local handling.
nathan
2015-09-10 Nathan Sidwell <nat...@codesourcery.com>
include/
* gomp-constants.h (GOMP_MAP_FLAG_GANGLOCAL): Delete.
(enum gomp_map_kind): Remove GOMP_MAP_GANGLOCAL,
GOMP_MAP_FORCE_TO_GANGLOCAL).
libgomp/
* oacc-parallel.c (alloc_ganglocal_addrs): Delete.
(GOACC_parallel_keyed): Do not call it.
(GOACC_update): Remove GOMP_MAP_FORCE_TO_GANGLOCAL case.
* target.c (gomp_map_vars): Remove GOMP_MAP_FORCE_TO_GANGLOCAL
handling.
Index: libgomp/oacc-parallel.c
===================================================================
--- libgomp/oacc-parallel.c (revision 227633)
+++ libgomp/oacc-parallel.c (working copy)
@@ -57,33 +57,6 @@ find_pointer (int pos, size_t mapnum, un
return 0;
}
-static void
-alloc_ganglocal_addrs (size_t mapnum, void **hostaddrs, size_t *sizes,
- unsigned short *kinds)
-{
- int i;
- const int typemask = 0xff;
- void *t;
-
- for (i = 0; i < mapnum; i++)
- {
- if ((kinds[i] & typemask) == GOMP_MAP_FORCE_TO_GANGLOCAL)
- {
- t = malloc (sizes[i]);
- memcpy (t, hostaddrs[i], sizes[i]);
- hostaddrs[i] = t;
-
- if (i + 1 < mapnum && GOMP_MAP_POINTER_P (kinds[i+1] & typemask))
- {
- size_t *ptr = (size_t *) malloc (sizeof (size_t *));
- *ptr = (size_t)t;
- hostaddrs[i+1] = ptr;
- i++;
- }
- }
- }
-}
-
static struct oacc_static
{
void *addr;
@@ -176,8 +149,6 @@ GOACC_parallel_keyed (int device, void (
__FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds);
#endif
- alloc_ganglocal_addrs (mapnum, hostaddrs, sizes, kinds);
-
goacc_lazy_initialize ();
thr = goacc_thread ();
@@ -617,7 +588,6 @@ GOACC_update (int device, size_t mapnum,
break;
case GOMP_MAP_FORCE_TO:
- case GOMP_MAP_FORCE_TO_GANGLOCAL:
acc_update_device (hostaddrs[i], sizes[i]);
break;
Index: libgomp/target.c
===================================================================
--- libgomp/target.c (revision 227633)
+++ libgomp/target.c (working copy)
@@ -373,12 +373,7 @@ gomp_map_vars (struct gomp_device_descr
k->tgt_offset = tgt_size;
tgt_size += k->host_end - k->host_start;
k->copy_from = GOMP_MAP_COPY_FROM_P (kind & typemask);
- k->dealloc_host = (kind & typemask)
- == GOMP_MAP_FORCE_TO_GANGLOCAL;
- if (GOMP_MAP_POINTER_P (kind & typemask) && i < 0 &&
- (get_kind (is_openacc, kinds, i-1) & typemask)
- == GOMP_MAP_FORCE_TO_GANGLOCAL)
- k->dealloc_host = true;
+ k->dealloc_host = false;
k->refcount = 1;
k->async_refcount = 0;
tgt->refcount++;
@@ -395,7 +390,6 @@ gomp_map_vars (struct gomp_device_descr
case GOMP_MAP_TO:
case GOMP_MAP_TOFROM:
case GOMP_MAP_FORCE_TO:
- case GOMP_MAP_FORCE_TO_GANGLOCAL:
case GOMP_MAP_FORCE_TOFROM:
/* FIXME: Perhaps add some smarts, like if copying
several adjacent fields from host to target, use some
Index: include/gomp-constants.h
===================================================================
--- include/gomp-constants.h (revision 227633)
+++ include/gomp-constants.h (working copy)
@@ -36,7 +36,6 @@
#define GOMP_MAP_FLAG_TO (1 << 0)
#define GOMP_MAP_FLAG_FROM (1 << 1)
-#define GOMP_MAP_FLAG_GANGLOCAL (1 << 4)
/* Special map kinds, enumerated starting here. */
#define GOMP_MAP_FLAG_SPECIAL_0 (1 << 2)
#define GOMP_MAP_FLAG_SPECIAL_1 (1 << 3)
@@ -55,8 +54,6 @@ enum gomp_map_kind
GOMP_MAP_FROM = (GOMP_MAP_ALLOC | GOMP_MAP_FLAG_FROM),
/* ..., and copy to and from device. */
GOMP_MAP_TOFROM = (GOMP_MAP_TO | GOMP_MAP_FROM),
- /* OpenACC Gang-local. */
- GOMP_MAP_GANGLOCAL = (GOMP_MAP_ALLOC | GOMP_MAP_FLAG_GANGLOCAL),
/* The following kind is an internal only map kind, used for pointer based
array sections. OMP_CLAUSE_SIZE for these is not the pointer size,
which is implicitly POINTER_SIZE_UNITS, but the bias. */
@@ -84,9 +81,7 @@ enum gomp_map_kind
/* ..., and copy from device. */
GOMP_MAP_FORCE_FROM = (GOMP_MAP_FLAG_FORCE | GOMP_MAP_FROM),
/* ..., and copy to and from device. */
- GOMP_MAP_FORCE_TOFROM = (GOMP_MAP_FLAG_FORCE | GOMP_MAP_TOFROM),
- /* Flag to allocate, copy to device and also make gang-local. */
- GOMP_MAP_FORCE_TO_GANGLOCAL = (GOMP_MAP_FORCE_TO | GOMP_MAP_GANGLOCAL)
+ GOMP_MAP_FORCE_TOFROM = (GOMP_MAP_FLAG_FORCE | GOMP_MAP_TOFROM)
};
#define GOMP_MAP_COPY_TO_P(X) \