From 4362818573006e145a143b3f143008478016dcff Mon Sep 17 00:00:00 2001 From: Abitofevrything Date: Mon, 2 Jan 2023 10:55:59 +0100 Subject: [PATCH] Wrap Imath calls to avoid static function warnings --- ggml.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ggml.c b/ggml.c index 05da049..e6dd7c8 100644 --- a/ggml.c +++ b/ggml.c @@ -162,8 +162,16 @@ ggml_fp16_t ggml_fp32_to_fp16(float f) { #include -#define GGML_FP16_TO_FP32(x) imath_half_to_float(x) -#define GGML_FP32_TO_FP16(x) imath_float_to_half(x) +float ggml_fp16_to_fp32(ggml_fp16_t h) { + return imath_half_to_float(h); +} + +ggml_fp16_t ggml_fp32_to_fp16(float f) { + return imath_float_to_half(f); +} + +#define GGML_FP16_TO_FP32(x) ggml_fp16_to_fp32(x) +#define GGML_FP32_TO_FP16(x) ggml_fp32_to_fp16(x) #else