Просмотр исходного кода

llama : extend API to get max devices at runtime (#2253)

Rinne 2 лет назад
Родитель
Сommit
294f424554
2 измененных файлов с 6 добавлено и 0 удалено
  1. 4 0
      llama.cpp
  2. 2 0
      llama.h

+ 4 - 0
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;
 }

+ 2 - 0
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();