From b815c046f66b328b5efeacee3485b5497d120416 Mon Sep 17 00:00:00 2001 From: Valentin Clement Date: Thu, 23 Jan 2025 12:54:12 -0800 Subject: [PATCH] [flang][cuda] Allow DO CONCURRENT in cuf kernel --- flang/lib/Semantics/check-cuda.cpp | 3 ++- flang/test/Semantics/cuf09.cuf | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flang/lib/Semantics/check-cuda.cpp b/flang/lib/Semantics/check-cuda.cpp index d8a5639227648..3878fa8468d69 100644 --- a/flang/lib/Semantics/check-cuda.cpp +++ b/flang/lib/Semantics/check-cuda.cpp @@ -520,7 +520,8 @@ void CUDAChecker::Enter(const parser::SeparateModuleSubprogram &x) { static int DoConstructTightNesting( const parser::DoConstruct *doConstruct, const parser::Block *&innerBlock) { - if (!doConstruct || !doConstruct->IsDoNormal()) { + if (!doConstruct || + (!doConstruct->IsDoNormal() && !doConstruct->IsDoConcurrent())) { return 0; } innerBlock = &std::get(doConstruct->t); diff --git a/flang/test/Semantics/cuf09.cuf b/flang/test/Semantics/cuf09.cuf index 06c9070fcbcd0..fda8938b8ffc0 100644 --- a/flang/test/Semantics/cuf09.cuf +++ b/flang/test/Semantics/cuf09.cuf @@ -130,7 +130,6 @@ program main do exit end do - !ERROR: !$CUF KERNEL DO (1) must be followed by a DO construct with tightly nested outer levels of counted DO loops !$cuf kernel do <<< 1, 2 >>> do concurrent (j=1:10) end do