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 Oct 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 22, 2024

@llvm/pr-subscribers-flang-runtime

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

Changes

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

1 Files Affected:

  • (modified) flang/runtime/CUDA/registration.cpp (+5-2)
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) {

@github-actions
Copy link

github-actions bot commented Oct 22, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@clementval clementval merged commit cc4926a into main Oct 22, 2024
3 of 5 checks passed
@clementval clementval deleted the users/clementval/modreg branch October 22, 2024 19:26
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.

4 participants