From: Georgi Gerganov Date: Thu, 25 Jul 2024 09:37:42 +0000 (+0300) Subject: ggml : add and use ggml_cpu_has_llamafile() (llama/8664) X-Git-Tag: upstream/0.0.1642~498 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=79a641a6170cfffc518aa807237132b70ebef018;p=pkg%2Fggml%2Fsources%2Fggml ggml : add and use ggml_cpu_has_llamafile() (llama/8664) --- diff --git a/include/ggml.h b/include/ggml.h index 2fdb9fa4..548661b9 100644 --- a/include/ggml.h +++ b/include/ggml.h @@ -2400,6 +2400,7 @@ extern "C" { GGML_API int ggml_cpu_has_vsx (void); GGML_API int ggml_cpu_has_matmul_int8(void); GGML_API int ggml_cpu_has_cann (void); + GGML_API int ggml_cpu_has_llamafile (void); // // Internal types and functions exposed for tests and benchmarks diff --git a/src/ggml.c b/src/ggml.c index aeb6c009..c6117c37 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -22004,6 +22004,14 @@ int ggml_cpu_has_cann(void) { #endif } +int ggml_cpu_has_llamafile(void) { +#if defined(GGML_USE_LLAMAFILE) + return 1; +#else + return 0; +#endif +} + int ggml_cpu_has_gpublas(void) { return ggml_cpu_has_cuda() || ggml_cpu_has_vulkan() || ggml_cpu_has_kompute() || ggml_cpu_has_sycl(); }