File tree Expand file tree Collapse file tree 5 files changed +63
-1
lines changed Expand file tree Collapse file tree 5 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,17 @@ template <typename D> class NoBranchingEnforce {
79
79
break ;
80
80
}
81
81
} else if constexpr (std::is_same_v<D, llvm::acc::Directive>) {
82
- return ; // OpenACC construct do not need check for unlabelled CYCLES
82
+ switch ((llvm::acc::Directive)currentDirective_) {
83
+ // exclude loop directives which do not need a check for unlabelled
84
+ // CYCLES
85
+ case llvm::acc::Directive::ACCD_loop:
86
+ case llvm::acc::Directive::ACCD_kernels_loop:
87
+ case llvm::acc::Directive::ACCD_parallel_loop:
88
+ case llvm::acc::Directive::ACCD_serial_loop:
89
+ return ;
90
+ default :
91
+ break ;
92
+ }
83
93
}
84
94
CheckConstructNameBranching (" CYCLE" );
85
95
}
Original file line number Diff line number Diff line change @@ -187,6 +187,19 @@ program openacc_data_validity
187
187
! $acc data copy(aa) device_type(default) wait
188
188
! $acc end data
189
189
190
+ do i = 1 , 100
191
+ ! $acc data copy(aa)
192
+ ! ERROR: CYCLE to construct outside of DATA construct is not allowed
193
+ if (i == 10 ) cycle
194
+ ! $acc end data
195
+ end do
196
+
197
+ ! $acc data copy(aa)
198
+ do i = 1 , 100
199
+ if (i == 10 ) cycle
200
+ end do
201
+ ! $acc end data
202
+
190
203
end program openacc_data_validity
191
204
192
205
module mod1
Original file line number Diff line number Diff line change @@ -144,4 +144,17 @@ program openacc_kernels_validity
144
144
end do
145
145
! $acc end kernels
146
146
147
+ do i = 1 , 100
148
+ ! $acc kernels
149
+ ! ERROR: CYCLE to construct outside of KERNELS construct is not allowed
150
+ if (i == 10 ) cycle
151
+ ! $acc end kernels
152
+ end do
153
+
154
+ ! $acc kernels
155
+ do i = 1 , 100
156
+ if (i == 10 ) cycle
157
+ end do
158
+ ! $acc end kernels
159
+
147
160
end program openacc_kernels_validity
Original file line number Diff line number Diff line change @@ -142,4 +142,17 @@ program openacc_parallel_validity
142
142
end do
143
143
! $acc end parallel
144
144
145
+ do i = 1 , 100
146
+ ! $acc parallel
147
+ ! ERROR: CYCLE to construct outside of PARALLEL construct is not allowed
148
+ if (i == 10 ) cycle
149
+ ! $acc end parallel
150
+ end do
151
+
152
+ ! $acc parallel
153
+ do i = 1 , 100
154
+ if (i == 10 ) cycle
155
+ end do
156
+ ! $acc end parallel
157
+
145
158
end program openacc_parallel_validity
Original file line number Diff line number Diff line change @@ -166,4 +166,17 @@ program openacc_serial_validity
166
166
end do
167
167
! $acc end serial
168
168
169
+ do i = 1 , 100
170
+ ! $acc serial
171
+ ! ERROR: CYCLE to construct outside of SERIAL construct is not allowed
172
+ if (i == 10 ) cycle
173
+ ! $acc end serial
174
+ end do
175
+
176
+ ! $acc serial
177
+ do i = 1 , 100
178
+ if (i == 10 ) cycle
179
+ end do
180
+ ! $acc end serial
181
+
169
182
end program openacc_serial_validity
You can’t perform that action at this time.
0 commit comments