|
189 | 189 | ! CHECK: acc.yield %arg0 : !fir.box<!fir.array<?xi32>> |
190 | 190 | ! CHECK: } |
191 | 191 |
|
| 192 | +! CHECK-LABEL: acc.reduction.recipe @reduction_add_section_lb0.ub9xlb0.ub19_ref_10x20xi32 : !fir.ref<!fir.array<10x20xi32>> reduction_operator <add> init { |
| 193 | +! CHECK: fir.do_loop %arg1 = %c0 to %c19 step %c1 { |
| 194 | +! CHECK: fir.do_loop %arg2 = %c0_0 to %c9 step %c1_1 { |
| 195 | +! CHECK: } combiner { |
| 196 | +! CHECK: fir.do_loop %arg2 = %c0 to %c19 step %c1 { |
| 197 | +! CHECK: fir.do_loop %arg3 = %c0_0 to %c9 step %c1_1 { |
| 198 | +! CHECK: } |
| 199 | + |
192 | 200 | ! CHECK-LABEL: acc.reduction.recipe @reduction_mul_ref_z32 : !fir.ref<complex<f32>> reduction_operator <mul> init { |
193 | 201 | ! CHECK: ^bb0(%{{.*}}: !fir.ref<complex<f32>>): |
194 | 202 | ! CHECK: %[[REAL:.*]] = arith.constant 1.000000e+00 : f32 |
@@ -1167,6 +1175,29 @@ subroutine acc_reduction_add_static_slice(a) |
1167 | 1175 | ! CHECK: %[[RED:.*]] = acc.reduction varPtr(%[[DECLARG0]]#0 : !fir.ref<!fir.array<100xi32>>) bounds(%[[BOUND]]) -> !fir.ref<!fir.array<100xi32>> {name = "a(11:20)"} |
1168 | 1176 | ! CHECK: acc.parallel reduction(@reduction_add_section_lb10.ub19_ref_100xi32 -> %[[RED]] : !fir.ref<!fir.array<100xi32>>) |
1169 | 1177 |
|
| 1178 | +subroutine acc_reduction_add_static_slice_2d(a) |
| 1179 | + integer :: a(10,20) |
| 1180 | + !$acc parallel reduction(+:a(:10,:20)) |
| 1181 | + !$acc end parallel |
| 1182 | +end subroutine |
| 1183 | + |
| 1184 | +! CHECK-LABEL: func.func @_QPacc_reduction_add_static_slice_2d( |
| 1185 | +! CHECK-SAME: %[[ARG0:.*]]: !fir.ref<!fir.array<10x20xi32>> {fir.bindc_name = "a"}) |
| 1186 | +! CHECK: %[[C10:.*]] = arith.constant 10 : index |
| 1187 | +! CHECK: %[[C20:.*]] = arith.constant 20 : index |
| 1188 | +! CHECK: %[[DECLARG0:.*]]:2 = hlfir.declare %[[ARG0]] |
| 1189 | +! CHECK: %[[LB:.*]] = arith.constant 0 : index |
| 1190 | +! CHECK: %[[C1:.*]] = arith.constant 1 : index |
| 1191 | +! CHECK: %[[UB9:.*]] = arith.constant 9 : index |
| 1192 | +! CHECK: %[[STRIDE1:.*]] = arith.constant 10 : index |
| 1193 | +! CHECK: %[[BOUND0:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB9]] : index) extent(%[[C10]] : index) stride(%[[C1]] : index) startIdx(%[[C1]] : index) |
| 1194 | +! CHECK: %[[UB19:.*]] = arith.constant 19 : index |
| 1195 | +! CHECK: %[[BOUND1:.*]] = acc.bounds lowerbound(%[[LB]] : index) upperbound(%[[UB19]] : index) extent(%[[C20]] : index) |
| 1196 | +! stride(%[[STRIDE1]] : index) startIdx(%[[C1]] : index) |
| 1197 | +! CHECK: %[[RED:.*]] = acc.reduction varPtr(%[[DECLARG0]]#0 : !fir.ref<!fir.array<10x20xi32>>) bounds(%[[BOUND0]], %[[BOUND1]]) -> |
| 1198 | +! !fir.ref<!fir.array<10x20xi32>> {name = "a(:10,:20)"} |
| 1199 | +! CHECK: acc.parallel reduction(@reduction_add_section_lb0.ub9xlb0.ub19_ref_10x20xi32 -> %[[RED]] : !fir.ref<!fir.array<10x20xi32>>) |
| 1200 | + |
1170 | 1201 | subroutine acc_reduction_add_dynamic_extent_add(a) |
1171 | 1202 | integer :: a(:) |
1172 | 1203 | !$acc parallel reduction(+:a) |
|
0 commit comments