@@ -152,7 +152,7 @@ static ggml_cuda_device_info ggml_cuda_init() {
152152 for (int id = 0 ; id < info.device_count ; ++id) {
153153 int device_vmm = 0 ;
154154
155- #if ! defined(GGML_CUDA_NO_VMM )
155+ #if defined(GGML_USE_VMM )
156156 CUdevice device;
157157 CU_CHECK (cuDeviceGet (&device, id));
158158 CU_CHECK (cuDeviceGetAttribute (&device_vmm, CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED, device));
@@ -164,7 +164,7 @@ static ggml_cuda_device_info ggml_cuda_init() {
164164 alloc_prop.location .id = id;
165165 CU_CHECK (cuMemGetAllocationGranularity (&info.devices [id].vmm_granularity , &alloc_prop, CU_MEM_ALLOC_GRANULARITY_RECOMMENDED));
166166 }
167- #endif // ! defined(GGML_CUDA_NO_VMM )
167+ #endif // defined(GGML_USE_VMM )
168168 info.devices [id].vmm = !!device_vmm;
169169
170170 cudaDeviceProp prop;
@@ -300,7 +300,7 @@ struct ggml_cuda_pool_leg : public ggml_cuda_pool {
300300};
301301
302302// pool with virtual memory
303- #if ! defined(GGML_CUDA_NO_VMM )
303+ #if defined(GGML_USE_VMM )
304304struct ggml_cuda_pool_vmm : public ggml_cuda_pool {
305305 static const size_t CUDA_POOL_VMM_MAX_SIZE = 1ull << 35 ; // 32 GB
306306
@@ -408,14 +408,14 @@ struct ggml_cuda_pool_vmm : public ggml_cuda_pool {
408408 GGML_ASSERT (ptr == (void *) ((char *)(pool_addr) + pool_used));
409409 }
410410};
411- #endif // ! defined(GGML_CUDA_NO_VMM )
411+ #endif // defined(GGML_USE_VMM )
412412
413413std::unique_ptr<ggml_cuda_pool> ggml_backend_cuda_context::new_pool_for_device (int device) {
414- #if ! defined(GGML_CUDA_NO_VMM )
414+ #if defined(GGML_USE_VMM )
415415 if (ggml_cuda_info ().devices [device].vmm ) {
416416 return std::unique_ptr<ggml_cuda_pool>(new ggml_cuda_pool_vmm (device));
417417 }
418- #endif // ! defined(GGML_CUDA_NO_VMM )
418+ #endif // defined(GGML_USE_VMM )
419419 return std::unique_ptr<ggml_cuda_pool>(new ggml_cuda_pool_leg (device));
420420}
421421
@@ -3250,7 +3250,7 @@ static ggml_backend_feature * ggml_backend_cuda_get_features(ggml_backend_reg_t
32503250 features.push_back ({ " FORCE_CUBLAS" , " 1" });
32513251 #endif
32523252
3253- #ifdef GGML_CUDA_NO_VMM
3253+ #ifndef GGML_USE_VMM
32543254 features.push_back ({ " NO_VMM" , " 1" });
32553255 #endif
32563256
0 commit comments