Skip to content
fn

vsum_f32

→float
float vsum_f32(const float * in, int n)

Single-precision array sum reduction.

Computes ∑i=0n−1ini\sum_{i=0}^{n-1} \text{in}_i via vDSP_sve (single-pass, pairwise tree-style accumulation — numerically more stable than a serial loop).

References

Accelerate.framework vDSP_sve.

Parameters

inconst float*
Input buffer.
nstd::size_t
Element count.

Returns

float

Sum of all nn input elements.