Correct free memory and total memory. (#6630)

Co-authored-by: MasterYi <zouxiaoyi@kylinos.cn>
This commit is contained in:
MasterYi1024 2024-04-12 16:28:12 +08:00 committed by GitHub
parent 81da18e71c
commit dee7f8d692
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1638,17 +1638,17 @@ static size_t llama_get_device_memory(int device) {
#if defined(GGML_USE_CUDA)
size_t total;
size_t free;
ggml_backend_cuda_get_device_memory(device, &total, &free);
ggml_backend_cuda_get_device_memory(device, &free, &total);
return free;
#elif defined(GGML_USE_SYCL)
size_t total;
size_t free;
ggml_backend_sycl_get_device_memory(device, &total, &free);
ggml_backend_sycl_get_device_memory(device, &free, &total);
return free;
#elif defined(GGML_USE_VULKAN)
size_t total;
size_t free;
ggml_backend_vk_get_device_memory(device, &total, &free);
ggml_backend_vk_get_device_memory(device, &free, &total);
return free;
#else
return 1;