Skip to content

Commit dbfedc6

Browse files
authored
[Offload] Use newer CUDA API functions when dynamically loaded (#93057)
Summary: CUDA does its versioning by putting a redirection in the header so the API functions remain the same while the symbol changes. These weren't being used for some functions that required it in the dynamic cuda version. These functions have newer verisons that should be used. These are fairly old as far as I'm aware so we should be able to sweep backward compatibility under the rug.
1 parent c44fa3e commit dbfedc6

File tree

1 file changed

+9
-0
lines changed
  • offload/plugins-nextgen/cuda/dynamic_cuda

1 file changed

+9
-0
lines changed

offload/plugins-nextgen/cuda/dynamic_cuda/cuda.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
#include <cstddef>
1717
#include <cstdint>
1818

19+
#define cuDeviceTotalMem cuDeviceTotalMem_v2
20+
#define cuModuleGetGlobal cuModuleGetGlobal_v2
21+
#define cuMemGetInfo cuMemGetInfo_v2
22+
#define cuMemAlloc cuMemAlloc_v2
23+
#define cuMemFree cuMemFree_v2
24+
#define cuMemAllocHost cuMemAllocHost_v2
25+
#define cuDevicePrimaryCtxRelease cuDevicePrimaryCtxRelease_v2
26+
#define cuDevicePrimaryCtxSetFlags cuDevicePrimaryCtxSetFlags_v2
27+
1928
typedef int CUdevice;
2029
typedef uintptr_t CUdeviceptr;
2130
typedef struct CUmod_st *CUmodule;

0 commit comments

Comments
 (0)