From 176e1db635b7c11148254235f13672d2d937206e Mon Sep 17 00:00:00 2001 From: Aaron Teo Date: Thu, 26 Jun 2025 00:16:48 +0800 Subject: [PATCH] Revert "ggml-cpu: dedup ggml_table_f32_f16 from simd-mappings.h" This reverts commit f71b21d2f74f5e03ec0c2b4fefd3cbf395aecf16. Signed-off-by: Aaron Teo --- ggml/src/ggml-cpu/simd-mappings.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ggml/src/ggml-cpu/simd-mappings.h b/ggml/src/ggml-cpu/simd-mappings.h index 04ec5031b5..65eae151fa 100644 --- a/ggml/src/ggml-cpu/simd-mappings.h +++ b/ggml/src/ggml-cpu/simd-mappings.h @@ -18,10 +18,6 @@ #include #endif -#ifdef __cplusplus -extern "C" { -#endif - // // simd mappings // @@ -141,6 +137,14 @@ extern "C" { } #endif +// precomputed f32 table for f16 (256 KB) +// defined in ggml-cpu.c, initialized in ggml_cpu_init() +#ifdef __cplusplus +extern "C" float ggml_table_f32_f16[1 << 16]; +#else +extern float ggml_table_f32_f16[1 << 16]; +#endif + // On ARM NEON, it's quicker to directly convert x -> x instead of calling into ggml_lookup_fp16_to_fp32, // so we define GGML_CPU_FP16_TO_FP32 and GGML_CPU_FP32_TO_FP16 elsewhere for NEON. // This is also true for POWER9. @@ -1174,7 +1178,3 @@ static inline void __lzs_f16cx4_store(ggml_fp16_t * x, float32x4_t v_y) { #define GGML_F32_ARR (GGML_F32_STEP/GGML_F32_EPR) #define GGML_F16_ARR (GGML_F16_STEP/GGML_F16_EPR) #endif - -#ifdef __cplusplus -} -#endif