@@ -37,6 +37,30 @@ struct CUDAKernelTy;
37
37
struct CUDADeviceTy ;
38
38
struct CUDAPluginTy ;
39
39
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
+
40
64
// / Class implementing the CUDA device images properties.
41
65
struct CUDADeviceImageTy : public DeviceImageTy {
42
66
// / Create the CUDA image with the id and the target image pointer.
@@ -518,7 +542,13 @@ struct CUDADeviceTy : public GenericDeviceTy {
518
542
}
519
543
520
544
// / 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
+ }
522
552
523
553
// / Allocates \p RSize bytes (rounded up to page size) and hints the cuda
524
554
// / driver to map it to \p VAddr. The obtained address is stored in \p Addr.
0 commit comments