MCPcopy Create free account
hub / github.com/andrewkchan/deepseek.cpp / nearest_int

Function nearest_int

src/quant.cpp:34–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#define GROUP_MAX_EPS 1e-15f
33
34static inline int nearest_int(float fval) {
35 assert(fabsf(fval) <= 4194303.f);
36 float val = fval + 12582912.f;
37 int i; memcpy(&i, &val, sizeof(int));
38 return (i & 0x007fffff) - 0x00400000;
39}
40
41// some compilers don't provide _mm256_set_m128i, e.g. gcc 7
42#define MM256_SET_M128I(a, b) _mm256_insertf128_si256(_mm256_castsi128_si256(b), (a), 1)

Callers 5

quant.cppFile · 0.85
quantize_row_q2_K_refFunction · 0.85
make_q3_quantsFunction · 0.85
quantize_row_q3_K_refFunction · 0.85
quantize_row_q8_K_refFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected