case GOMP_MAP_ALLOC:
map_seen = 3;
break;
+ case GOMP_MAP_TOFROM:
+ OMP_CLAUSE_SET_MAP_KIND (*pc, GOMP_MAP_TO);
+ map_seen = 3;
+ break;
+ case GOMP_MAP_ALWAYS_TOFROM:
+ OMP_CLAUSE_SET_MAP_KIND (*pc, GOMP_MAP_ALWAYS_TO);
+ map_seen = 3;
+ break;
case GOMP_MAP_FIRSTPRIVATE_POINTER:
case GOMP_MAP_ALWAYS_POINTER:
case GOMP_MAP_ATTACH_DETACH:
map_seen |= 1;
error_at (OMP_CLAUSE_LOCATION (*pc),
"%<#pragma omp target enter data%> with map-type other "
- "than %<to%> or %<alloc%> on %<map%> clause");
+ "than %<to%>, %<tofrom%> or %<alloc%> on %<map%> clause");
*pc = OMP_CLAUSE_CHAIN (*pc);
continue;
}
case GOMP_MAP_DELETE:
map_seen = 3;
break;
+ case GOMP_MAP_TOFROM:
+ OMP_CLAUSE_SET_MAP_KIND (*pc, GOMP_MAP_FROM);
+ map_seen = 3;
+ break;
+ case GOMP_MAP_ALWAYS_TOFROM:
+ OMP_CLAUSE_SET_MAP_KIND (*pc, GOMP_MAP_ALWAYS_FROM);
+ map_seen = 3;
+ break;
case GOMP_MAP_FIRSTPRIVATE_POINTER:
case GOMP_MAP_ALWAYS_POINTER:
case GOMP_MAP_ATTACH_DETACH:
map_seen |= 1;
error_at (OMP_CLAUSE_LOCATION (*pc),
"%<#pragma omp target exit data%> with map-type other "
- "than %<from%>, %<release%> or %<delete%> on %<map%>"
- " clause");
+ "than %<from%>, %<tofrom%>, %<release%> or %<delete%> "
+ "on %<map%> clause");
*pc = OMP_CLAUSE_CHAIN (*pc);
continue;
}
case GOMP_MAP_ALLOC:
map_seen = 3;
break;
+ case GOMP_MAP_TOFROM:
+ OMP_CLAUSE_SET_MAP_KIND (*pc, GOMP_MAP_TO);
+ map_seen = 3;
+ break;
+ case GOMP_MAP_ALWAYS_TOFROM:
+ OMP_CLAUSE_SET_MAP_KIND (*pc, GOMP_MAP_ALWAYS_TO);
+ map_seen = 3;
+ break;
case GOMP_MAP_FIRSTPRIVATE_POINTER:
case GOMP_MAP_FIRSTPRIVATE_REFERENCE:
case GOMP_MAP_ALWAYS_POINTER:
map_seen |= 1;
error_at (OMP_CLAUSE_LOCATION (*pc),
"%<#pragma omp target enter data%> with map-type other "
- "than %<to%> or %<alloc%> on %<map%> clause");
+ "than %<to%>, %<tofrom%> or %<alloc%> on %<map%> clause");
*pc = OMP_CLAUSE_CHAIN (*pc);
continue;
}
case GOMP_MAP_DELETE:
map_seen = 3;
break;
+ case GOMP_MAP_TOFROM:
+ OMP_CLAUSE_SET_MAP_KIND (*pc, GOMP_MAP_FROM);
+ map_seen = 3;
+ break;
+ case GOMP_MAP_ALWAYS_TOFROM:
+ OMP_CLAUSE_SET_MAP_KIND (*pc, GOMP_MAP_ALWAYS_FROM);
+ map_seen = 3;
+ break;
case GOMP_MAP_FIRSTPRIVATE_POINTER:
case GOMP_MAP_FIRSTPRIVATE_REFERENCE:
case GOMP_MAP_ALWAYS_POINTER:
map_seen |= 1;
error_at (OMP_CLAUSE_LOCATION (*pc),
"%<#pragma omp target exit data%> with map-type other "
- "than %<from%>, %<release%> or %<delete%> on %<map%>"
- " clause");
+ "than %<from%>, %<tofrom%>, %<release%> or %<delete%> "
+ "on %<map%> clause");
*pc = OMP_CLAUSE_CHAIN (*pc);
continue;
}
case OMP_MAP_TO: fputs ("to:", dumpfile); break;
case OMP_MAP_FROM: fputs ("from:", dumpfile); break;
case OMP_MAP_TOFROM: fputs ("tofrom:", dumpfile); break;
+ case OMP_MAP_ALWAYS_TO: fputs ("always,to:", dumpfile); break;
+ case OMP_MAP_ALWAYS_FROM: fputs ("always,from:", dumpfile); break;
+ case OMP_MAP_ALWAYS_TOFROM: fputs ("always,tofrom:", dumpfile); break;
+ case OMP_MAP_DELETE: fputs ("delete:", dumpfile); break;
+ case OMP_MAP_RELEASE: fputs ("release:", dumpfile); break;
default: break;
}
else if (list_type == OMP_LIST_LINEAR)
case OMP_MAP_ALWAYS_TO:
case OMP_MAP_ALLOC:
break;
+ case OMP_MAP_TOFROM:
+ n->u.map_op = OMP_MAP_TO;
+ break;
+ case OMP_MAP_ALWAYS_TOFROM:
+ n->u.map_op = OMP_MAP_ALWAYS_TO;
+ break;
default:
gfc_error ("TARGET ENTER DATA with map-type other "
- "than TO, or ALLOC on MAP clause at %L",
- &n->where);
+ "than TO, TOFROM or ALLOC on MAP clause "
+ "at %L", &n->where);
break;
}
break;
case OMP_MAP_RELEASE:
case OMP_MAP_DELETE:
break;
+ case OMP_MAP_TOFROM:
+ n->u.map_op = OMP_MAP_FROM;
+ break;
+ case OMP_MAP_ALWAYS_TOFROM:
+ n->u.map_op = OMP_MAP_ALWAYS_FROM;
+ break;
default:
gfc_error ("TARGET EXIT DATA with map-type other "
- "than FROM, RELEASE, or DELETE on MAP "
- "clause at %L", &n->where);
+ "than FROM, TOFROM, RELEASE, or DELETE on "
+ "MAP clause at %L", &n->where);
break;
}
break;
--- /dev/null
+/* { dg-additional-options "-fdump-tree-original" } */
+
+/* In OpenMP 5.2 permits tofrom for enter/exit data
+ in the FE, it is already converted to 'to' and 'from', respectively. */
+int x, y, z;
+
+void
+copyin ()
+{
+ #pragma omp target enter data map(x) map(tofrom: y) map(always, tofrom: z)
+}
+
+void
+copyout ()
+{
+ #pragma omp target exit data map(x) map(tofrom: y) map(always, tofrom: z)
+}
+
+/* { dg-final { scan-tree-dump-times "#pragma omp target enter data map\\(always,to:z\\) map\\(to:y\\) map\\(to:x\\)" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "#pragma omp target exit data map\\(always,from:z\\) map\\(from:y\\) map\\(from:x\\)" 1 "original" } } */
--- /dev/null
+/* In OpenMP 5.2 permits tofrom for enter/exit data
+ in the FE, it is already converted to 'to' and 'from', respectively. */
+int y, z;
+
+void
+copyin ()
+{
+ #pragma omp target enter data map(from: y) /* { dg-error "'#pragma omp target enter data' with map-type other than 'to', 'tofrom' or 'alloc' on 'map' clause" } */
+ #pragma omp target enter data map(always, from: z) /* { dg-error "'#pragma omp target enter data' with map-type other than 'to', 'tofrom' or 'alloc' on 'map' clause" } */
+}
+
+void
+copyout ()
+{
+ #pragma omp target exit data map(to: y) /* { dg-error "'#pragma omp target exit data' with map-type other than 'from', 'tofrom', 'release' or 'delete' on 'map' clause" } */
+ #pragma omp target exit data map(always, to: z) /* { dg-error "'#pragma omp target exit data' with map-type other than 'from', 'tofrom', 'release' or 'delete' on 'map' clause" } */
+}
--- /dev/null
+! { dg-additional-options "-fdump-tree-original" }
+!
+! In OpenMP 5.2 permits tofrom for enter/exit data
+! in the FE, it is already converted to 'to' and 'from', respectively.
+module m
+ integer :: x, y, z
+contains
+subroutine copyin
+ !$omp target enter data map(x) map(tofrom: y) map(always, tofrom: z)
+end
+subroutine copyout
+ !$omp target exit data map(x) map(tofrom: y) map(always, tofrom: z)
+end
+end
+
+! { dg-final { scan-tree-dump-times "#pragma omp target enter data map\\(to:x\\) map\\(to:y\\) map\\(always,to:z\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "#pragma omp target exit data map\\(from:x\\) map\\(from:y\\) map\\(always,from:z\\)" 1 "original" } }
--- /dev/null
+! In OpenMP 5.2 permits tofrom for enter/exit data
+! in the FE, it is already converted to 'to' and 'from', respectively.
+module m
+ integer :: y, z
+contains
+subroutine copyin
+ !$omp target enter data map(from: y) ! { dg-error "TARGET ENTER DATA with map-type other than TO, TOFROM or ALLOC on MAP clause" }
+ !$omp target enter data map(always, from: z) ! { dg-error "TARGET ENTER DATA with map-type other than TO, TOFROM or ALLOC on MAP clause" }
+end
+subroutine copyout
+ !$omp target exit data map(to: y) ! { dg-error "TARGET EXIT DATA with map-type other than FROM, TOFROM, RELEASE, or DELETE on MAP clause" }
+ !$omp target exit data map(always, to: z) ! { dg-error "TARGET EXIT DATA with map-type other than FROM, TOFROM, RELEASE, or DELETE on MAP clause" }
+end
+end
@tab Y @tab
@item @code{ompt_callback_work} @tab N @tab
@item Default map-type for @code{map} clause in @code{target enter/exit data}
- @tab N @tab
+ @tab Y @tab
@item New @code{doacross} clause as alias for @code{depend} with
@code{source}/@code{sink} modifier @tab N @tab
@item Deprecation of @code{depend} with @code{source}/@code{sink} modifier