[flang-commits] [flang] 51f7e98 - [flang][cuda] Crash if mode is not handled (#114842)
via flang-commits
flang-commits at lists.llvm.org
Mon Nov 4 11:47:23 PST 2024
Author: Valentin Clement (バレンタイン クレメン)
Date: 2024-11-04T11:47:19-08:00
New Revision: 51f7e98d59181ff024481eafd7a8532ae9dbce1b
URL: https://github.com/llvm/llvm-project/commit/51f7e98d59181ff024481eafd7a8532ae9dbce1b
DIFF: https://github.com/llvm/llvm-project/commit/51f7e98d59181ff024481eafd7a8532ae9dbce1b.diff
LOG: [flang][cuda] Crash if mode is not handled (#114842)
Added:
Modified:
flang/runtime/CUDA/memory.cpp
Removed:
################################################################################
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);
More information about the flang-commits
mailing list