1
1
! RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | FileCheck %s --check-prefixes HOST
2
- ! RUN: %flang_fc1 -emit-fir -fopenmp -fopenmp-is-target-device %s -o - | FileCheck %s --check-prefixes DEVICE
3
2
4
- ! DEVICE-LABEL: func.func @_QPread_write_section_omp_outline_0(
5
- ! DEVICE-SAME: %[[ARG0:.*]]: !fir.ref<i32>, %[[ARG1:.*]]: !fir.ref<!fir.array<10xi32>>, %[[ARG2:.*]]: !fir.ref<!fir.array<10xi32>>) attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, omp.outline_parent_name = "_QPread_write_section"} {
6
- ! DEVICE: %[[C1:.*]] = arith.constant 1 : index
7
- ! DEVICE: %[[C2:.*]] = arith.constant 4 : index
8
- ! DEVICE: %[[C3:.*]] = arith.constant 1 : index
9
- ! DEVICE: %[[C4:.*]] = arith.constant 1 : index
10
- ! DEVICE: %[[BOUNDS0:.*]] = omp.bounds lower_bound(%[[C1]] : index) upper_bound(%[[C2]] : index) stride(%[[C4]] : index) start_idx(%[[C4]] : index)
11
- ! DEVICE: %[[MAP0:.*]] = omp.map_info var_ptr(%[[ARG1]] : !fir.ref<!fir.array<10xi32>>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS0]]) -> !fir.ref<!fir.array<10xi32>> {name = "sp_read(2:5)"}
12
- ! DEVICE: %[[C5:.*]] = arith.constant 1 : index
13
- ! DEVICE: %[[C6:.*]] = arith.constant 4 : index
14
- ! DEVICE: %[[C7:.*]] = arith.constant 1 : index
15
- ! DEVICE: %[[C8:.*]] = arith.constant 1 : index
16
- ! DEVICE: %[[BOUNDS1:.*]] = omp.bounds lower_bound(%[[C5]] : index) upper_bound(%[[C6]] : index) stride(%[[C8]] : index) start_idx(%[[C8]] : index)
17
- ! DEVICE: %[[MAP1:.*]] = omp.map_info var_ptr(%[[ARG2]] : !fir.ref<!fir.array<10xi32>>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS1]]) -> !fir.ref<!fir.array<10xi32>> {name = "sp_write(2:5)"}
18
- ! DEVICE: omp.target map_entries(%[[MAP0]], %[[MAP1]] : !fir.ref<!fir.array<10xi32>>, !fir.ref<!fir.array<10xi32>>) {
19
3
20
4
! HOST-LABEL: func.func @_QPread_write_section() {
21
5
! HOST: %0 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFread_write_sectionEi"}
@@ -47,17 +31,6 @@ end subroutine read_write_section
47
31
48
32
module assumed_array_routines
49
33
contains
50
- ! DEVICE-LABEL: func.func @_QMassumed_array_routinesPassumed_shape_array_omp_outline_0(
51
- ! DEVICE-SAME: %[[ARG0:.*]]: !fir.ref<i32>, %[[ARG1:.*]]: !fir.box<!fir.array<?xi32>>) attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, omp.outline_parent_name = "_QMassumed_array_routinesPassumed_shape_array"} {
52
- ! DEVICE: %[[C0:.*]] = arith.constant 1 : index
53
- ! DEVICE: %[[C1:.*]] = arith.constant 4 : index
54
- ! DEVICE: %[[C2:.*]] = arith.constant 0 : index
55
- ! DEVICE: %[[C3:.*]]:3 = fir.box_dims %[[ARG1]], %[[C2]] : (!fir.box<!fir.array<?xi32>>, index) -> (index, index, index)
56
- ! DEVICE: %[[C4:.*]] = arith.constant 1 : index
57
- ! DEVICE: %[[BOUNDS:.*]] = omp.bounds lower_bound(%[[C0]] : index) upper_bound(%[[C1]] : index) stride(%[[C3]]#2 : index) start_idx(%[[C4]] : index) {stride_in_bytes = true}
58
- ! DEVICE: %[[ARGADDR:.*]] = fir.box_addr %[[ARG1]] : (!fir.box<!fir.array<?xi32>>) -> !fir.ref<!fir.array<?xi32>>
59
- ! DEVICE: %[[MAP:.*]] = omp.map_info var_ptr(%[[ARGADDR]] : !fir.ref<!fir.array<?xi32>>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS]]) -> !fir.ref<!fir.array<?xi32>> {name = "arr_read_write(2:5)"}
60
- ! DEVICE: omp.target map_entries(%[[MAP]] : !fir.ref<!fir.array<?xi32>>) {
61
34
62
35
! HOST-LABEL: func.func @_QMassumed_array_routinesPassumed_shape_array(
63
36
! HOST-SAME: %[[ARG0:.*]]: !fir.box<!fir.array<?xi32>> {fir.bindc_name = "arr_read_write"}) {
@@ -81,16 +54,6 @@ subroutine assumed_shape_array(arr_read_write)
81
54
! $omp end target
82
55
end subroutine assumed_shape_array
83
56
84
- ! DEVICE-LABEL: func.func @_QMassumed_array_routinesPassumed_size_array_omp_outline_0(
85
- ! DEVICE-SAME: %[[ARG0:.*]]: !fir.ref<i32>, %[[ARG1:.*]]: !fir.ref<!fir.array<?xi32>>) attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, omp.outline_parent_name = "_QMassumed_array_routinesPassumed_size_array"} {
86
- ! DEVICE: %[[C0:.*]] = arith.constant 1 : index
87
- ! DEVICE: %[[C1:.*]] = arith.constant 4 : index
88
- ! DEVICE: %[[C2:.*]] = arith.constant 1 : index
89
- ! DEVICE: %[[C3:.*]] = arith.constant 1 : index
90
- ! DEVICE: %[[BOUNDS:.*]] = omp.bounds lower_bound(%[[C0]] : index) upper_bound(%[[C1]] : index) stride(%[[C3]] : index) start_idx(%[[C3]] : index)
91
- ! DEVICE: %[[MAP:.*]] = omp.map_info var_ptr(%[[ARG1]] : !fir.ref<!fir.array<?xi32>>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS]]) -> !fir.ref<!fir.array<?xi32>> {name = "arr_read_write(2:5)"}
92
- ! DEVICE: omp.target map_entries(%[[MAP]] : !fir.ref<!fir.array<?xi32>>) {
93
-
94
57
! HOST-LABEL: func.func @_QMassumed_array_routinesPassumed_size_array(
95
58
! HOST-SAME: %[[ARG0:.*]]: !fir.ref<!fir.array<?xi32>> {fir.bindc_name = "arr_read_write"}) {
96
59
! HOST: %[[ALLOCA:.*]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QMassumed_array_routinesFassumed_size_arrayEi"}
0 commit comments