Skip to content

Commit 3d59e30

Browse files
authored
[flang][cuda] Allow DO CONCURRENT in cuf kernel (#124190)
1 parent 4065d98 commit 3d59e30

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

flang/lib/Semantics/check-cuda.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ void CUDAChecker::Enter(const parser::SeparateModuleSubprogram &x) {
520520

521521
static int DoConstructTightNesting(
522522
const parser::DoConstruct *doConstruct, const parser::Block *&innerBlock) {
523-
if (!doConstruct || !doConstruct->IsDoNormal()) {
523+
if (!doConstruct ||
524+
(!doConstruct->IsDoNormal() && !doConstruct->IsDoConcurrent())) {
524525
return 0;
525526
}
526527
innerBlock = &std::get<parser::Block>(doConstruct->t);

flang/test/Semantics/cuf09.cuf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ program main
130130
do
131131
exit
132132
end do
133-
!ERROR: !$CUF KERNEL DO (1) must be followed by a DO construct with tightly nested outer levels of counted DO loops
134133
!$cuf kernel do <<< 1, 2 >>>
135134
do concurrent (j=1:10)
136135
end do

0 commit comments

Comments
 (0)