Skip to content

Conversation

@clementval
Copy link
Contributor

No description provided.

@llvmbot llvmbot added flang:runtime flang Flang issues not falling into any other category labels Nov 4, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 4, 2024

@llvm/pr-subscribers-flang-runtime

Author: Valentin Clement (バレンタイン クレメン) (clementval)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/114842.diff

1 Files Affected:

  • (modified) flang/runtime/CUDA/memory.cpp (+3-1)
diff --git a/flang/runtime/CUDA/memory.cpp b/flang/runtime/CUDA/memory.cpp
index daf1db684a3d2e..5aa7ac5c3cccd1 100644
--- a/flang/runtime/CUDA/memory.cpp
+++ b/flang/runtime/CUDA/memory.cpp
@@ -111,7 +111,6 @@ void RTDEF(CUFDataTransferPtrDesc)(void *addr, Descriptor *desc,
 
 void RTDECL(CUFDataTransferDescDesc)(Descriptor *dstDesc, Descriptor *srcDesc,
     unsigned mode, const char *sourceFile, int sourceLine) {
-  Terminator terminator{sourceFile, sourceLine};
   MemmoveFct memmoveFct;
   if (mode == kHostToDevice) {
     memmoveFct = &MemmoveHostToDevice;
@@ -119,6 +118,9 @@ void RTDECL(CUFDataTransferDescDesc)(Descriptor *dstDesc, Descriptor *srcDesc,
     memmoveFct = &MemmoveDeviceToHost;
   } else if (mode == kDeviceToDevice) {
     memmoveFct = &MemmoveDeviceToDevice;
+  } else {
+    Terminator terminator{sourceFile, sourceLine};
+    terminator.Crash("host to host copy not supported");
   }
   Fortran::runtime::Assign(
       *dstDesc, *srcDesc, terminator, MaybeReallocate, memmoveFct);

@clementval clementval changed the title [flang][cuda] Crash if mode is not recognized [flang][cuda] Crash if mode is not handled Nov 4, 2024
@clementval clementval merged commit 51f7e98 into llvm:main Nov 4, 2024
9 of 10 checks passed
@clementval clementval deleted the cuf_desc_desc_error branch November 4, 2024 19:47
PhilippRados pushed a commit to PhilippRados/llvm-project that referenced this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:runtime flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants