aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2020-06-11 06:43:59 -0700
committerJulian Brown <julian@codesourcery.com>2020-07-09 14:16:00 -0700
commit8d2e5026d22b3f30e7df7adfd4ebf4ebc1e77e2d (patch)
tree4268828dd54b623b130d77b2d1def6fc6226ca8c /libgomp
parentac8996edb14eef0a15cd0ce850fde2be5e227e69 (diff)
downloadgcc-8d2e5026d22b3f30e7df7adfd4ebf4ebc1e77e2d.zip
gcc-8d2e5026d22b3f30e7df7adfd4ebf4ebc1e77e2d.tar.gz
gcc-8d2e5026d22b3f30e7df7adfd4ebf4ebc1e77e2d.tar.bz2
openacc: GOMP_MAP_ATTACH handling in find_group_last
Arrange for GOMP_MAP_ATTACH to be grouped together with a preceding GOMP_MAP_TO_PSET or other "to" data movement clause, except in cases where an explicit "attach" clause is used. 2020-07-09 Julian Brown <julian@codesourcery.com> include/ * gomp-constants.h (gomp_map_kind): Update comment for GOMP_MAP_TO_PSET. libgomp/ * oacc-mem.c (find_group_last): Group data-movement clauses (GOMP_MAP_TO_PSET, GOMP_MAP_TO, etc.) together with a subsequent GOMP_MAP_ATTACH. Allow standalone GOMP_MAP_ATTACH also.
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/oacc-mem.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c
index 4fb78ee..247ca13 100644
--- a/libgomp/oacc-mem.c
+++ b/libgomp/oacc-mem.c
@@ -985,9 +985,15 @@ find_group_last (int pos, size_t mapnum, size_t *sizes, unsigned short *kinds)
switch (kind0)
{
case GOMP_MAP_TO_PSET:
- while (pos + 1 < mapnum && (kinds[pos + 1] & 0xff) == GOMP_MAP_POINTER)
+ if (pos + 1 < mapnum
+ && (kinds[pos + 1] & 0xff) == GOMP_MAP_ATTACH)
+ return pos + 1;
+
+ while (pos + 1 < mapnum
+ && (kinds[pos + 1] & 0xff) == GOMP_MAP_POINTER)
pos++;
- /* We expect at least one GOMP_MAP_POINTER after a GOMP_MAP_TO_PSET. */
+ /* We expect at least one GOMP_MAP_POINTER (if not a single
+ GOMP_MAP_ATTACH) after a GOMP_MAP_TO_PSET. */
assert (pos > first_pos);
break;
@@ -1002,6 +1008,9 @@ find_group_last (int pos, size_t mapnum, size_t *sizes, unsigned short *kinds)
gomp_fatal ("unexpected mapping");
break;
+ case GOMP_MAP_ATTACH:
+ break;
+
default:
/* GOMP_MAP_ALWAYS_POINTER can only appear directly after some other
mapping. */
@@ -1012,9 +1021,16 @@ find_group_last (int pos, size_t mapnum, size_t *sizes, unsigned short *kinds)
return pos + 1;
}
+ /* We can have a single GOMP_MAP_ATTACH mapping after a to/from
+ mapping. */
+ if (pos + 1 < mapnum
+ && (kinds[pos + 1] & 0xff) == GOMP_MAP_ATTACH)
+ return pos + 1;
+
/* We can have zero or more GOMP_MAP_POINTER mappings after a to/from
(etc.) mapping. */
- while (pos + 1 < mapnum && (kinds[pos + 1] & 0xff) == GOMP_MAP_POINTER)
+ while (pos + 1 < mapnum
+ && (kinds[pos + 1] & 0xff) == GOMP_MAP_POINTER)
pos++;
}