| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! Check that a requires directive is still recognized |
| 4 |
! if it is in the associated parent namespace of the |
| 5 |
! target directive. |
| 6 |
! |
| 7 |
|
| 8 |
module m |
| 9 |
!$omp requires reverse_offload |
| 10 |
contains |
| 11 |
subroutine foo() |
| 12 |
!$omp target device(ancestor:1) |
| 13 |
!$omp end target |
| 14 |
end subroutine foo |
| 15 |
|
| 16 |
subroutine bar() |
| 17 |
block |
| 18 |
block |
| 19 |
block |
| 20 |
!$omp target device(ancestor:1) |
| 21 |
!$omp end target |
| 22 |
end block |
| 23 |
end block |
| 24 |
end block |
| 25 |
end subroutine bar |
| 26 |
end module m |
| 27 |
|
| 28 |
subroutine foo() |
| 29 |
!$omp requires reverse_offload |
| 30 |
block |
| 31 |
block |
| 32 |
block |
| 33 |
!$omp target device(ancestor:1) |
| 34 |
!$omp end target |
| 35 |
end block |
| 36 |
end block |
| 37 |
end block |
| 38 |
contains |
| 39 |
subroutine bar() |
| 40 |
block |
| 41 |
block |
| 42 |
block |
| 43 |
!$omp target device(ancestor:1) |
| 44 |
!$omp end target |
| 45 |
end block |
| 46 |
end block |
| 47 |
end block |
| 48 |
end subroutine bar |
| 49 |
end subroutine foo |
| 50 |
|
| 51 |
program main |
| 52 |
!$omp requires reverse_offload |
| 53 |
contains |
| 54 |
subroutine foo() |
| 55 |
!$omp target device(ancestor:1) |
| 56 |
!$omp end target |
| 57 |
end subroutine foo |
| 58 |
|
| 59 |
subroutine bar() |
| 60 |
block |
| 61 |
block |
| 62 |
block |
| 63 |
!$omp target device(ancestor:1) |
| 64 |
!$omp end target |
| 65 |
end block |
| 66 |
end block |
| 67 |
end block |
| 68 |
end subroutine bar |
| 69 |
end |