[flang-commits] [flang] cc4926a - [flang][cuda] Fix module registration (#113358)
via flang-commits
flang-commits at lists.llvm.org
Tue Oct 22 12:26:13 PDT 2024
Author: Valentin Clement (バレンタイン クレメン)
Date: 2024-10-22T12:26:10-07:00
New Revision: cc4926a0699eb27dd1974ea0f521d64dcf897af4
URL: https://github.com/llvm/llvm-project/commit/cc4926a0699eb27dd1974ea0f521d64dcf897af4
DIFF: https://github.com/llvm/llvm-project/commit/cc4926a0699eb27dd1974ea0f521d64dcf897af4.diff
LOG: [flang][cuda] Fix module registration (#113358)
Added:
Modified:
flang/runtime/CUDA/registration.cpp
Removed:
################################################################################
diff --git a/flang/runtime/CUDA/registration.cpp b/flang/runtime/CUDA/registration.cpp
index aed275e964680e..e5d9503e95fd8f 100644
--- a/flang/runtime/CUDA/registration.cpp
+++ b/flang/runtime/CUDA/registration.cpp
@@ -14,13 +14,16 @@ namespace Fortran::runtime::cuda {
extern "C" {
-extern void **__cudaRegisterFatBinary(void *data);
+extern void **__cudaRegisterFatBinary(void *);
+extern void __cudaRegisterFatBinaryEnd(void *);
extern void __cudaRegisterFunction(void **fatCubinHandle, const char *hostFun,
char *deviceFun, const char *deviceName, int thread_limit, uint3 *tid,
uint3 *bid, dim3 *bDim, dim3 *gDim, int *wSize);
void *RTDECL(CUFRegisterModule)(void *data) {
- return __cudaRegisterFatBinary(data);
+ void **fatHandle{__cudaRegisterFatBinary(data)};
+ __cudaRegisterFatBinaryEnd(fatHandle);
+ return fatHandle;
}
void RTDEF(CUFRegisterFunction)(void **module, const char *fct) {
More information about the flang-commits
mailing list