1 ! This test checks lowering of OpenACC kernels loop combined directive.
3 ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
5 subroutine acc_kernels_loop
11 integer :: numGangs
= 1
12 integer :: numWorkers
= 10
13 integer :: vectorLength
= 128
14 logical :: ifCondition
= .TRUE
.
15 integer, parameter :: n
= 10
16 real, dimension(n
) :: a
, b
, c
17 real, dimension(n
, n
) :: d
, e
19 integer :: reduction_i
22 integer :: gangNum
= 8
23 integer :: gangStatic
= 8
24 integer :: vectorNum
= 128
25 integer, parameter :: tileSize
= 2
27 ! CHECK: %[[A:.*]] = fir.alloca !fir.array<10xf32> {{{.*}}uniq_name = "{{.*}}Ea"}
28 ! CHECK: %[[DECLA:.*]]:2 = hlfir.declare %[[A]]
29 ! CHECK: %[[B:.*]] = fir.alloca !fir.array<10xf32> {{{.*}}uniq_name = "{{.*}}Eb"}
30 ! CHECK: %[[DECLB:.*]]:2 = hlfir.declare %[[B]]
31 ! CHECK: %[[C:.*]] = fir.alloca !fir.array<10xf32> {{{.*}}uniq_name = "{{.*}}Ec"}
32 ! CHECK: %[[DECLC:.*]]:2 = hlfir.declare %[[C]]
33 ! CHECK: %[[F:.*]] = fir.alloca !fir.box<!fir.ptr<f32>> {bindc_name = "f", uniq_name = "{{.*}}Ef"}
34 ! CHECK: %[[DECLF:.*]]:2 = hlfir.declare %[[F]]
35 ! CHECK: %[[G:.*]] = fir.alloca !fir.box<!fir.ptr<f32>> {bindc_name = "g", uniq_name = "{{.*}}Eg"}
36 ! CHECK: %[[DECLG:.*]]:2 = hlfir.declare %[[G]]
37 ! CHECK: %[[IFCONDITION:.*]] = fir.address_of(@{{.*}}ifcondition) : !fir.ref<!fir.logical<4>>
38 ! CHECK: %[[DECLIFCONDITION:.*]]:2 = hlfir.declare %[[IFCONDITION]]
47 ! CHECK: acc.kernels {
48 ! CHECK: acc.loop private{{.*}} {
51 ! CHECK: acc.terminator
59 ! CHECK: acc.kernels combined(loop) {
60 ! CHECK: acc.loop combined(kernels) private{{.*}} {
63 ! CHECK: acc.terminator
66 !$acc kernels loop async
70 !$acc end kernels loop
72 ! CHECK: acc.kernels {{.*}} {
73 ! CHECK: acc.loop {{.*}} {
76 ! CHECK: acc.terminator
77 ! CHECK-NEXT: } attributes {asyncOnly = [#acc.device_type<none>]}
79 !$acc kernels loop async(1)
84 ! CHECK: [[ASYNC1:%.*]] = arith.constant 1 : i32
85 ! CHECK: acc.kernels {{.*}} async([[ASYNC1]] : i32) {
86 ! CHECK: acc.loop {{.*}} {
89 ! CHECK: acc.terminator
92 !$acc kernels loop async(async)
97 ! CHECK: [[ASYNC2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
98 ! CHECK: acc.kernels {{.*}} async([[ASYNC2]] : i32) {
99 ! CHECK: acc.loop {{.*}} {
102 ! CHECK: acc.terminator
105 !$acc kernels loop wait
110 ! CHECK: acc.kernels {{.*}} wait {
111 ! CHECK: acc.loop {{.*}} {
114 ! CHECK: acc.terminator
117 !$acc kernels loop wait(1)
122 ! CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32
123 ! CHECK: acc.kernels {{.*}} wait({[[WAIT1]] : i32}) {
127 ! CHECK: acc.terminator
130 !$acc kernels loop wait(1, 2)
135 ! CHECK: [[WAIT2:%.*]] = arith.constant 1 : i32
136 ! CHECK: [[WAIT3:%.*]] = arith.constant 2 : i32
137 ! CHECK: acc.kernels {{.*}} wait({[[WAIT2]] : i32, [[WAIT3]] : i32}) {
141 ! CHECK: acc.terminator
144 !$acc kernels loop wait(wait1, wait2)
149 ! CHECK: [[WAIT4:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
150 ! CHECK: [[WAIT5:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
151 ! CHECK: acc.kernels {{.*}} wait({[[WAIT4]] : i32, [[WAIT5]] : i32}) {
155 ! CHECK: acc.terminator
158 !$acc kernels loop num_gangs(1)
163 ! CHECK: [[NUMGANGS1:%.*]] = arith.constant 1 : i32
164 ! CHECK: acc.kernels {{.*}} num_gangs({[[NUMGANGS1]] : i32}) {
168 ! CHECK: acc.terminator
171 !$acc kernels loop num_gangs(numGangs)
176 ! CHECK: [[NUMGANGS2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
177 ! CHECK: acc.kernels {{.*}} num_gangs({[[NUMGANGS2]] : i32}) {
181 ! CHECK: acc.terminator
184 !$acc kernels loop num_workers(10)
189 ! CHECK: [[NUMWORKERS1:%.*]] = arith.constant 10 : i32
190 ! CHECK: acc.kernels {{.*}} num_workers([[NUMWORKERS1]] : i32) {
191 ! CHECK: acc.loop {{.*}} {
194 ! CHECK: acc.terminator
197 !$acc kernels loop num_workers(numWorkers)
202 ! CHECK: [[NUMWORKERS2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
203 ! CHECK: acc.kernels {{.*}} num_workers([[NUMWORKERS2]] : i32) {
204 ! CHECK: acc.loop {{.*}} {
207 ! CHECK: acc.terminator
210 !$acc kernels loop vector_length(128)
215 ! CHECK: [[VECTORLENGTH1:%.*]] = arith.constant 128 : i32
216 ! CHECK: acc.kernels {{.*}} vector_length([[VECTORLENGTH1]] : i32) {
217 ! CHECK: acc.loop {{.*}} {
220 ! CHECK: acc.terminator
223 !$acc kernels loop vector_length(vectorLength)
228 ! CHECK: [[VECTORLENGTH2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
229 ! CHECK: acc.kernels {{.*}} vector_length([[VECTORLENGTH2]] : i32) {
230 ! CHECK: acc.loop {{.*}} {
233 ! CHECK: acc.terminator
236 !$acc kernels loop if(.TRUE.)
241 ! CHECK: [[IF1:%.*]] = arith.constant true
242 ! CHECK: acc.kernels {{.*}} if([[IF1]]) {
243 ! CHECK: acc.loop {{.*}} {
246 ! CHECK: acc.terminator
249 !$acc kernels loop if(ifCondition)
254 ! CHECK: [[IFCOND:%.*]] = fir.load %{{.*}} : !fir.ref<!fir.logical<4>>
255 ! CHECK: [[IF2:%.*]] = fir.convert [[IFCOND]] : (!fir.logical<4>) -> i1
256 ! CHECK: acc.kernels {{.*}} if([[IF2]]) {
257 ! CHECK: acc.loop {{.*}} {
260 ! CHECK: acc.terminator
263 !$acc kernels loop self(.TRUE.)
268 ! CHECK: [[SELF1:%.*]] = arith.constant true
269 ! CHECK: acc.kernels {{.*}} self([[SELF1]]) {
270 ! CHECK: acc.loop {{.*}} {
273 ! CHECK: acc.terminator
276 !$acc kernels loop self
281 ! CHECK: acc.kernels {{.*}}{
282 ! CHECK: acc.loop {{.*}} {
285 ! CHECK: acc.terminator
286 ! CHECK-NEXT: } attributes {selfAttr}
288 !$acc kernels loop self(ifCondition)
294 ! CHECK: %[[SELF2:.*]] = fir.convert %[[DECLIFCONDITION]]#1 : (!fir.ref<!fir.logical<4>>) -> i1
295 ! CHECK: acc.kernels {{.*}} self(%[[SELF2]]) {
296 ! CHECK: acc.loop {{.*}} {
299 ! CHECK: acc.terminator
302 !$acc kernels loop copy(a, b)
308 ! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "a"}
309 ! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "b"}
310 ! CHECK: acc.kernels {{.*}} dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
311 ! CHECK: acc.loop {{.*}} {
314 ! CHECK: acc.terminator
316 ! CHECK: acc.copyout accPtr(%[[COPYIN_A]] : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) to varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "a"}
317 ! CHECK: acc.copyout accPtr(%[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) to varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "b"}
319 !$acc kernels loop copy(a) copy(b)
324 ! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "a"}
325 ! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "b"}
326 ! CHECK: acc.kernels {{.*}} dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
327 ! CHECK: acc.loop {{.*}} {
330 ! CHECK: acc.terminator
332 ! CHECK: acc.copyout accPtr(%[[COPYIN_A]] : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) to varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "a"}
333 ! CHECK: acc.copyout accPtr(%[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) to varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) {dataClause = #acc<data_clause acc_copy>, name = "b"}
335 !$acc kernels loop copyin(a) copyin(readonly: b)
340 ! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
341 ! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copyin_readonly>, name = "b"}
342 ! CHECK: acc.kernels {{.*}} dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
343 ! CHECK: acc.loop {{.*}} {
346 ! CHECK: acc.terminator
349 !$acc kernels loop copyout(a) copyout(zero: b)
354 ! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copyout>, name = "a"}
355 ! CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copyout>, name = "b"}
356 ! CHECK: acc.kernels {{.*}} dataOperands(%[[CREATE_A]], %[[CREATE_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
357 ! CHECK: acc.loop {{.*}} {
360 ! CHECK: acc.terminator
362 ! CHECK: acc.copyout accPtr(%[[CREATE_A]] : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) to varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) {name = "a"}
363 ! CHECK: acc.copyout accPtr(%[[CREATE_B]] : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) to varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) {name = "b"}
365 !$acc kernels loop create(b) create(zero: a)
370 ! CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
371 ! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_create_zero>, name = "a"}
372 ! CHECK: acc.kernels {{.*}} dataOperands(%[[CREATE_B]], %[[CREATE_A]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
373 ! CHECK: acc.loop {{.*}} {
376 ! CHECK: acc.terminator
378 ! CHECK: acc.delete accPtr(%[[CREATE_B]] : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) {dataClause = #acc<data_clause acc_create>, name = "b"}
379 ! CHECK: acc.delete accPtr(%[[CREATE_A]] : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) {dataClause = #acc<data_clause acc_create_zero>, name = "a"}
381 !$acc kernels loop no_create(a, b)
386 ! CHECK: %[[NOCREATE_A:.*]] = acc.nocreate varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
387 ! CHECK: %[[NOCREATE_B:.*]] = acc.nocreate varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
388 ! CHECK: acc.kernels {{.*}} dataOperands(%[[NOCREATE_A]], %[[NOCREATE_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
389 ! CHECK: acc.loop {{.*}} {
392 ! CHECK: acc.terminator
395 !$acc kernels loop present(a, b)
400 ! CHECK: %[[PRESENT_A:.*]] = acc.present varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
401 ! CHECK: %[[PRESENT_B:.*]] = acc.present varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
402 ! CHECK: acc.kernels {{.*}} dataOperands(%[[PRESENT_A]], %[[PRESENT_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
403 ! CHECK: acc.loop {{.*}} {
406 ! CHECK: acc.terminator
409 !$acc kernels loop deviceptr(a) deviceptr(b)
414 ! CHECK: %[[DEVICEPTR_A:.*]] = acc.deviceptr varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
415 ! CHECK: %[[DEVICEPTR_B:.*]] = acc.deviceptr varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
416 ! CHECK: acc.kernels {{.*}} dataOperands(%[[DEVICEPTR_A]], %[[DEVICEPTR_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
417 ! CHECK: acc.loop {{.*}} {
420 ! CHECK: acc.terminator
423 !$acc kernels loop attach(f, g)
428 ! CHECK: %[[BOX_F:.*]] = fir.load %[[DECLF]]#0 : !fir.ref<!fir.box<!fir.ptr<f32>>>
429 ! CHECK: %[[BOX_ADDR_F:.*]] = fir.box_addr %[[BOX_F]] : (!fir.box<!fir.ptr<f32>>) -> !fir.ptr<f32>
430 ! CHECK: %[[ATTACH_F:.*]] = acc.attach varPtr(%[[BOX_ADDR_F]] : !fir.ptr<f32>) -> !fir.ptr<f32> {name = "f"}
431 ! CHECK: %[[BOX_G:.*]] = fir.load %[[DECLG]]#0 : !fir.ref<!fir.box<!fir.ptr<f32>>>
432 ! CHECK: %[[BOX_ADDR_G:.*]] = fir.box_addr %[[BOX_G]] : (!fir.box<!fir.ptr<f32>>) -> !fir.ptr<f32>
433 ! CHECK: %[[ATTACH_G:.*]] = acc.attach varPtr(%[[BOX_ADDR_G]] : !fir.ptr<f32>) -> !fir.ptr<f32> {name = "g"}
434 ! CHECK: acc.kernels {{.*}} dataOperands(%[[ATTACH_F]], %[[ATTACH_G]] : !fir.ptr<f32>, !fir.ptr<f32>) {
435 ! CHECK: acc.loop {{.*}} {
438 ! CHECK: acc.terminator
441 !$acc kernels loop seq
446 ! CHECK: acc.kernels {{.*}} {
447 ! CHECK: acc.loop {{.*}} {
449 ! CHECK-NEXT: } attributes {inclusiveUpperbound = array<i1: true>, seq = [#acc.device_type<none>]}
450 ! CHECK: acc.terminator
453 !$acc kernels loop auto
458 ! CHECK: acc.kernels {{.*}} {
459 ! CHECK: acc.loop {{.*}} {
461 ! CHECK-NEXT: } attributes {auto_ = [#acc.device_type<none>], inclusiveUpperbound = array<i1: true>}
462 ! CHECK: acc.terminator
465 !$acc kernels loop independent
470 ! CHECK: acc.kernels {{.*}} {
471 ! CHECK: acc.loop {{.*}} {
473 ! CHECK-NEXT: } attributes {inclusiveUpperbound = array<i1: true>, independent = [#acc.device_type<none>]}
474 ! CHECK: acc.terminator
477 !$acc kernels loop gang
482 ! CHECK: acc.kernels {{.*}} {
483 ! CHECK: acc.loop {{.*}} gang {{.*}} {
485 ! CHECK-NEXT: } attributes {inclusiveUpperbound = array<i1: true>}{{$}}
486 ! CHECK: acc.terminator
489 !$acc kernels loop gang(num: 8)
494 ! CHECK: acc.kernels {{.*}} {
495 ! CHECK: [[GANGNUM1:%.*]] = arith.constant 8 : i32
496 ! CHECK-NEXT: acc.loop {{.*}} gang({num=[[GANGNUM1]] : i32}) {{.*}} {
499 ! CHECK: acc.terminator
502 !$acc kernels loop gang(num: gangNum)
507 ! CHECK: acc.kernels {{.*}} {
508 ! CHECK: [[GANGNUM2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
509 ! CHECK-NEXT: acc.loop {{.*}} gang({num=[[GANGNUM2]] : i32}) {{.*}} {
512 ! CHECK: acc.terminator
515 !$acc kernels loop gang(num: gangNum, static: gangStatic)
520 ! CHECK: acc.kernels {{.*}} {
521 ! CHECK: acc.loop {{.*}} gang({num=%{{.*}} : i32, static=%{{.*}} : i32})
524 ! CHECK: acc.terminator
527 !$acc kernels loop vector
532 ! CHECK: acc.kernels {{.*}} {
533 ! CHECK: acc.loop {{.*}} vector {{.*}} {
535 ! CHECK-NEXT: } attributes {inclusiveUpperbound = array<i1: true>}{{$}}
536 ! CHECK: acc.terminator
539 !$acc kernels loop vector(128)
544 ! CHECK: acc.kernels {{.*}} {
545 ! CHECK: [[CONSTANT128:%.*]] = arith.constant 128 : i32
546 ! CHECK: acc.loop {{.*}} vector([[CONSTANT128]] : i32) {{.*}} {
549 ! CHECK: acc.terminator
552 !$acc kernels loop vector(vectorLength)
557 ! CHECK: acc.kernels {{.*}} {
558 ! CHECK: [[VECTORLENGTH:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
559 ! CHECK: acc.loop {{.*}} vector([[VECTORLENGTH]] : i32) {{.*}} {
562 ! CHECK: acc.terminator
565 !$acc kernels loop worker
570 ! CHECK: acc.kernels {{.*}} {
571 ! CHECK: acc.loop {{.*}} worker {{.*}} {
573 ! CHECK-NEXT: } attributes {inclusiveUpperbound = array<i1: true>}{{$}}
574 ! CHECK: acc.terminator
577 !$acc kernels loop worker(128)
582 ! CHECK: acc.kernels {{.*}} {
583 ! CHECK: [[WORKER128:%.*]] = arith.constant 128 : i32
584 ! CHECK: acc.loop {{.*}} worker([[WORKER128]] : i32) {{.*}} {
587 ! CHECK: acc.terminator
590 !$acc kernels loop collapse(2)
597 ! CHECK: acc.kernels {{.*}} {
598 ! CHECK: acc.loop {{.*}} {
600 ! CHECK-NEXT: } attributes {collapse = [2], collapseDeviceType = [#acc.device_type<none>], inclusiveUpperbound = array<i1: true, true>}
601 ! CHECK: acc.terminator
612 ! CHECK: acc.kernels {{.*}} {
613 ! CHECK: acc.loop {{.*}} {
614 ! CHECK: acc.loop {{.*}} {
619 ! CHECK: acc.terminator
622 !$acc kernels loop tile(2)
627 ! CHECK: acc.kernels {{.*}} {
628 ! CHECK: [[TILESIZE:%.*]] = arith.constant 2 : i32
629 ! CHECK: acc.loop {{.*}} tile({[[TILESIZE]] : i32}) {{.*}} {
632 ! CHECK: acc.terminator
635 !$acc kernels loop tile(*)
640 ! CHECK: acc.kernels {{.*}} {
641 ! CHECK: [[TILESIZEM1:%.*]] = arith.constant -1 : i32
642 ! CHECK: acc.loop {{.*}} tile({[[TILESIZEM1]] : i32}) {{.*}} {
645 ! CHECK: acc.terminator
648 !$acc kernels loop tile(2, 2)
655 ! CHECK: acc.kernels {{.*}} {
656 ! CHECK: [[TILESIZE1:%.*]] = arith.constant 2 : i32
657 ! CHECK: [[TILESIZE2:%.*]] = arith.constant 2 : i32
658 ! CHECK: acc.loop {{.*}} tile({[[TILESIZE1]] : i32, [[TILESIZE2]] : i32}) {{.*}} {
661 ! CHECK: acc.terminator
664 !$acc kernels loop tile(tileSize)
669 ! CHECK: acc.kernels {{.*}} {
670 ! CHECK: acc.loop {{.*}} tile({%{{.*}} : i32}) {{.*}} {
673 ! CHECK: acc.terminator
676 !$acc kernels loop tile(tileSize, tileSize)
683 ! CHECK: acc.kernels {{.*}} {
684 ! CHECK: acc.loop {{.*}} tile({%{{.*}} : i32, %{{.*}} : i32}) {{.*}} {
687 ! CHECK: acc.terminator
690 !$acc kernels loop reduction(+:reduction_r) reduction(*:reduction_i)
692 reduction_r
= reduction_r
+ a(i
)
696 ! CHECK: %[[COPYINREDR:.*]] = acc.copyin varPtr(%{{.*}} : !fir.ref<f32>) -> !fir.ref<f32> {dataClause = #acc<data_clause acc_reduction>, implicit = true, name = "reduction_r"}
697 ! CHECK: %[[COPYINREDI:.*]] = acc.copyin varPtr(%{{.*}} : !fir.ref<i32>) -> !fir.ref<i32> {dataClause = #acc<data_clause acc_reduction>, implicit = true, name = "reduction_i"}
698 ! CHECK: acc.kernels {{.*}} dataOperands(%[[COPYINREDR]], %[[COPYINREDI]] : !fir.ref<f32>, !fir.ref<i32>) {
699 ! CHECK: acc.loop {{.*}} reduction(@reduction_add_ref_f32 -> %{{.*}} : !fir.ref<f32>, @reduction_mul_ref_i32 -> %{{.*}} : !fir.ref<i32>) {{.*}} {
702 ! CHECK: acc.terminator
704 ! CHECK: acc.copyout accPtr(%[[COPYINREDR]] : !fir.ref<f32>) to varPtr(%{{.*}} : !fir.ref<f32>) {dataClause = #acc<data_clause acc_reduction>, implicit = true, name = "reduction_r"}
705 ! CHECK: acc.copyout accPtr(%[[COPYINREDI]] : !fir.ref<i32>) to varPtr(%{{.*}} : !fir.ref<i32>) {dataClause = #acc<data_clause acc_reduction>, implicit = true, name = "reduction_i"}