Skip to content

Commit cc4926a

Browse files
authored
[flang][cuda] Fix module registration (#113358)
1 parent 7191ced commit cc4926a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

flang/runtime/CUDA/registration.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ namespace Fortran::runtime::cuda {
1414

1515
extern "C" {
1616

17-
extern void **__cudaRegisterFatBinary(void *data);
17+
extern void **__cudaRegisterFatBinary(void *);
18+
extern void __cudaRegisterFatBinaryEnd(void *);
1819
extern void __cudaRegisterFunction(void **fatCubinHandle, const char *hostFun,
1920
char *deviceFun, const char *deviceName, int thread_limit, uint3 *tid,
2021
uint3 *bid, dim3 *bDim, dim3 *gDim, int *wSize);
2122

2223
void *RTDECL(CUFRegisterModule)(void *data) {
23-
return __cudaRegisterFatBinary(data);
24+
void **fatHandle{__cudaRegisterFatBinary(data)};
25+
__cudaRegisterFatBinaryEnd(fatHandle);
26+
return fatHandle;
2427
}
2528

2629
void RTDEF(CUFRegisterFunction)(void **module, const char *fct) {

0 commit comments

Comments
 (0)