| 1 |
! This test checks lowering of OpenACC routine directive. |
| 2 |
|
| 3 |
! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s |
| 4 |
|
| 5 |
! CHECK: acc.routine @acc_routine_17 func(@_QPacc_routine19) bind("_QPacc_routine17" [#acc.device_type<host>], "_QPacc_routine17" [#acc.device_type<default>], "_QPacc_routine16" [#acc.device_type<multicore>]) |
| 6 |
! CHECK: acc.routine @acc_routine_16 func(@_QPacc_routine18) bind("_QPacc_routine17" [#acc.device_type<host>], "_QPacc_routine16" [#acc.device_type<multicore>]) |
| 7 |
! CHECK: acc.routine @acc_routine_15 func(@_QPacc_routine17) worker ([#acc.device_type<host>]) vector ([#acc.device_type<multicore>]) |
| 8 |
! CHECK: acc.routine @acc_routine_14 func(@_QPacc_routine16) gang([#acc.device_type<nvidia>]) seq ([#acc.device_type<host>]) |
| 9 |
! CHECK: acc.routine @acc_routine_10 func(@_QPacc_routine11) seq |
| 10 |
! CHECK: acc.routine @acc_routine_9 func(@_QPacc_routine10) seq |
| 11 |
! CHECK: acc.routine @acc_routine_8 func(@_QPacc_routine9) bind("_QPacc_routine9a") |
| 12 |
! CHECK: acc.routine @acc_routine_7 func(@_QPacc_routine8) bind("routine8_") |
| 13 |
! CHECK: acc.routine @acc_routine_6 func(@_QPacc_routine7) gang(dim: 1 : i64) |
| 14 |
! CHECK: acc.routine @acc_routine_5 func(@_QPacc_routine6) nohost |
| 15 |
! CHECK: acc.routine @acc_routine_4 func(@_QPacc_routine5) worker |
| 16 |
! CHECK: acc.routine @acc_routine_3 func(@_QPacc_routine4) vector |
| 17 |
! CHECK: acc.routine @acc_routine_2 func(@_QPacc_routine3) gang |
| 18 |
! CHECK: acc.routine @acc_routine_1 func(@_QPacc_routine2) seq |
| 19 |
! CHECK: acc.routine @acc_routine_0 func(@_QPacc_routine1) |
| 20 |
|
| 21 |
subroutine acc_routine1() |
| 22 |
!$acc routine |
| 23 |
end subroutine |
| 24 |
|
| 25 |
! CHECK-LABEL: func.func @_QPacc_routine1() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>} |
| 26 |
|
| 27 |
subroutine acc_routine2() |
| 28 |
!$acc routine seq |
| 29 |
end subroutine |
| 30 |
|
| 31 |
! CHECK-LABEL: func.func @_QPacc_routine2() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_1]>} |
| 32 |
|
| 33 |
subroutine acc_routine3() |
| 34 |
!$acc routine gang |
| 35 |
end subroutine |
| 36 |
|
| 37 |
! CHECK-LABEL: func.func @_QPacc_routine3() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_2]>} |
| 38 |
|
| 39 |
subroutine acc_routine4() |
| 40 |
!$acc routine vector |
| 41 |
end subroutine |
| 42 |
|
| 43 |
! CHECK-LABEL: func.func @_QPacc_routine4() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_3]>} |
| 44 |
|
| 45 |
subroutine acc_routine5() |
| 46 |
!$acc routine worker |
| 47 |
end subroutine |
| 48 |
|
| 49 |
! CHECK-LABEL: func.func @_QPacc_routine5() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_4]>} |
| 50 |
|
| 51 |
subroutine acc_routine6() |
| 52 |
!$acc routine nohost |
| 53 |
end subroutine |
| 54 |
|
| 55 |
! CHECK-LABEL: func.func @_QPacc_routine6() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_5]>} |
| 56 |
|
| 57 |
subroutine acc_routine7() |
| 58 |
!$acc routine gang(dim:1) |
| 59 |
end subroutine |
| 60 |
|
| 61 |
! CHECK-LABEL: func.func @_QPacc_routine7() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_6]>} |
| 62 |
|
| 63 |
subroutine acc_routine8() |
| 64 |
!$acc routine bind("routine8_") |
| 65 |
end subroutine |
| 66 |
|
| 67 |
! CHECK-LABEL: func.func @_QPacc_routine8() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_7]>} |
| 68 |
|
| 69 |
subroutine acc_routine9a() |
| 70 |
end subroutine |
| 71 |
|
| 72 |
subroutine acc_routine9() |
| 73 |
!$acc routine bind(acc_routine9a) |
| 74 |
end subroutine |
| 75 |
|
| 76 |
! CHECK-LABEL: func.func @_QPacc_routine9() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_8]>} |
| 77 |
|
| 78 |
function acc_routine10() |
| 79 |
!$acc routine(acc_routine10) seq |
| 80 |
end function |
| 81 |
|
| 82 |
! CHECK-LABEL: func.func @_QPacc_routine10() -> f32 attributes {acc.routine_info = #acc.routine_info<[@acc_routine_9]>} |
| 83 |
|
| 84 |
subroutine acc_routine11(a) |
| 85 |
real :: a |
| 86 |
!$acc routine(acc_routine11) seq |
| 87 |
end subroutine |
| 88 |
|
| 89 |
! CHECK-LABEL: func.func @_QPacc_routine11(%arg0: !fir.ref<f32> {fir.bindc_name = "a"}) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_10]>} |
| 90 |
|
| 91 |
subroutine acc_routine12() |
| 92 |
|
| 93 |
interface |
| 94 |
subroutine acc_routine11(a) |
| 95 |
real :: a |
| 96 |
!$acc routine(acc_routine11) seq |
| 97 |
end subroutine |
| 98 |
end interface |
| 99 |
|
| 100 |
end subroutine |
| 101 |
|
| 102 |
subroutine acc_routine13() |
| 103 |
!$acc routine bind(acc_routine14) |
| 104 |
end subroutine |
| 105 |
|
| 106 |
subroutine acc_routine14() |
| 107 |
end subroutine |
| 108 |
|
| 109 |
subroutine acc_routine15() |
| 110 |
!$acc routine bind(acc_routine16) |
| 111 |
end subroutine |
| 112 |
|
| 113 |
subroutine acc_routine16() |
| 114 |
!$acc routine device_type(host) seq dtype(nvidia) gang |
| 115 |
end subroutine |
| 116 |
|
| 117 |
subroutine acc_routine17() |
| 118 |
!$acc routine device_type(host) worker dtype(multicore) vector |
| 119 |
end subroutine |
| 120 |
|
| 121 |
subroutine acc_routine18() |
| 122 |
!$acc routine device_type(host) bind(acc_routine17) dtype(multicore) bind(acc_routine16) |
| 123 |
end subroutine |
| 124 |
|
| 125 |
subroutine acc_routine19() |
| 126 |
!$acc routine device_type(host,default) bind(acc_routine17) dtype(multicore) bind(acc_routine16) |
| 127 |
end subroutine |