From 9ec8635a0616d69f387afee21c35a25143a9b32e Mon Sep 17 00:00:00 2001 From: Julia Longtin Date: Tue, 12 Mar 2024 20:57:43 +0000 Subject: [PATCH] add detection of Xeon PHI: Knights Corner. --- ggml.c | 8 ++++++++ ggml.h | 1 + llama.cpp | 1 + 3 files changed, 10 insertions(+) diff --git a/ggml.c b/ggml.c index 14288d29d..677aa00cd 100644 --- a/ggml.c +++ b/ggml.c @@ -21766,4 +21766,12 @@ int ggml_cpu_has_matmul_int8(void) { #endif } +int ggml_cpu_is_xeonphi_knc(void) { +#if defined(__k1om__) + return 1; +#else + return 0; +#endif +} + //////////////////////////////////////////////////////////////////////////////// diff --git a/ggml.h b/ggml.h index e9ed8eeee..c1f61ccba 100644 --- a/ggml.h +++ b/ggml.h @@ -2369,6 +2369,7 @@ extern "C" { GGML_API int ggml_cpu_has_sycl (void); GGML_API int ggml_cpu_has_vsx (void); GGML_API int ggml_cpu_has_matmul_int8(void); + GGML_API int ggml_cpu_is_xeonphi_knc (void); // // Internal types and functions exposed for tests and benchmarks diff --git a/llama.cpp b/llama.cpp index a5ef2fd8f..d9a464ec7 100644 --- a/llama.cpp +++ b/llama.cpp @@ -16779,6 +16779,7 @@ const char * llama_print_system_info(void) { s += "SSSE3 = " + std::to_string(ggml_cpu_has_ssse3()) + " | "; s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | "; s += "MATMUL_INT8 = " + std::to_string(ggml_cpu_has_matmul_int8()) + " | "; + s += "XEONPHI_KNC = " + std::to_string(ggml_cpu_is_xeonphi_knc()) + " | "; return s.c_str(); }