[flang-commits] [flang] 3d59e30 - [flang][cuda] Allow DO CONCURRENT in cuf kernel (#124190)

via flang-commits flang-commits at lists.llvm.org
Thu Jan 23 15:09:43 PST 2025


Author: Valentin Clement (バレンタイン クレメン)
Date: 2025-01-23T15:09:39-08:00
New Revision: 3d59e30cbcfea475594aaf1c69388c0503f846ef

URL: https://github.com/llvm/llvm-project/commit/3d59e30cbcfea475594aaf1c69388c0503f846ef
DIFF: https://github.com/llvm/llvm-project/commit/3d59e30cbcfea475594aaf1c69388c0503f846ef.diff

LOG: [flang][cuda] Allow DO CONCURRENT in cuf kernel (#124190)

Added: 
    

Modified: 
    flang/lib/Semantics/check-cuda.cpp
    flang/test/Semantics/cuf09.cuf

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/check-cuda.cpp b/flang/lib/Semantics/check-cuda.cpp
index f1bdb4f20a55cf..c85a84ea5527f0 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<parser::Block>(doConstruct->t);

diff  --git a/flang/test/Semantics/cuf09.cuf b/flang/test/Semantics/cuf09.cuf
index 06c9070fcbcd00..fda8938b8ffc0d 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


        


More information about the flang-commits mailing list