@@ -37,6 +37,30 @@ struct CUDAKernelTy;
3737struct CUDADeviceTy ;
3838struct CUDAPluginTy ;
3939
40+ #if (defined(CUDART_VERSION) && (CUDART_VERSION < 11000))
41+ // / Forward declarations for all Virtual Memory Management
42+ // / related data structures and functions. This is necessary
43+ // / for older cuda versions.
44+ typedef void *CUmemGenericAllocationHandle;
45+ typedef void *CUmemAllocationProp;
46+ typedef void *CUmemAccessDesc;
47+ typedef void *CUmemAllocationGranularity_flags;
48+ CUresult cuMemAddressReserve (CUdeviceptr *ptr, size_t size, size_t alignment,
49+ CUdeviceptr addr, unsigned long long flags) {}
50+ CUresult cuMemMap (CUdeviceptr ptr, size_t size, size_t offset,
51+ CUmemGenericAllocationHandle handle,
52+ unsigned long long flags) {}
53+ CUresult cuMemCreate (CUmemGenericAllocationHandle *handle, size_t size,
54+ const CUmemAllocationProp *prop,
55+ unsigned long long flags) {}
56+ CUresult cuMemSetAccess (CUdeviceptr ptr, size_t size,
57+ const CUmemAccessDesc *desc, size_t count) {}
58+ CUresult
59+ cuMemGetAllocationGranularity (size_t *granularity,
60+ const CUmemAllocationProp *prop,
61+ CUmemAllocationGranularity_flags option) {}
62+ #endif
63+
4064// / Class implementing the CUDA device images properties.
4165struct CUDADeviceImageTy : public DeviceImageTy {
4266 // / Create the CUDA image with the id and the target image pointer.
@@ -518,7 +542,13 @@ struct CUDADeviceTy : public GenericDeviceTy {
518542 }
519543
520544 // / CUDA support VA management
521- bool supportVAManagement () const override { return true ; }
545+ bool supportVAManagement () const override {
546+ #if (defined(CUDART_VERSION) && (CUDART_VERSION >= 11000))
547+ return true ;
548+ #else
549+ return false ;
550+ #endif
551+ }
522552
523553 // / Allocates \p RSize bytes (rounded up to page size) and hints the cuda
524554 // / driver to map it to \p VAddr. The obtained address is stored in \p Addr.
0 commit comments