From 6925a7d71678afd0e2feac13128795f34a104f2d Mon Sep 17 00:00:00 2001 From: nick huang Date: Sun, 30 Mar 2025 04:58:31 +0800 Subject: [PATCH] ggml_fp16_t is typedef as uint16_t, there is no need to convert --- src/ggml-impl.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ggml-impl.h b/src/ggml-impl.h index be2e3fc915..5ae79ee729 100644 --- a/src/ggml-impl.h +++ b/src/ggml-impl.h @@ -496,9 +496,7 @@ GGML_API float ggml_table_f32_f16[1 << 16]; // This is also true for POWER9. #if !defined(GGML_FP16_TO_FP32) inline static float ggml_lookup_fp16_to_fp32(ggml_fp16_t f) { - uint16_t s; - memcpy(&s, &f, sizeof(uint16_t)); - return ggml_table_f32_f16[s]; + return ggml_table_f32_f16[f]; } #define GGML_FP16_TO_FP32(x) ggml_lookup_fp16_to_fp32(x)