f884bef21c
gcc/fortran/ 2020-05-13 Tobias Burnus <tobias@codesourcery.com> PR fortran/94690 * openmp.c (OMP_DISTRIBUTE_CLAUSES): Add OMP_CLAUSE_LASTPRIVATE. (gfc_resolve_do_iterator): Skip the private handling for SIMD as that is handled by ME code. * trans-openmp.c (gfc_trans_omp_do): Don't add private/lastprivate for dovar_found == 0, unless !simple. libgomp/ 2020-05-13 Tobias Burnus <tobias@codesourcery.com> PR fortran/94690 * testsuite/libgomp.fortran/pr66199-3.f90: New. * testsuite/libgomp.fortran/pr66199-4.f90: New. * testsuite/libgomp.fortran/pr66199-5.f90: New. * testsuite/libgomp.fortran/pr66199-6.f90: New. * testsuite/libgomp.fortran/pr66199-7.f90: New. * testsuite/libgomp.fortran/pr66199-8.f90: New. * testsuite/libgomp.fortran/pr66199-9.f90: New.
61 lines
1.4 KiB
Fortran
61 lines
1.4 KiB
Fortran
! { dg-do run }
|
|
!
|
|
! PR fortran/94690
|
|
! PR middle-end/66199
|
|
|
|
module m
|
|
implicit none
|
|
integer u(0:1023), v(0:1023), w(0:1023)
|
|
!$omp declare target (u, v, w)
|
|
|
|
contains
|
|
|
|
subroutine f1 (a, b)
|
|
integer a, b, d
|
|
!$omp target teams distribute parallel do default(none) firstprivate (a, b) shared(u, v, w)
|
|
do d = a, b-1
|
|
u(d) = v(d) + w(d)
|
|
end do
|
|
end
|
|
|
|
subroutine f2 (a, b, c)
|
|
integer a, b, c, d, e
|
|
!$omp target teams distribute parallel do default(none) firstprivate (a, b, c) shared(u, v, w) lastprivate(d, e)
|
|
do d = a, b-1
|
|
u(d) = v(d) + w(d)
|
|
e = c + d * 5
|
|
end do
|
|
end
|
|
|
|
subroutine f3 (a1, b1, a2, b2)
|
|
integer :: a1, b1, a2, b2, d1, d2
|
|
!$omp target teams distribute parallel do default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) &
|
|
!$omp& lastprivate(d1, d2) collapse(2)
|
|
do d1 = a1, b1-1
|
|
do d2 = a2, b2-1
|
|
u(d1 * 32 + d2) = v(d1 * 32 + d2) + w(d1 * 32 + d2)
|
|
end do
|
|
end do
|
|
end
|
|
|
|
subroutine f4 (a1, b1, a2, b2)
|
|
integer :: a1, b1, a2, b2, d1, d2
|
|
!$omp target teams distribute parallel do default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) &
|
|
!$omp& collapse(2)
|
|
do d1 = a1, b1-1
|
|
do d2 = a2, b2-1
|
|
u(d1 * 32 + d2) = v(d1 * 32 + d2) + w(d1 * 32 + d2)
|
|
end do
|
|
end do
|
|
end
|
|
end module m
|
|
|
|
program main
|
|
use m
|
|
implicit none
|
|
call f1 (0, 1024)
|
|
call f2 (0, 1024, 17)
|
|
call f3 (0, 32, 0, 32)
|
|
call f4 (0, 32, 0, 32)
|
|
end
|