MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / hsum_float_8

Function hsum_float_8

ggml-quants.c:67–73  ·  view source on GitHub ↗

horizontally add 8 floats

Source from the content-addressed store, hash-verified

65#if __AVX__ || __AVX2__ || __AVX512F__
66// horizontally add 8 floats
67static inline float hsum_float_8(const __m256 x) {
68 __m128 res = _mm256_extractf128_ps(x, 1);
69 res = _mm_add_ps(res, _mm256_castps256_ps128(x));
70 res = _mm_add_ps(res, _mm_movehl_ps(res, res));
71 res = _mm_add_ss(res, _mm_movehdup_ps(res));
72 return _mm_cvtss_f32(res);
73}
74
75// horizontally add 8 int32_t
76static inline int hsum_i32_8(const __m256i a) {

Callers 10

ggml_vec_dot_q4_0_q8_0Function · 0.70
ggml_vec_dot_q4_1_q8_1Function · 0.70
ggml_vec_dot_q5_0_q8_0Function · 0.70
ggml_vec_dot_q5_1_q8_1Function · 0.70
ggml_vec_dot_q8_0_q8_0Function · 0.70
ggml_vec_dot_q2_K_q8_KFunction · 0.70
ggml_vec_dot_q3_K_q8_KFunction · 0.70
ggml_vec_dot_q4_K_q8_KFunction · 0.70
ggml_vec_dot_q5_K_q8_KFunction · 0.70
ggml_vec_dot_q6_K_q8_KFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected