Add an api to get max devices at runtime.

This commit is contained in:
Yaohui Liu 2023-07-17 22:59:54 +08:00
parent b7647436cc
commit f0a8ba0414
No known key found for this signature in database
GPG key ID: E86D01E1809BD23E
2 changed files with 6 additions and 0 deletions

View file

@ -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;
} }

View file

@ -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();