Explorar el Código

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

Rinne hace 2 años
padre
commit
294f424554
Se han modificado 2 ficheros con 6 adiciones y 0 borrados
  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;
     return result;
 }
 }
 
 
+int llama_max_devices() {
+    return LLAMA_MAX_DEVICES;
+}
+
 bool llama_mmap_supported() {
 bool llama_mmap_supported() {
     return llama_mmap::SUPPORTED;
     return llama_mmap::SUPPORTED;
 }
 }

+ 2 - 0
llama.h

@@ -153,6 +153,8 @@ extern "C" {
         int32_t n_eval;
         int32_t n_eval;
     };
     };
 
 
+    LLAMA_API int llama_max_devices();
+
     LLAMA_API struct llama_context_params llama_context_default_params();
     LLAMA_API struct llama_context_params llama_context_default_params();
     LLAMA_API struct llama_model_quantize_params llama_model_quantize_default_params();
     LLAMA_API struct llama_model_quantize_params llama_model_quantize_default_params();