From dee7f8d6928cc680cc969f7d93f98c3e24dcad41 Mon Sep 17 00:00:00 2001 From: MasterYi1024 <39848311+MasterYi1024@users.noreply.github.com> Date: Fri, 12 Apr 2024 16:28:12 +0800 Subject: [PATCH] Correct free memory and total memory. (#6630) Co-authored-by: MasterYi --- llama.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llama.cpp b/llama.cpp index 73ff60706..dad2c4fbf 100644 --- a/llama.cpp +++ b/llama.cpp @@ -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;