Skip to content

Commit

Permalink
Don't use macros for cuda driver functions (#516)
Browse files Browse the repository at this point in the history
Don't use macros for CUDA driver functions, since that does not play nice with `decltype()`. Revert to using type-erased stubs.

Authors:
  - Jacob Faibussowitsch (https://github.com/Jacobfaib)

Approvers:
  - Mads R. B. Kristensen (https://github.com/madsbk)

URL: #516
  • Loading branch information
Jacobfaib authored Oct 25, 2024
1 parent 9b077e5 commit dde7115
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions cpp/include/kvikio/shim/cuda_h_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ using CUstream = struct CUstream_st*;
#define CU_MEMHOSTREGISTER_PORTABLE 0
#define CU_STREAM_DEFAULT 0

#define cuInit(...) ((CUresult)CUDA_SUCCESS)
#define cuMemHostAlloc(...) ((CUresult)CUDA_SUCCESS)
#define cuMemFreeHost(...) ((CUresult)CUDA_SUCCESS)
#define cuMemcpyHtoDAsync(...) ((CUresult)CUDA_SUCCESS)
#define cuMemcpyDtoHAsync(...) ((CUresult)CUDA_SUCCESS)
#define cuPointerGetAttribute(...) ((CUresult)CUDA_SUCCESS)
#define cuPointerGetAttributes(...) ((CUresult)CUDA_SUCCESS)
#define cuCtxPushCurrent(...) ((CUresult)CUDA_SUCCESS)
#define cuCtxPopCurrent(...) ((CUresult)CUDA_SUCCESS)
#define cuCtxGetCurrent(...) ((CUresult)CUDA_SUCCESS)
#define cuMemGetAddressRange(...) ((CUresult)CUDA_SUCCESS)
#define cuGetErrorName(...) ((CUresult)CUDA_SUCCESS)
#define cuGetErrorString(...) ((CUresult)CUDA_SUCCESS)
#define cuDeviceGet(...) ((CUresult)CUDA_SUCCESS)
#define cuDevicePrimaryCtxRetain(...) ((CUresult)CUDA_SUCCESS)
#define cuDevicePrimaryCtxRelease(...) ((CUresult)CUDA_SUCCESS)
#define cuStreamCreate(...) ((CUresult)CUDA_SUCCESS)
#define cuStreamDestroy(...) ((CUresult)CUDA_SUCCESS)
#define cuStreamSynchronize(...) ((CUresult)CUDA_SUCCESS)
CUresult cuInit(...);
CUresult cuMemHostAlloc(...);
CUresult cuMemFreeHost(...);
CUresult cuMemcpyHtoDAsync(...);
CUresult cuMemcpyDtoHAsync(...);
CUresult cuPointerGetAttribute(...);
CUresult cuPointerGetAttributes(...);
CUresult cuCtxPushCurrent(...);
CUresult cuCtxPopCurrent(...);
CUresult cuCtxGetCurrent(...);
CUresult cuMemGetAddressRange(...);
CUresult cuGetErrorName(...);
CUresult cuGetErrorString(...);
CUresult cuDeviceGet(...);
CUresult cuDevicePrimaryCtxRetain(...);
CUresult cuDevicePrimaryCtxRelease(...);
CUresult cuStreamCreate(...);
CUresult cuStreamDestroy(...);
CUresult cuStreamSynchronize(...);

#endif

0 comments on commit dde7115

Please sign in to comment.