]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : extend API to get max devices at runtime (#2253)
authorRinne <redacted>
Wed, 19 Jul 2023 07:06:40 +0000 (15:06 +0800)
committerGitHub <redacted>
Wed, 19 Jul 2023 07:06:40 +0000 (10:06 +0300)
llama.cpp
llama.h

index fa3b7c03c547e4f67a7ec470f74d1692dcf724f6..3319b7023ee5f725fa1016c5902d731ed92a6d44 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -875,6 +875,10 @@ struct llama_model_quantize_params llama_model_quantize_default_params() {
     return result;
 }
 
+int llama_max_devices() {
+    return LLAMA_MAX_DEVICES;
+}
+
 bool llama_mmap_supported() {
     return llama_mmap::SUPPORTED;
 }
diff --git a/llama.h b/llama.h
index e744584f23fb3480268b2d90e88314c83ac09188..b676a383b31aa4f700adabf5b47c88d786d0d963 100644 (file)
--- a/llama.h
+++ b/llama.h
@@ -153,6 +153,8 @@ extern "C" {
         int32_t n_eval;
     };
 
+    LLAMA_API int llama_max_devices();
+
     LLAMA_API struct llama_context_params llama_context_default_params();
     LLAMA_API struct llama_model_quantize_params llama_model_quantize_default_params();