140 lines · plain
1! This test checks lowering of OpenACC routine directive.2 3! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s4 5! CHECK: acc.routine @[[r14:.*]] func(@_QPacc_routine19) bind(@_QPacc_routine17 [#acc.device_type<host>], @_QPacc_routine176! [#acc.device_type<default>], @_QPacc_routine16 [#acc.device_type<multicore>])7! CHECK: acc.routine @[[r13:.*]] func(@_QPacc_routine18) bind(@_QPacc_routine17 [#acc.device_type<host>], @_QPacc_routine16 [#acc.device_type<multicore>])8! CHECK: acc.routine @[[r12:.*]] func(@_QPacc_routine17) worker ([#acc.device_type<host>]) vector ([#acc.device_type<multicore>])9! CHECK: acc.routine @[[r11:.*]] func(@_QPacc_routine16) gang([#acc.device_type<nvidia>]) seq ([#acc.device_type<host>])10! CHECK: acc.routine @[[r10:.*]] func(@_QPacc_routine11) seq11! CHECK: acc.routine @[[r09:.*]] func(@_QPacc_routine10) seq12! CHECK: acc.routine @[[r08:.*]] func(@_QPacc_routine9) bind(@_QPacc_routine9a)13! CHECK: acc.routine @[[r07:.*]] func(@_QPacc_routine8) bind("routine8_")14! CHECK: acc.routine @[[r06:.*]] func(@_QPacc_routine7) gang(dim: 1 : i64)15! CHECK: acc.routine @[[r05:.*]] func(@_QPacc_routine6) nohost16! CHECK: acc.routine @[[r04:.*]] func(@_QPacc_routine5) worker17! CHECK: acc.routine @[[r03:.*]] func(@_QPacc_routine4) vector18! CHECK: acc.routine @[[r02:.*]] func(@_QPacc_routine3) gang19! CHECK: acc.routine @[[r01:.*]] func(@_QPacc_routine2) seq20! CHECK: acc.routine @[[r00:.*]] func(@_QPacc_routine1)21 22subroutine acc_routine1()23 !$acc routine24end subroutine25 26! CHECK-LABEL: func.func @_QPacc_routine1()27! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r00]]]>}28 29subroutine acc_routine2()30 !$acc routine seq31end subroutine32 33! CHECK-LABEL: func.func @_QPacc_routine2()34! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r01]]]>}35 36subroutine acc_routine3()37 !$acc routine gang38end subroutine39 40! CHECK-LABEL: func.func @_QPacc_routine3()41! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r02]]]>}42 43subroutine acc_routine4()44 !$acc routine vector45end subroutine46 47! CHECK-LABEL: func.func @_QPacc_routine4()48! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r03]]]>}49 50subroutine acc_routine5()51 !$acc routine worker52end subroutine53 54! CHECK-LABEL: func.func @_QPacc_routine5()55! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r04]]]>}56 57subroutine acc_routine6()58 !$acc routine nohost59end subroutine60 61! CHECK-LABEL: func.func @_QPacc_routine6()62! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r05]]]>}63 64subroutine acc_routine7()65 !$acc routine gang(dim:1)66end subroutine67 68! CHECK-LABEL: func.func @_QPacc_routine7()69! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r06]]]>}70 71subroutine acc_routine8()72 !$acc routine bind("routine8_")73end subroutine74 75! CHECK-LABEL: func.func @_QPacc_routine8()76! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r07]]]>}77 78subroutine acc_routine9a()79end subroutine80 81subroutine acc_routine9()82 !$acc routine bind(acc_routine9a)83end subroutine84 85! CHECK-LABEL: func.func @_QPacc_routine9()86! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r08]]]>}87 88function acc_routine10()89 !$acc routine(acc_routine10) seq90end function91 92! CHECK-LABEL: func.func @_QPacc_routine10() -> f3293! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r09]]]>}94 95subroutine acc_routine11(a)96 real :: a97 !$acc routine(acc_routine11) seq98end subroutine99 100! CHECK-LABEL: func.func @_QPacc_routine11(%arg0: !fir.ref<f32> {fir.bindc_name = "a"})101! CHECK-SAME: attributes {acc.routine_info = #acc.routine_info<[@[[r10]]]>}102 103subroutine acc_routine12()104 105 interface106 subroutine acc_routine11(a)107 real :: a108 !$acc routine(acc_routine11) seq109 end subroutine110 end interface111 112end subroutine113 114subroutine acc_routine13()115 !$acc routine bind(acc_routine14)116end subroutine117 118subroutine acc_routine14()119end subroutine120 121subroutine acc_routine15()122 !$acc routine bind(acc_routine16)123end subroutine124 125subroutine acc_routine16()126 !$acc routine device_type(host) seq dtype(nvidia) gang127end subroutine128 129subroutine acc_routine17()130 !$acc routine device_type(host) worker dtype(multicore) vector131end subroutine132 133subroutine acc_routine18()134 !$acc routine device_type(host) bind(acc_routine17) dtype(multicore) bind(acc_routine16)135end subroutine136 137subroutine acc_routine19()138 !$acc routine device_type(host,default) bind(acc_routine17) dtype(multicore) bind(acc_routine16)139end subroutine140