MCPcopy Create free account
hub / github.com/Niko1221/Strata / ggml_bf16

Function ggml_bf16

engine/src/kernels/bf16_bits_test.cpp:23–26  ·  view source on GitHub ↗

ggml_compute_fp32_to_bf16, ggml/src/ggml-impl.h (MIT, the ggml authors), on raw bits.

Source from the content-addressed store, hash-verified

21
22/// ggml_compute_fp32_to_bf16, ggml/src/ggml-impl.h (MIT, the ggml authors), on raw bits.
23uint16_t ggml_bf16(uint32_t u) {
24 if ((u & 0x7fffffffu) > 0x7f800000u) return (uint16_t) ((u >> 16) | 64);
25 return (uint16_t) ((u + (0x7fffu + ((u >> 16) & 1u))) >> 16);
26}
27
28/// The rule before this fix, kept only to prove the change is confined to NaN inputs.
29uint16_t previous_bf16(uint32_t u) {

Callers 3

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected