| 1 |
! This test checks lowering of OpenACC serial directive. |
| 2 |
|
| 3 |
! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s |
| 4 |
|
| 5 |
! CHECK-LABEL: acc.firstprivate.recipe @firstprivatization_section_ext10xext10_ref_10x10xf32 : !fir.ref<!fir.array<10x10xf32>> init { |
| 6 |
! CHECK: ^bb0(%{{.*}}: !fir.ref<!fir.array<10x10xf32>>): |
| 7 |
! CHECK: %[[SHAPE:.*]] = fir.shape %{{.*}}, %{{.*}} : (index, index) -> !fir.shape<2> |
| 8 |
! CHECK: %[[ALLOCA:.*]] = fir.alloca !fir.array<10x10xf32> |
| 9 |
! CHECK: %[[DECLARE:.*]]:2 = hlfir.declare %[[ALLOCA]](%[[SHAPE]]) {uniq_name = "acc.private.init"} : (!fir.ref<!fir.array<10x10xf32>>, !fir.shape<2>) -> (!fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) |
| 10 |
! CHECK: acc.yield %[[DECLARE]]#0 : !fir.ref<!fir.array<10x10xf32>> |
| 11 |
! CHECK: } copy { |
| 12 |
! CHECK: ^bb0(%arg0: !fir.ref<!fir.array<10x10xf32>>, %arg1: !fir.ref<!fir.array<10x10xf32>>): |
| 13 |
! CHECK: acc.terminator |
| 14 |
! CHECK: } |
| 15 |
|
| 16 |
! CHECK-LABEL: acc.private.recipe @privatization_ref_10x10xf32 : !fir.ref<!fir.array<10x10xf32>> init { |
| 17 |
! CHECK: ^bb0(%{{.*}}: !fir.ref<!fir.array<10x10xf32>>): |
| 18 |
! CHECK: %[[SHAPE:.*]] = fir.shape %{{.*}}, %{{.*}} : (index, index) -> !fir.shape<2> |
| 19 |
! CHECK: %[[DECLARE:.*]]:2 = hlfir.declare %[[ALLOCA]](%[[SHAPE]]) {uniq_name = "acc.private.init"} : (!fir.ref<!fir.array<10x10xf32>>, !fir.shape<2>) -> (!fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) |
| 20 |
! CHECK: acc.yield %[[DECLARE]]#0 : !fir.ref<!fir.array<10x10xf32>> |
| 21 |
! CHECK: } |
| 22 |
|
| 23 |
! CHECK-LABEL: func.func @_QPacc_serial() |
| 24 |
|
| 25 |
subroutine acc_serial |
| 26 |
integer :: i, j |
| 27 |
|
| 28 |
integer :: async = 1 |
| 29 |
integer :: wait1 = 1 |
| 30 |
integer :: wait2 = 2 |
| 31 |
integer :: numGangs = 1 |
| 32 |
integer :: numWorkers = 10 |
| 33 |
integer :: vectorLength = 128 |
| 34 |
logical :: ifCondition = .TRUE. |
| 35 |
real, dimension(10, 10) :: a, b, c |
| 36 |
real, pointer :: d, e |
| 37 |
integer :: reduction_i |
| 38 |
real :: reduction_r |
| 39 |
|
| 40 |
! CHECK: %[[A:.*]] = fir.alloca !fir.array<10x10xf32> {{{.*}}uniq_name = "{{.*}}Ea"} |
| 41 |
! CHECK: %[[DECLA:.*]]:2 = hlfir.declare %[[A]] |
| 42 |
! CHECK: %[[B:.*]] = fir.alloca !fir.array<10x10xf32> {{{.*}}uniq_name = "{{.*}}Eb"} |
| 43 |
! CHECK: %[[DECLB:.*]]:2 = hlfir.declare %[[B]] |
| 44 |
! CHECK: %[[C:.*]] = fir.alloca !fir.array<10x10xf32> {{{.*}}uniq_name = "{{.*}}Ec"} |
| 45 |
! CHECK: %[[DECLC:.*]]:2 = hlfir.declare %[[C]] |
| 46 |
! CHECK: %[[D:.*]] = fir.alloca !fir.box<!fir.ptr<f32>> {bindc_name = "d", uniq_name = "{{.*}}Ed"} |
| 47 |
! CHECK: %[[DECLD:.*]]:2 = hlfir.declare %[[D]] |
| 48 |
! CHECK: %[[E:.*]] = fir.alloca !fir.box<!fir.ptr<f32>> {bindc_name = "e", uniq_name = "{{.*}}Ee"} |
| 49 |
! CHECK: %[[DECLE:.*]]:2 = hlfir.declare %[[E]] |
| 50 |
! CHECK: %[[IFCONDITION:.*]] = fir.address_of(@{{.*}}ifcondition) : !fir.ref<!fir.logical<4>> |
| 51 |
! CHECK: %[[DECLIFCONDITION:.*]]:2 = hlfir.declare %[[IFCONDITION]] |
| 52 |
|
| 53 |
!$acc serial |
| 54 |
!$acc end serial |
| 55 |
|
| 56 |
! CHECK: acc.serial { |
| 57 |
! CHECK: acc.yield |
| 58 |
! CHECK-NEXT: }{{$}} |
| 59 |
|
| 60 |
!$acc serial async |
| 61 |
!$acc end serial |
| 62 |
|
| 63 |
! CHECK: acc.serial { |
| 64 |
! CHECK: acc.yield |
| 65 |
! CHECK-NEXT: } attributes {asyncOnly = [#acc.device_type<none>]} |
| 66 |
|
| 67 |
!$acc serial async(1) |
| 68 |
!$acc end serial |
| 69 |
|
| 70 |
! CHECK: [[ASYNC1:%.*]] = arith.constant 1 : i32 |
| 71 |
! CHECK: acc.serial async([[ASYNC1]] : i32) { |
| 72 |
! CHECK: acc.yield |
| 73 |
! CHECK-NEXT: }{{$}} |
| 74 |
|
| 75 |
!$acc serial async(async) |
| 76 |
!$acc end serial |
| 77 |
|
| 78 |
! CHECK: [[ASYNC2:%.*]] = fir.load %{{.*}} : !fir.ref<i32> |
| 79 |
! CHECK-NEXT: acc.serial async([[ASYNC2]] : i32) { |
| 80 |
! CHECK: acc.yield |
| 81 |
! CHECK-NEXT: }{{$}} |
| 82 |
|
| 83 |
!$acc serial wait |
| 84 |
!$acc end serial |
| 85 |
|
| 86 |
! CHECK: acc.serial wait { |
| 87 |
! CHECK: acc.yield |
| 88 |
! CHECK-NEXT: } |
| 89 |
|
| 90 |
!$acc serial wait(1) |
| 91 |
!$acc end serial |
| 92 |
|
| 93 |
! CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32 |
| 94 |
! CHECK: acc.serial wait({[[WAIT1]] : i32}) { |
| 95 |
! CHECK: acc.yield |
| 96 |
! CHECK-NEXT: }{{$}} |
| 97 |
|
| 98 |
!$acc serial wait(1, 2) |
| 99 |
!$acc end serial |
| 100 |
|
| 101 |
! CHECK: [[WAIT2:%.*]] = arith.constant 1 : i32 |
| 102 |
! CHECK: [[WAIT3:%.*]] = arith.constant 2 : i32 |
| 103 |
! CHECK: acc.serial wait({[[WAIT2]] : i32, [[WAIT3]] : i32}) { |
| 104 |
! CHECK: acc.yield |
| 105 |
! CHECK-NEXT: }{{$}} |
| 106 |
|
| 107 |
!$acc serial wait(wait1, wait2) |
| 108 |
!$acc end serial |
| 109 |
|
| 110 |
! CHECK: [[WAIT4:%.*]] = fir.load %{{.*}} : !fir.ref<i32> |
| 111 |
! CHECK: [[WAIT5:%.*]] = fir.load %{{.*}} : !fir.ref<i32> |
| 112 |
! CHECK: acc.serial wait({[[WAIT4]] : i32, [[WAIT5]] : i32}) { |
| 113 |
! CHECK: acc.yield |
| 114 |
! CHECK-NEXT: }{{$}} |
| 115 |
|
| 116 |
!$acc serial if(.TRUE.) |
| 117 |
!$acc end serial |
| 118 |
|
| 119 |
! CHECK: [[IF1:%.*]] = arith.constant true |
| 120 |
! CHECK: acc.serial if([[IF1]]) { |
| 121 |
! CHECK: acc.yield |
| 122 |
! CHECK-NEXT: }{{$}} |
| 123 |
|
| 124 |
!$acc serial if(ifCondition) |
| 125 |
!$acc end serial |
| 126 |
|
| 127 |
! CHECK: [[IFCOND:%.*]] = fir.load %{{.*}} : !fir.ref<!fir.logical<4>> |
| 128 |
! CHECK: [[IF2:%.*]] = fir.convert [[IFCOND]] : (!fir.logical<4>) -> i1 |
| 129 |
! CHECK: acc.serial if([[IF2]]) { |
| 130 |
! CHECK: acc.yield |
| 131 |
! CHECK-NEXT: }{{$}} |
| 132 |
|
| 133 |
!$acc serial self(.TRUE.) |
| 134 |
!$acc end serial |
| 135 |
|
| 136 |
! CHECK: [[SELF1:%.*]] = arith.constant true |
| 137 |
! CHECK: acc.serial self([[SELF1]]) { |
| 138 |
! CHECK: acc.yield |
| 139 |
! CHECK-NEXT: }{{$}} |
| 140 |
|
| 141 |
!$acc serial self |
| 142 |
!$acc end serial |
| 143 |
|
| 144 |
! CHECK: acc.serial { |
| 145 |
! CHECK: acc.yield |
| 146 |
! CHECK-NEXT: } attributes {selfAttr} |
| 147 |
|
| 148 |
!$acc serial self(ifCondition) |
| 149 |
!$acc end serial |
| 150 |
|
| 151 |
! CHECK: %[[SELF2:.*]] = fir.convert %[[DECLIFCONDITION]]#1 : (!fir.ref<!fir.logical<4>>) -> i1 |
| 152 |
! CHECK: acc.serial self(%[[SELF2]]) { |
| 153 |
! CHECK: acc.yield |
| 154 |
! CHECK-NEXT: }{{$}} |
| 155 |
|
| 156 |
!$acc serial copy(a, b, c) |
| 157 |
!$acc end serial |
| 158 |
|
| 159 |
! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "a"} |
| 160 |
! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "b"} |
| 161 |
! CHECK: %[[COPYIN_C:.*]] = acc.copyin varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "c"} |
| 162 |
! CHECK: acc.serial dataOperands(%[[COPYIN_A]], %[[COPYIN_B]], %[[COPYIN_C]] : !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) { |
| 163 |
! CHECK: acc.yield |
| 164 |
! CHECK-NEXT: }{{$}} |
| 165 |
! CHECK: acc.copyout accPtr(%[[COPYIN_A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "a"} |
| 166 |
! CHECK: acc.copyout accPtr(%[[COPYIN_B]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "b"} |
| 167 |
! CHECK: acc.copyout accPtr(%[[COPYIN_C]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "c"} |
| 168 |
|
| 169 |
!$acc serial copy(a) copy(b) copy(c) |
| 170 |
!$acc end serial |
| 171 |
|
| 172 |
! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "a"} |
| 173 |
! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "b"} |
| 174 |
! CHECK: %[[COPYIN_C:.*]] = acc.copyin varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "c"} |
| 175 |
! CHECK: acc.serial dataOperands(%[[COPYIN_A]], %[[COPYIN_B]], %[[COPYIN_C]] : !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) { |
| 176 |
! CHECK: acc.yield |
| 177 |
! CHECK-NEXT: }{{$}} |
| 178 |
! CHECK: acc.copyout accPtr(%[[COPYIN_A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "a"} |
| 179 |
! CHECK: acc.copyout accPtr(%[[COPYIN_B]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "b"} |
| 180 |
! CHECK: acc.copyout accPtr(%[[COPYIN_C]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "c"} |
| 181 |
|
| 182 |
!$acc serial copyin(a) copyin(readonly: b, c) |
| 183 |
!$acc end serial |
| 184 |
|
| 185 |
! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "a"} |
| 186 |
! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copyin_readonly>, name = "b"} |
| 187 |
! CHECK: %[[COPYIN_C:.*]] = acc.copyin varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copyin_readonly>, name = "c"} |
| 188 |
! CHECK: acc.serial dataOperands(%[[COPYIN_A]], %[[COPYIN_B]], %[[COPYIN_C]] : !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) { |
| 189 |
! CHECK: acc.yield |
| 190 |
! CHECK-NEXT: }{{$}} |
| 191 |
|
| 192 |
!$acc serial copyout(a) copyout(zero: b) copyout(c) |
| 193 |
!$acc end serial |
| 194 |
|
| 195 |
! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copyout>, name = "a"} |
| 196 |
! CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copyout>, name = "b"} |
| 197 |
! CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_copyout>, name = "c"} |
| 198 |
! CHECK: acc.serial dataOperands(%[[CREATE_A]], %[[CREATE_B]], %[[CREATE_C]] : !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) { |
| 199 |
! CHECK: acc.yield |
| 200 |
! CHECK-NEXT: }{{$}} |
| 201 |
! CHECK: acc.copyout accPtr(%[[CREATE_A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) {name = "a"} |
| 202 |
! CHECK: acc.copyout accPtr(%[[CREATE_B]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) {name = "b"} |
| 203 |
! CHECK: acc.copyout accPtr(%[[CREATE_C]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) {name = "c"} |
| 204 |
|
| 205 |
!$acc serial create(a, b) create(zero: c) |
| 206 |
!$acc end serial |
| 207 |
|
| 208 |
! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "a"} |
| 209 |
! CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "b"} |
| 210 |
! CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_create_zero>, name = "c"} |
| 211 |
! CHECK: acc.serial dataOperands(%[[CREATE_A]], %[[CREATE_B]], %[[CREATE_C]] : !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) { |
| 212 |
! CHECK: acc.yield |
| 213 |
! CHECK-NEXT: }{{$}} |
| 214 |
! CHECK: acc.delete accPtr(%[[CREATE_A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) {dataClause = #acc<data_clause acc_create>, name = "a"} |
| 215 |
! CHECK: acc.delete accPtr(%[[CREATE_B]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) {dataClause = #acc<data_clause acc_create>, name = "b"} |
| 216 |
! CHECK: acc.delete accPtr(%[[CREATE_C]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) {dataClause = #acc<data_clause acc_create_zero>, name = "c"} |
| 217 |
|
| 218 |
!$acc serial no_create(a, b) create(zero: c) |
| 219 |
!$acc end serial |
| 220 |
|
| 221 |
! CHECK: %[[NO_CREATE_A:.*]] = acc.nocreate varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "a"} |
| 222 |
! CHECK: %[[NO_CREATE_B:.*]] = acc.nocreate varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "b"} |
| 223 |
! CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = #acc<data_clause acc_create_zero>, name = "c"} |
| 224 |
! CHECK: acc.serial dataOperands(%[[NO_CREATE_A]], %[[NO_CREATE_B]], %[[CREATE_C]] : !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) { |
| 225 |
! CHECK: acc.yield |
| 226 |
! CHECK-NEXT: }{{$}} |
| 227 |
|
| 228 |
!$acc serial present(a, b, c) |
| 229 |
!$acc end serial |
| 230 |
|
| 231 |
! CHECK: %[[PRESENT_A:.*]] = acc.present varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "a"} |
| 232 |
! CHECK: %[[PRESENT_B:.*]] = acc.present varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "b"} |
| 233 |
! CHECK: %[[PRESENT_C:.*]] = acc.present varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "c"} |
| 234 |
! CHECK: acc.serial dataOperands(%[[PRESENT_A]], %[[PRESENT_B]], %[[PRESENT_C]] : !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) { |
| 235 |
! CHECK: acc.yield |
| 236 |
! CHECK-NEXT: }{{$}} |
| 237 |
|
| 238 |
!$acc serial deviceptr(a) deviceptr(c) |
| 239 |
!$acc end serial |
| 240 |
|
| 241 |
! CHECK: %[[DEVICEPTR_A:.*]] = acc.deviceptr varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "a"} |
| 242 |
! CHECK: %[[DEVICEPTR_C:.*]] = acc.deviceptr varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "c"} |
| 243 |
! CHECK: acc.serial dataOperands(%[[DEVICEPTR_A]], %[[DEVICEPTR_C]] : !fir.ref<!fir.array<10x10xf32>>, !fir.ref<!fir.array<10x10xf32>>) { |
| 244 |
! CHECK: acc.yield |
| 245 |
! CHECK-NEXT: }{{$}} |
| 246 |
|
| 247 |
!$acc serial attach(d, e) |
| 248 |
!$acc end serial |
| 249 |
|
| 250 |
! CHECK: %[[BOX_D:.*]] = fir.load %[[DECLD]]#0 : !fir.ref<!fir.box<!fir.ptr<f32>>> |
| 251 |
! CHECK: %[[BOX_ADDR_D:.*]] = fir.box_addr %[[BOX_D]] : (!fir.box<!fir.ptr<f32>>) -> !fir.ptr<f32> |
| 252 |
! CHECK: %[[ATTACH_D:.*]] = acc.attach varPtr(%[[BOX_ADDR_D]] : !fir.ptr<f32>) -> !fir.ptr<f32> {name = "d"} |
| 253 |
! CHECK: %[[BOX_E:.*]] = fir.load %[[DECLE]]#0 : !fir.ref<!fir.box<!fir.ptr<f32>>> |
| 254 |
! CHECK: %[[BOX_ADDR_E:.*]] = fir.box_addr %[[BOX_E]] : (!fir.box<!fir.ptr<f32>>) -> !fir.ptr<f32> |
| 255 |
! CHECK: %[[ATTACH_E:.*]] = acc.attach varPtr(%[[BOX_ADDR_E]] : !fir.ptr<f32>) -> !fir.ptr<f32> {name = "e"} |
| 256 |
! CHECK: acc.serial dataOperands(%[[ATTACH_D]], %[[ATTACH_E]] : !fir.ptr<f32>, !fir.ptr<f32>) { |
| 257 |
! CHECK: acc.yield |
| 258 |
! CHECK-NEXT: }{{$}} |
| 259 |
! CHECK: acc.detach accPtr(%[[ATTACH_D]] : !fir.ptr<f32>) {dataClause = #acc<data_clause acc_attach>, name = "d"} |
| 260 |
! CHECK: acc.detach accPtr(%[[ATTACH_E]] : !fir.ptr<f32>) {dataClause = #acc<data_clause acc_attach>, name = "e"} |
| 261 |
|
| 262 |
!$acc serial private(a) firstprivate(b) private(c) |
| 263 |
!$acc end serial |
| 264 |
|
| 265 |
! CHECK: %[[ACC_PRIVATE_A:.*]] = acc.private varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "a"} |
| 266 |
! CHECK: %[[ACC_FPRIVATE_B:.*]] = acc.firstprivate varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "b"} |
| 267 |
! CHECK: %[[ACC_PRIVATE_C:.*]] = acc.private varPtr(%[[DECLC]]#0 : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {name = "c"} |
| 268 |
! CHECK: acc.serial firstprivate(@firstprivatization_section_ext10xext10_ref_10x10xf32 -> %[[ACC_FPRIVATE_B]] : !fir.ref<!fir.array<10x10xf32>>) private(@privatization_ref_10x10xf32 -> %[[ACC_PRIVATE_A]] : !fir.ref<!fir.array<10x10xf32>>, @privatization_ref_10x10xf32 -> %[[ACC_PRIVATE_C]] : !fir.ref<!fir.array<10x10xf32>>) { |
| 269 |
! CHECK: acc.yield |
| 270 |
! CHECK-NEXT: }{{$}} |
| 271 |
|
| 272 |
!$acc serial reduction(+:reduction_r) reduction(*:reduction_i) |
| 273 |
!$acc end serial |
| 274 |
|
| 275 |
! CHECK: acc.serial reduction(@reduction_add_ref_f32 -> %{{.*}} : !fir.ref<f32>, @reduction_mul_ref_i32 -> %{{.*}} : !fir.ref<i32>) { |
| 276 |
! CHECK: acc.yield |
| 277 |
! CHECK-NEXT: }{{$}} |
| 278 |
|
| 279 |
!$acc serial default(none) |
| 280 |
!$acc end serial |
| 281 |
|
| 282 |
! CHECK: acc.serial { |
| 283 |
! CHECK: } attributes {defaultAttr = #acc<defaultvalue none>} |
| 284 |
|
| 285 |
!$acc serial default(present) |
| 286 |
!$acc end serial |
| 287 |
|
| 288 |
! CHECK: acc.serial { |
| 289 |
! CHECK: } attributes {defaultAttr = #acc<defaultvalue present>} |
| 290 |
|
| 291 |
end subroutine |