[flang-commits] [flang] [flang][cuda] Fix module registration (PR #113358)
via flang-commits
flang-commits at lists.llvm.org
Tue Oct 22 11:44:41 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-runtime
Author: Valentin Clement (バレンタイン クレメン) (clementval)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/113358.diff
1 Files Affected:
- (modified) flang/runtime/CUDA/registration.cpp (+5-2)
``````````diff
diff --git a/flang/runtime/CUDA/registration.cpp b/flang/runtime/CUDA/registration.cpp
index aed275e964680e..b83a43efaf500b 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) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/113358
More information about the flang-commits
mailing list