2021-02-10 17:24:45 +08:00
|
|
|
! RUN: %S/test_errors.sh %s %t %flang -fopenmp
|
2020-09-24 20:08:11 +08:00
|
|
|
! OpenMP Version 4.5
|
2021-01-15 13:42:49 +08:00
|
|
|
! 2.7.1 Loop Construct restrictions on single directive.
|
|
|
|
|
2020-09-24 20:08:11 +08:00
|
|
|
|
|
|
|
program omp_do
|
|
|
|
|
2021-01-15 13:42:49 +08:00
|
|
|
integer n
|
2021-04-09 02:33:04 +08:00
|
|
|
integer i,j,k
|
2021-01-15 13:42:49 +08:00
|
|
|
!$omp do
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
2020-09-24 20:08:11 +08:00
|
|
|
end do
|
|
|
|
!$omp end do
|
|
|
|
|
2021-04-30 04:12:28 +08:00
|
|
|
!$omp parallel do
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end parallel do
|
|
|
|
|
|
|
|
!$omp parallel do simd
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end parallel do simd
|
|
|
|
|
|
|
|
!ERROR: `DISTRIBUTE` region has to be strictly nested inside `TEAMS` region.
|
|
|
|
!$omp distribute parallel do
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end distribute parallel do
|
|
|
|
|
|
|
|
!ERROR: `DISTRIBUTE` region has to be strictly nested inside `TEAMS` region.
|
|
|
|
!$omp distribute parallel do simd
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end distribute parallel do simd
|
|
|
|
|
|
|
|
!$omp target parallel do
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end target parallel do
|
|
|
|
|
|
|
|
!$omp target parallel do simd
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end target parallel do simd
|
|
|
|
|
|
|
|
!$omp target teams distribute parallel do
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end target teams distribute parallel do
|
|
|
|
|
|
|
|
!$omp target teams distribute parallel do simd
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end target teams distribute parallel do simd
|
|
|
|
|
2021-04-09 02:33:04 +08:00
|
|
|
!$omp do
|
|
|
|
do i=1,10
|
|
|
|
!$omp task
|
|
|
|
do j=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do k=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end task
|
|
|
|
end do
|
|
|
|
!$omp end do
|
|
|
|
|
|
|
|
!$omp do
|
|
|
|
do i=1,10
|
|
|
|
!$omp parallel
|
|
|
|
do j=1,10
|
|
|
|
!$omp single
|
|
|
|
do k=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end parallel
|
|
|
|
end do
|
|
|
|
!$omp end do
|
|
|
|
|
|
|
|
!$omp do
|
|
|
|
do i=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do j=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do k=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
do k=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end single
|
|
|
|
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp do
|
|
|
|
do k=1,10
|
|
|
|
print *,"hello"
|
|
|
|
end do
|
|
|
|
!$omp end do
|
|
|
|
end do
|
|
|
|
!$omp end do
|
|
|
|
|
2021-01-15 13:42:49 +08:00
|
|
|
!$omp parallel default(shared)
|
|
|
|
!$omp do
|
|
|
|
do i = 1, n
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
call work(i, 1)
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end do
|
|
|
|
!$omp end parallel
|
2020-09-24 20:08:11 +08:00
|
|
|
|
2021-04-09 02:33:04 +08:00
|
|
|
!$omp parallel default(shared)
|
|
|
|
!$omp do
|
|
|
|
do i = 1, n
|
|
|
|
!$omp task
|
|
|
|
do j=1,10
|
|
|
|
!ERROR: A worksharing region may not be closely nested inside a worksharing, explicit task, taskloop, critical, ordered, atomic, or master region
|
|
|
|
!$omp single
|
|
|
|
call work(i, 1)
|
|
|
|
!$omp end single
|
|
|
|
end do
|
|
|
|
!$omp end task
|
|
|
|
end do
|
|
|
|
!$omp end do
|
|
|
|
!$omp end parallel
|
|
|
|
|
2020-09-24 20:08:11 +08:00
|
|
|
end program omp_do
|