Skip to content

Commit c686147

Browse files
committed
More backwards compatibility
1 parent bb21937 commit c686147

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

interfaces/cuda/Copy.cu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,23 @@ void ConcreteAPI::prefetchUnifiedMemTo(Destination type, const void *devPtr, siz
7575
cudaMemLocation location{};
7676
if (type == Destination::Host) {
7777
location.id = cudaCpuDeviceId;
78+
#if CUDART_VERSION >= 13000
7879
location.type = cudaMemLocationTypeHost;
80+
#endif
7981
}
8082
else if (allowedConcurrentManagedAccess) {
8183
location.id = currentDeviceId;
84+
#if CUDART_VERSION >= 13000
8285
location.type = cudaMemLocationTypeDevice;
86+
#endif
8387
}
8488

8589
cudaMemPrefetchAsync(devPtr,
8690
count,
8791
#if CUDART_VERSION >= 13000
8892
location, 0,
8993
#else
90-
location.type,
94+
location.id,
9195
#endif
9296
stream);
9397
CHECK_ERR;

interfaces/cuda/Memory.cu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,22 @@ void *ConcreteAPI::allocUnifiedMem(size_t size, bool compress, Destination hint)
100100
cudaMemLocation location{};
101101
if (hint == Destination::Host) {
102102
location.id = cudaCpuDeviceId;
103+
#if CUDART_VERSION >= 13000
103104
location.type = cudaMemLocationTypeHost;
105+
#endif
104106
}
105107
else if (allowedConcurrentManagedAccess) {
106108
location.id = currentDeviceId;
109+
#if CUDART_VERSION >= 13000
107110
location.type = cudaMemLocationTypeDevice;
111+
#endif
108112
}
109113

110114
cudaMemAdvise(devPtr, size, cudaMemAdviseSetPreferredLocation,
111115
#if CUDART_VERSION >= 13000
112116
location
113117
#else
114-
location.type
118+
location.id
115119
#endif
116120
);
117121
CHECK_ERR;

0 commit comments

Comments
 (0)