mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-12 07:10:26 +08:00
[OpenACC] Allow gang reductions inside serial constructs
... fixing a regression introduced in the preceding commit 2b7dac2c0dcb087da9e4018943c023c0678234a3 "Make OpenACC orphan gang reductions errors". gcc/fortran/ * openmp.c (oacc_is_serial, oacc_is_parallel_or_serial): New. (resolve_oacc_loop_blocks): Use oacc_is_parallel_or_serial instead of oacc_is_parallel. libgomp/ * testsuite/libgomp.oacc-fortran/parallel-dims.f90: Remove temporary skip. Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
This commit is contained in:
parent
2b7dac2c0d
commit
f1a58ab0db
@ -8334,6 +8334,18 @@ oacc_is_kernels (gfc_code *code)
|
||||
return code->op == EXEC_OACC_KERNELS || code->op == EXEC_OACC_KERNELS_LOOP;
|
||||
}
|
||||
|
||||
static bool
|
||||
oacc_is_serial (gfc_code *code)
|
||||
{
|
||||
return code->op == EXEC_OACC_SERIAL || code->op == EXEC_OACC_SERIAL_LOOP;
|
||||
}
|
||||
|
||||
static bool
|
||||
oacc_is_parallel_or_serial (gfc_code *code)
|
||||
{
|
||||
return oacc_is_parallel (code) || oacc_is_serial (code);
|
||||
}
|
||||
|
||||
static gfc_statement
|
||||
omp_code_to_statement (gfc_code *code)
|
||||
{
|
||||
@ -8644,7 +8656,7 @@ resolve_oacc_loop_blocks (gfc_code *code)
|
||||
for (c = omp_current_ctx; c; c = c->previous)
|
||||
if (!oacc_is_loop (c->code))
|
||||
break;
|
||||
if (c == NULL || !(oacc_is_parallel (c->code)
|
||||
if (c == NULL || !(oacc_is_parallel_or_serial (c->code)
|
||||
|| oacc_is_kernels (c->code)))
|
||||
gfc_error ("gang reduction on an orphan loop at %L", &code->loc);
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
! { dg-additional-sources parallel-dims-aux.c }
|
||||
! { dg-do run }
|
||||
! { dg-skip-if TODO { *-*-* } }
|
||||
! { dg-prune-output "command-line option '-fintrinsic-modules-path=.*' is valid for Fortran but not for C" }
|
||||
|
||||
! { dg-additional-options "-fopt-info-note-omp" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user