]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml: change inline ggml_fp16_to_fp32, ggml_fp16_t ggml_fp32_to_fp16
authorkatsu560 <redacted>
Wed, 23 Nov 2022 13:54:21 +0000 (22:54 +0900)
committerGeorgi Gerganov <redacted>
Wed, 23 Nov 2022 20:16:33 +0000 (22:16 +0200)
ggml.c

diff --git a/ggml.c b/ggml.c
index ab49c23bdcec424f6ff6de1b14efe028330d3fa2..17f324e03176449281857fe4df3989a7271d799d 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -140,7 +140,7 @@ static inline uint32_t fp32_to_bits(float f) {
        return fp32.as_bits;
 }
 
-float ggml_fp16_to_fp32(ggml_fp16_t h) {
+inline float ggml_fp16_to_fp32(ggml_fp16_t h) {
     const uint32_t w = (uint32_t) h << 16;
     const uint32_t sign = w & UINT32_C(0x80000000);
     const uint32_t two_w = w + w;
@@ -163,7 +163,7 @@ float ggml_fp16_to_fp32(ggml_fp16_t h) {
     return fp32_from_bits(result);
 }
 
-ggml_fp16_t ggml_fp32_to_fp16(float f) {
+inline ggml_fp16_t ggml_fp32_to_fp16(float f) {
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) || defined(__GNUC__) && !defined(__STRICT_ANSI__)
     const float scale_to_inf = 0x1.0p+112f;
     const float scale_to_zero = 0x1.0p-110f;