MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / xsum_small_addv

Function xsum_small_addv

xs/sources/xsum.c:1003–1020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1001 calls of xsum_carry_propagate with calls of xsum_add1_no_carry. */
1002
1003void xsum_small_addv (xsum_small_accumulator *restrict sacc,
1004 const xsum_flt *restrict vec,
1005 xsum_length n)
1006{ xsum_length m, i;
1007
1008 while (n > 0)
1009 { if (sacc->adds_until_propagate == 0)
1010 { (void) xsum_carry_propagate(sacc);
1011 }
1012 m = n <= sacc->adds_until_propagate ? n : sacc->adds_until_propagate;
1013 for (i = 0; i < m; i++)
1014 { xsum_add1_no_carry (sacc, vec[i]);
1015 }
1016 sacc->adds_until_propagate -= m;
1017 vec += m;
1018 n -= m;
1019 }
1020}
1021
1022
1023/* ADD SQUARED NORM OF VECTOR OF FLOATING-POINT NUMBERS TO SMALL ACCUMULATOR.

Callers

nothing calls this directly

Calls 2

xsum_carry_propagateFunction · 0.85
xsum_add1_no_carryFunction · 0.85

Tested by

no test coverage detected