diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2022-06-03 15:52:22 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2022-06-03 15:54:02 +0200 |
commit | ff35a75473d28205e52ecbcf9e6b5107b8b5ab90 (patch) | |
tree | fabbe2b84e5a22ae4936faa6a0455fa3dab3713e /libgomp | |
parent | 43c013df02fdb07f9b7a5e7e6669e6d69769d451 (diff) | |
download | gcc-ff35a75473d28205e52ecbcf9e6b5107b8b5ab90.zip gcc-ff35a75473d28205e52ecbcf9e6b5107b8b5ab90.tar.gz gcc-ff35a75473d28205e52ecbcf9e6b5107b8b5ab90.tar.bz2 |
OpenMP/Fortran: Add support for firstprivate and allocate clauses on scope construct
Fortran commit to C/C++/backend commit
r13-862-gf38b20d68fade5a922b9f68c4c3841e653d1b83c
gcc/fortran/ChangeLog:
* openmp.cc (OMP_SCOPE_CLAUSES): Add firstprivate and allocate.
libgomp/ChangeLog:
* libgomp.texi (OpenMP 5.2): Mark scope w/ firstprivate/allocate as Y.
* testsuite/libgomp.fortran/scope-2.f90: New test.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/scope-5.f90: New test.
* gfortran.dg/gomp/scope-6.f90: New test.
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/libgomp.texi | 2 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/scope-2.f90 | 57 |
2 files changed, 58 insertions, 1 deletions
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index ff02ccd..11613bf 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -386,7 +386,7 @@ The OpenMP 4.5 specification is fully supported. @item Deprecation of delimited form of @code{declare target} @tab N @tab @item Reproducible semantics changed for @code{order(concurrent)} @tab N @tab @item @code{allocate} and @code{firstprivate} clauses on @code{scope} - @tab N @tab + @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 diff --git a/libgomp/testsuite/libgomp.fortran/scope-2.f90 b/libgomp/testsuite/libgomp.fortran/scope-2.f90 new file mode 100644 index 0000000..f2e1593 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/scope-2.f90 @@ -0,0 +1,57 @@ +program main + implicit none + integer a(0:63) + integer r, r2, i, n + a = 0 + r = 0 + r2 = 0 + n = 64 + !$omp parallel + !$omp scope + !$omp scope firstprivate (n) + !$omp do + do i = 0, 63 + a(i) = a(i) + 1 + end do + !$omp end scope nowait + !$omp end scope nowait + + !$omp scope reduction(+: r) firstprivate (n) + !$omp do + do i = 0, 63 + r = r + i + if (a(i) /= 1) & + error stop + end do + !$omp end do nowait + !$omp barrier + if (n /= 64) then + error stop + else + n = 128 + end if + !$omp end scope nowait + + !$omp barrier + if (r /= 64 * 63 / 2) & + error stop + !$omp scope private (i) + !$omp scope reduction(+: r2) + !$omp do + do i = 0, 63 + r2 = r2 + 2 * i + a(i) = a(i) + i + end do + !$omp end do nowait + !$omp end scope + !$omp end scope nowait + if (r2 /= 64 * 63) & + error stop + !$omp do + do i = 0, 63 + if (a(i) /= i + 1) & + error stop + end do + !$omp end do nowait + !$omp end parallel +end program |