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

Function ggml_vec_sum_f32

ggml.c:1518–1528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1516#endif
1517
1518inline static void ggml_vec_sum_f32(const int n, float * s, const float * x) {
1519#ifndef GGML_USE_ACCELERATE
1520 ggml_float sum = 0.0;
1521 for (int i = 0; i < n; ++i) {
1522 sum += (ggml_float)x[i];
1523 }
1524 *s = sum;
1525#else
1526 vDSP_sve(x, 1, s, n);
1527#endif
1528}
1529
1530inline static void ggml_vec_sum_f32_ggf(const int n, ggml_float * s, const float * x) {
1531 ggml_float sum = 0.0;

Calls

no outgoing calls

Tested by

no test coverage detected