+2015-10-27 Thomas Schwinge <thomas@codesourcery.com>
+ James Norris <jnorris@codesourcery.com>
+
+ PR fortran/63865
+ * openmp.c (resolve_oacc_cache): Remove function.
+ (gfc_match_oacc_cache): Enable array sections.
+ (resolve_omp_clauses, gfc_resolve_oacc_directive): Change
+ accordingly.
+ * trans-openmp.c (gfc_trans_omp_clauses): Likewise.
+
2015-10-27 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/68108
{
gfc_omp_clauses *c = gfc_get_omp_clauses ();
match m = gfc_match_omp_variable_list (" (",
- &c->lists[OMP_LIST_CACHE], true);
+ &c->lists[OMP_LIST_CACHE], true,
+ NULL, NULL, true);
if (m != MATCH_YES)
{
gfc_free_omp_clauses(c);
case OMP_LIST_MAP:
case OMP_LIST_TO:
case OMP_LIST_FROM:
+ case OMP_LIST_CACHE:
for (; n != NULL; n = n->next)
{
if (n->expr)
n->sym->name, name, where);
/* FALLTHRU */
case OMP_LIST_DEVICE_RESIDENT:
- case OMP_LIST_CACHE:
check_symbol_not_pointer (n->sym, *where, name);
check_array_not_assumed (n->sym, *where, name);
break;
}
-static void
-resolve_oacc_cache (gfc_code *code ATTRIBUTE_UNUSED)
-{
- sorry ("Sorry, !$ACC cache unimplemented yet");
-}
-
-
void
gfc_resolve_oacc_declare (gfc_namespace *ns)
{
case EXEC_OACC_ENTER_DATA:
case EXEC_OACC_EXIT_DATA:
case EXEC_OACC_WAIT:
+ case EXEC_OACC_CACHE:
resolve_omp_clauses (code, &code->loc, code->ext.omp_clauses, NULL,
true);
break;
case EXEC_OACC_LOOP:
resolve_oacc_loop (code);
break;
- case EXEC_OACC_CACHE:
- resolve_oacc_cache (code);
- break;
default:
break;
}
case OMP_LIST_DEVICE_RESIDENT:
clause_code = OMP_CLAUSE_DEVICE_RESIDENT;
goto add_clause;
- case OMP_LIST_CACHE:
- clause_code = OMP_CLAUSE__CACHE_;
- goto add_clause;
add_clause:
omp_clauses
break;
case OMP_LIST_TO:
case OMP_LIST_FROM:
+ case OMP_LIST_CACHE:
for (; n != NULL; n = n->next)
{
if (!n->sym->attr.referenced)
continue;
- tree node = build_omp_clause (input_location,
- list == OMP_LIST_TO
- ? OMP_CLAUSE_TO : OMP_CLAUSE_FROM);
+ switch (list)
+ {
+ case OMP_LIST_TO:
+ clause_code = OMP_CLAUSE_TO;
+ break;
+ case OMP_LIST_FROM:
+ clause_code = OMP_CLAUSE_FROM;
+ break;
+ case OMP_LIST_CACHE:
+ clause_code = OMP_CLAUSE__CACHE_;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ tree node = build_omp_clause (input_location, clause_code);
if (n->expr == NULL || n->expr->ref->u.ar.type == AR_FULL)
{
tree decl = gfc_get_symbol_decl (n->sym);
+2015-10-27 Thomas Schwinge <thomas@codesourcery.com>
+ James Norris <jnorris@codesourcery.com>
+
+ PR fortran/63865
+ * gfortran.dg/goacc/coarray.f95: Expect the OpenACC cache
+ directive to work.
+ * gfortran.dg/goacc/loop-1.f95: Likewise.
+ * gfortran.dg/goacc/cache-1.f95: Likewise, and extend testing.
+ * gfortran.dg/goacc/cray.f95: Likewise.
+ * gfortran.dg/goacc/parameter.f95: Likewise.
+
2015-10-27 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/68108
program test
implicit none
- integer :: i, d(10)
+ integer :: i, d(10), e(5,13)
do concurrent (i=1:5)
!$acc cache (d)
+ !$acc cache (d(1:3))
+ !$acc cache (d(i:i+2))
+
+ !$acc cache (e)
+ !$acc cache (e(1:3,2:4))
+ !$acc cache (e(i:i+2,i+1:i+3))
enddo
end
-! { dg-prune-output "unimplemented" }
implicit none
integer :: i
integer, codimension[*] :: a
+ ! { dg-excess-errors "sorry, unimplemented: directive not yet implemented" }
!$acc declare device_resident (a)
!$acc data copy (a)
!$acc end data
!$acc end data
!$acc parallel private (a)
!$acc end parallel
+ ! { dg-excess-errors "sorry, unimplemented: directive not yet implemented" }
!$acc host_data use_device (a)
!$acc end host_data
!$acc parallel loop reduction(+:a)
!$acc update self (a)
end subroutine oacc1
end module test
-! { dg-prune-output "ACC cache unimplemented" }
!$acc end parallel loop
!$acc parallel loop
do i = 1,5
- ! Subarrays are not implemented yet
- !$acc cache (pointee) ! TODO: This must fail, as in openacc-1_0-branch
+ !$acc cache (pointee) ! { dg-error "Cray pointee" }
enddo
!$acc end parallel loop
!$acc update device (pointee) ! { dg-error "Cray pointee" }
!$acc update self (ptr)
end subroutine oacc1
end module test
-! { dg-prune-output "ACC cache unimplemented" }
end subroutine test1
end module test
! { dg-prune-output "Deleted" }
-! { dg-prune-output "ACC cache unimplemented" }
!$acc end parallel loop
!$acc parallel loop
do i = 1,5
- !$acc cache (a) ! TODO: This must fail, as in openacc-1_0-branch
+ !$acc cache (a) ! { dg-error "not a variable" }
enddo
!$acc end parallel loop
!$acc update device (a) ! { dg-error "not a variable" }
!$acc update self (a) ! { dg-error "not a variable" }
end subroutine oacc1
end module test
-! { dg-prune-output "ACC cache unimplemented" }