| 1 |
! Test various aspects of clauses specifying compatible levels of parallelism |
| 2 |
! with the OpenACC routine directive. The C/C++ counterpart is |
| 3 |
! '../../c-c++-common/goacc/routine-level-of-parallelism-2.c'. |
| 4 |
|
| 5 |
! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting |
| 6 |
! aspects of that functionality. |
| 7 |
|
| 8 |
subroutine g_1 |
| 9 |
!$acc routine gang |
| 10 |
! { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-2 } |
| 11 |
! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-3 } |
| 12 |
! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-4 } |
| 13 |
end subroutine g_1 |
| 14 |
|
| 15 |
subroutine s_1_2a |
| 16 |
!$acc routine |
| 17 |
end subroutine s_1_2a |
| 18 |
|
| 19 |
subroutine s_1_2b |
| 20 |
!$acc routine seq |
| 21 |
end subroutine s_1_2b |
| 22 |
|
| 23 |
subroutine s_1_2c |
| 24 |
!$acc routine (s_1_2c) |
| 25 |
end subroutine s_1_2c |
| 26 |
|
| 27 |
subroutine s_1_2d |
| 28 |
!$acc routine (s_1_2d) seq |
| 29 |
end subroutine s_1_2d |
| 30 |
|
| 31 |
module s_2 |
| 32 |
contains |
| 33 |
subroutine s_2_1a |
| 34 |
!$acc routine |
| 35 |
end subroutine s_2_1a |
| 36 |
|
| 37 |
subroutine s_2_1b |
| 38 |
!$acc routine seq |
| 39 |
end subroutine s_2_1b |
| 40 |
|
| 41 |
subroutine s_2_1c |
| 42 |
!$acc routine (s_2_1c) |
| 43 |
end subroutine s_2_1c |
| 44 |
|
| 45 |
subroutine s_2_1d |
| 46 |
!$acc routine (s_2_1d) seq |
| 47 |
end subroutine s_2_1d |
| 48 |
end module s_2 |
| 49 |
|
| 50 |
subroutine test |
| 51 |
external g_1, w_1, v_1 |
| 52 |
external s_1_1, s_1_2 |
| 53 |
|
| 54 |
interface |
| 55 |
function s_3_1a (a) |
| 56 |
integer a |
| 57 |
!$acc routine |
| 58 |
end function s_3_1a |
| 59 |
end interface |
| 60 |
|
| 61 |
interface |
| 62 |
function s_3_1b (a) |
| 63 |
integer a |
| 64 |
!$acc routine seq |
| 65 |
end function s_3_1b |
| 66 |
end interface |
| 67 |
|
| 68 |
!$acc routine(g_1) gang |
| 69 |
|
| 70 |
!$acc routine(w_1) worker |
| 71 |
|
| 72 |
!$acc routine(v_1) worker |
| 73 |
|
| 74 |
! Also test the implicit seq clause. |
| 75 |
|
| 76 |
!$acc routine (s_1_1) seq |
| 77 |
|
| 78 |
end subroutine test |