mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-21 23:41:13 +08:00
[Fortran] Remove OpenACC 'loop' inside 'parallel' special-case code
Instead, use the generic middle-end code, like already used for Fortran OpenACC 'loop' inside other compute constructs, orphaned 'loop' constructs, and C, C++ generally. gcc/fortran/ * openmp.c (oacc_is_parallel, resolve_oacc_params_in_parallel): Remove. (resolve_oacc_loop_blocks): Don't call the former. gcc/testsuite/ * gfortran.dg/goacc/loop-2-parallel-3.f95: Adjust.
This commit is contained in:
parent
52b7446217
commit
4c27f90095
gcc
@ -6403,11 +6403,6 @@ resolve_omp_do (gfc_code *code)
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
oacc_is_parallel (gfc_code *code)
|
||||
{
|
||||
return code->op == EXEC_OACC_PARALLEL || code->op == EXEC_OACC_PARALLEL_LOOP;
|
||||
}
|
||||
|
||||
static gfc_statement
|
||||
omp_code_to_statement (gfc_code *code)
|
||||
@ -6666,26 +6661,6 @@ resolve_oacc_nested_loops (gfc_code *code, gfc_code* do_code, int collapse,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
resolve_oacc_params_in_parallel (gfc_code *code, const char *clause,
|
||||
const char *arg)
|
||||
{
|
||||
fortran_omp_context *c;
|
||||
|
||||
if (oacc_is_parallel (code))
|
||||
gfc_error ("!$ACC LOOP %s in PARALLEL region doesn't allow "
|
||||
"%s arguments at %L", clause, arg, &code->loc);
|
||||
for (c = omp_current_ctx; c; c = c->previous)
|
||||
{
|
||||
if (oacc_is_loop (c->code))
|
||||
break;
|
||||
if (oacc_is_parallel (c->code))
|
||||
gfc_error ("!$ACC LOOP %s in PARALLEL region doesn't allow "
|
||||
"%s arguments at %L", clause, arg, &code->loc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
resolve_oacc_loop_blocks (gfc_code *code)
|
||||
{
|
||||
@ -6697,18 +6672,6 @@ resolve_oacc_loop_blocks (gfc_code *code)
|
||||
gfc_error ("Tiled loop cannot be parallelized across gangs, workers and "
|
||||
"vectors at the same time at %L", &code->loc);
|
||||
|
||||
if (code->ext.omp_clauses->gang
|
||||
&& code->ext.omp_clauses->gang_num_expr)
|
||||
resolve_oacc_params_in_parallel (code, "GANG", "num");
|
||||
|
||||
if (code->ext.omp_clauses->worker
|
||||
&& code->ext.omp_clauses->worker_expr)
|
||||
resolve_oacc_params_in_parallel (code, "WORKER", "num");
|
||||
|
||||
if (code->ext.omp_clauses->vector
|
||||
&& code->ext.omp_clauses->vector_expr)
|
||||
resolve_oacc_params_in_parallel (code, "VECTOR", "length");
|
||||
|
||||
if (code->ext.omp_clauses->tile_list)
|
||||
{
|
||||
gfc_expr_list *el;
|
||||
|
@ -5,52 +5,52 @@ program test
|
||||
integer :: i
|
||||
|
||||
!$acc parallel
|
||||
!$acc loop gang(5) ! { dg-error "num arguments" }
|
||||
!$acc loop gang(5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc loop gang(num:5) ! { dg-error "num arguments" }
|
||||
!$acc loop gang(num:5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc loop worker(5) ! { dg-error "num arguments" }
|
||||
!$acc loop worker(5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc loop worker(num:5) ! { dg-error "num arguments" }
|
||||
!$acc loop worker(num:5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc loop vector(5) ! { dg-error "length arguments" }
|
||||
!$acc loop vector(5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc loop vector(length:5) ! { dg-error "length arguments" }
|
||||
!$acc loop vector(length:5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
!$acc end parallel
|
||||
|
||||
!$acc parallel loop gang(5) ! { dg-error "num arguments" }
|
||||
!$acc parallel loop gang(5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc parallel loop gang(num:5) ! { dg-error "num arguments" }
|
||||
!$acc parallel loop gang(num:5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc parallel loop worker(5) ! { dg-error "num arguments" }
|
||||
!$acc parallel loop worker(5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc parallel loop worker(num:5) ! { dg-error "num arguments" }
|
||||
!$acc parallel loop worker(num:5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc parallel loop vector(5) ! { dg-error "length arguments" }
|
||||
!$acc parallel loop vector(5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
|
||||
!$acc parallel loop vector(length:5) ! { dg-error "length arguments" }
|
||||
!$acc parallel loop vector(length:5) ! { dg-error "argument not permitted" }
|
||||
DO i = 1,10
|
||||
ENDDO
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user