Skip to content

Commit

Permalink
ggml: change inline ggml_fp16_to_fp32, ggml_fp16_t ggml_fp32_to_fp16
Browse files Browse the repository at this point in the history
  • Loading branch information
katsu560 authored and ggerganov committed Nov 23, 2022
1 parent 4b2f51b commit 804f36a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 804f36a

Please sign in to comment.