From 9a51c0cc2af361d9338965d41d40ce8f8ede5266 Mon Sep 17 00:00:00 2001 From: Cesar Philippidis Date: Mon, 24 Sep 2018 07:51:25 -0700 Subject: [PATCH] [OpenACC] update fortran nested parallelism error messages gcc/fortran/ * openmp.c (resolve_oacc_loop_blocks): gcc/testsuite/ * gfortran.dg/goacc/nested-parallelism.f90: New test. From-SVN: r264536 --- gcc/fortran/ChangeLog | 5 ++ gcc/fortran/openmp.c | 2 +- gcc/testsuite/ChangeLog | 4 ++ .../gfortran.dg/goacc/nested-parallelism.f90 | 51 +++++++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/goacc/nested-parallelism.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 98e1dd645b8..3901e2961a0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-09-24 Bernhard Reuther-Fischer + Cesar Philippidis + + * openmp.c (resolve_oacc_loop_blocks): + 2018-09-23 Thomas Koenig PR fortran/87397 diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 94a7f7eaa50..bd83733580e 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -5853,7 +5853,7 @@ resolve_oacc_loop_blocks (gfc_code *code) &code->loc); if (c->code->ext.omp_clauses->vector) gfc_error ("Loop parallelized across gangs is not allowed " - "inside loop parallelized across workers at %L", + "inside loop parallelized across vectors at %L", &code->loc); } if (code->ext.omp_clauses->worker) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 16dc1a49412..cf1add78d2b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-09-24 Cesar Philippidis + + * gfortran.dg/goacc/nested-parallelism.f90: New test. + 2018-09-24 Ilya Leoshkevich PR target/80080 diff --git a/gcc/testsuite/gfortran.dg/goacc/nested-parallelism.f90 b/gcc/testsuite/gfortran.dg/goacc/nested-parallelism.f90 new file mode 100644 index 00000000000..6ebef6a4547 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/nested-parallelism.f90 @@ -0,0 +1,51 @@ +! Verify the invalid gang, worker, vector parallelism error messages. + +program np + integer, parameter :: n = 100 + integer :: i, j, k + + !$acc parallel loop gang + do i = 1, n + !$acc loop gang ! { dg-error "gangs is not allowed inside another loop parallelized across gangs" } + do j = 1, n + end do + + !$acc loop worker + do j = 1, n + end do + + !$acc loop vector + do j = 1, n + end do + end do + + !$acc parallel loop worker + do i = 1, n + !$acc loop gang ! { dg-error "gangs is not allowed inside loop parallelized across workers" } + do j = 1, n + end do + + !$acc loop worker ! { dg-error "workers is not allowed inside another loop parallelized across workers" } + do j = 1, n + end do + + !$acc loop vector + do j = 1, n + end do + end do + + !$acc parallel loop vector + do i = 1, n + !$acc loop gang ! { dg-error "gangs is not allowed inside loop parallelized across vectors" } + do j = 1, n + end do + + !$acc loop worker ! { dg-error "workers is not allowed inside another loop parallelized across vectors" } + do j = 1, n + end do + + !$acc loop vector ! { dg-error "vectors is not allowed inside another loop parallelized across vectors" } + do j = 1, n + end do + end do +end program np -- 2.30.2