summaryrefslogtreecommitdiff
path: root/llama.cpp
diff options
context:
space:
mode:
authorMasterYi1024 <39848311+MasterYi1024@users.noreply.github.com>2024-04-12 16:28:12 +0800
committerGitHub <noreply@github.com>2024-04-12 10:28:12 +0200
commitdee7f8d6928cc680cc969f7d93f98c3e24dcad41 (patch)
tree812b37d90e721ac008eb98b9dcde22a01ba07d07 /llama.cpp
parent81da18e71ccfc196d4516fbea5dc3a6a1f92dccb (diff)
Correct free memory and total memory. (#6630)
Co-authored-by: MasterYi <zouxiaoyi@kylinos.cn>
Diffstat (limited to 'llama.cpp')
-rw-r--r--llama.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llama.cpp b/llama.cpp
index 73ff6070..dad2c4fb 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;