18 #include <kvikio/shim/cuda_h_wrapper.hpp>
19 #include <kvikio/shim/utils.hpp>
32 decltype(cuInit)* Init{
nullptr};
33 decltype(cuMemHostAlloc)* MemHostAlloc{
nullptr};
34 decltype(cuMemFreeHost)* MemFreeHost{
nullptr};
35 decltype(cuMemcpyHtoDAsync)* MemcpyHtoDAsync{
nullptr};
36 decltype(cuMemcpyDtoHAsync)* MemcpyDtoHAsync{
nullptr};
37 decltype(cuPointerGetAttribute)* PointerGetAttribute{
nullptr};
38 decltype(cuPointerGetAttributes)* PointerGetAttributes{
nullptr};
39 decltype(cuCtxPushCurrent)* CtxPushCurrent{
nullptr};
40 decltype(cuCtxPopCurrent)* CtxPopCurrent{
nullptr};
41 decltype(cuCtxGetCurrent)* CtxGetCurrent{
nullptr};
42 decltype(cuMemGetAddressRange)* MemGetAddressRange{
nullptr};
43 decltype(cuGetErrorName)* GetErrorName{
nullptr};
44 decltype(cuGetErrorString)* GetErrorString{
nullptr};
45 decltype(cuDeviceGet)* DeviceGet{
nullptr};
46 decltype(cuDevicePrimaryCtxRetain)* DevicePrimaryCtxRetain{
nullptr};
47 decltype(cuDevicePrimaryCtxRelease)* DevicePrimaryCtxRelease{
nullptr};
48 decltype(cuStreamSynchronize)* StreamSynchronize{
nullptr};
49 decltype(cuStreamCreate)* StreamCreate{
nullptr};
50 decltype(cuStreamDestroy)* StreamDestroy{
nullptr};
57 void operator=(
cudaAPI const&) =
delete;
59 KVIKIO_EXPORT
static cudaAPI& instance();
69 #ifdef KVIKIO_CUDA_FOUND
Shim layer of the cuda C-API.
constexpr bool is_cuda_available()
Check if the CUDA library is available.