[flang][cuda] Add CUFRegisterManagedVariable runtime entry for __cudaRegisterManagedVar (#188124)
Add CUFRegisterManagedVariable runtime wrapper in flang-rt that calls __cudaRegisterManagedVar. This is preparation for supporting non-allocatable managed variables. No functional change -- nothing calls this yet.
This commit is contained in:
parent
2f1e0d14f4
commit
c0634cbb07
@ -24,6 +24,9 @@ extern void __cudaRegisterFunction(void **fatCubinHandle, const char *hostFun,
|
||||
extern void __cudaRegisterVar(void **fatCubinHandle, char *hostVar,
|
||||
const char *deviceAddress, const char *deviceName, int ext, size_t size,
|
||||
int constant, int global);
|
||||
extern void __cudaRegisterManagedVar(void **fatCubinHandle,
|
||||
void **hostVarPtrAddress, char *deviceAddress, const char *deviceName,
|
||||
int ext, size_t size, int constant, int global);
|
||||
|
||||
void *RTDECL(CUFRegisterModule)(void *data) {
|
||||
void **fatHandle{__cudaRegisterFatBinary(data)};
|
||||
@ -42,6 +45,11 @@ void RTDEF(CUFRegisterVariable)(
|
||||
__cudaRegisterVar(module, varSym, varName, varName, 0, size, 0, 0);
|
||||
}
|
||||
|
||||
void RTDEF(CUFRegisterManagedVariable)(
|
||||
void **module, void **varSym, const char *varName, int64_t size) {
|
||||
__cudaRegisterManagedVar(module, varSym, varName, varName, 0, size, 0, 0);
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
} // namespace Fortran::runtime::cuda
|
||||
|
||||
@ -28,6 +28,10 @@ void RTDECL(CUFRegisterFunction)(
|
||||
void RTDECL(CUFRegisterVariable)(
|
||||
void **module, char *varSym, const char *varName, int64_t size);
|
||||
|
||||
/// Register a managed variable.
|
||||
void RTDECL(CUFRegisterManagedVariable)(
|
||||
void **module, void **varSym, const char *varName, int64_t size);
|
||||
|
||||
} // extern "C"
|
||||
|
||||
} // namespace Fortran::runtime::cuda
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user