Source

Branch

1/ @MichalPiotrK

@AgileJebrim

If the array is in RAM, do it sequentially. If it’s in GPU memory, use partial sums sqrt(n) elements, then in a second run you get the result. Unless there are constraints, e.g. floating point with error tracking or the array is really very large, or do I optimize for power or…

2/ @AgileJebrim

@MichalPiotrK

Nope.