From f8ec718b764cee5383a0775deb2fb8f84f49b3bb Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 6 Dec 2022 21:56:56 +0200 Subject: [PATCH] ggml : add F16C CPU flag check --- ggml.c | 8 ++++++++ ggml.h | 1 + whisper.cpp | 1 + 3 files changed, 10 insertions(+) diff --git a/ggml.c b/ggml.c index 67e1977..7d9a38f 100644 --- a/ggml.c +++ b/ggml.c @@ -8289,6 +8289,14 @@ int ggml_cpu_has_neon(void) { #endif } +int ggml_cpu_has_f16c(void) { +#if defined(__F16C__) + return 1; +#else + return 0; +#endif +} + int ggml_cpu_has_fp16_va(void) { #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) return 1; diff --git a/ggml.h b/ggml.h index 3e4e962..6dd5d04 100644 --- a/ggml.h +++ b/ggml.h @@ -727,6 +727,7 @@ int ggml_cpu_has_avx(void); int ggml_cpu_has_avx2(void); int ggml_cpu_has_avx512(void); int ggml_cpu_has_neon(void); +int ggml_cpu_has_f16c(void); int ggml_cpu_has_fp16_va(void); int ggml_cpu_has_wasm_simd(void); int ggml_cpu_has_blas(void); diff --git a/whisper.cpp b/whisper.cpp index 42467ef..abfc44f 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -2372,6 +2372,7 @@ const char * whisper_print_system_info(void) { s += "AVX2 = " + std::to_string(ggml_cpu_has_avx2()) + " | "; s += "AVX512 = " + std::to_string(ggml_cpu_has_avx512()) + " | "; s += "NEON = " + std::to_string(ggml_cpu_has_neon()) + " | "; + s += "F16C = " + std::to_string(ggml_cpu_has_f16c()) + " | "; s += "FP16_VA = " + std::to_string(ggml_cpu_has_fp16_va()) + " | "; s += "WASM_SIMD = " + std::to_string(ggml_cpu_has_wasm_simd()) + " | "; s += "BLAS = " + std::to_string(ggml_cpu_has_blas()) + " | ";