mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-10 22:35:26 +08:00
4fb2b4f7ea
Fortran part to C/C++/libgomp commit r13-724-gb43836914bdc2a37563cf31359b2c4803bfe4374 gcc/fortran/ PR c/105378 * openmp.cc (gfc_match_omp_taskwait): Accept nowait. gcc/testsuite/ PR c/105378 * gfortran.dg/gomp/taskwait-depend-nowait-1.f90: New. libgomp/ PR c/105378 * libgomp.texi (OpenMP 5.1): Set 'taskwait nowait' to 'Y'. * testsuite/libgomp.fortran/taskwait-depend-nowait-1.f90: New.
43 lines
1004 B
Fortran
43 lines
1004 B
Fortran
program main
|
|
implicit none
|
|
integer :: a(0:63), b = 1
|
|
!$omp parallel num_threads (4)
|
|
block
|
|
!$omp single
|
|
block
|
|
integer :: i
|
|
!$omp taskwait depend(in: a) nowait
|
|
!$omp taskwait depend(in: a) nowait
|
|
!$omp taskwait
|
|
!$omp taskgroup
|
|
block
|
|
!$omp taskwait depend(in: a) nowait
|
|
!$omp taskwait depend(in: a) nowait
|
|
end block
|
|
do i = 0, 63
|
|
!$omp task depend(in: a) shared(a)
|
|
block
|
|
a(i) = i
|
|
end block
|
|
end do
|
|
!$omp taskwait depend(inout: a) nowait
|
|
do i = 0, 63
|
|
!$omp task depend(inoutset: a) shared(a)
|
|
block
|
|
if (a(i) /= i) then
|
|
error stop
|
|
else
|
|
a(i) = 2 * i + 1
|
|
end if
|
|
end block
|
|
end do
|
|
!$omp taskwait nowait depend(out: a) depend(in: b)
|
|
!$omp taskwait depend(inout: b)
|
|
do i = 0, 63
|
|
if (a(i) /= 2 * i + 1) &
|
|
error stop
|
|
end do
|
|
end block
|
|
end block
|
|
end program
|