qutil_double_sum(3)

πŸ“¦ version 1.22^20251007gitcedb1fc, in fedora 43, fedora 44

πŸ’– qutil_double_sum β€” bestie we're doing MATH in PARALLEL πŸ’–

okay so this is a page from libqthread (that's the manual, the whole section 3 vibe, iykyk) and it's about three lil functions that all do the same iconic thing: they add up an array. But like. In parallel. πŸ¦‹


✨ NAME ✨

qutil_double_sum, qutil_uint_sum, qutil_int_sum β€” add up an array in parallel


🌸 SYNOPSIS 🌸

#include <qthread.h>
#include <qthread/qutil.h>

double
qutil_double_sum (double *array, size_t length, int checkfeb);

unsigned int
qutil_uint_sum (unsigned int *array, size_t length, int checkfeb);

int
qutil_int_sum (int *array, size_t length, int checkfeb);

πŸ’… DESCRIPTION πŸ’…

so these functions take an array of length numbers as input, and they hand you back the sum of those numbers. That's it. That's the whole job. πŸ‘‘

but here's the part that's giving main character energy: the sum is computed in parallel, by using a lagging-loop structure. periodt. πŸ”₯

If checkfeb is non-zero, these functions will wait for the entries in the array to be full before adding them. 🌈

⚠️ okay bestie listen: they DO NOT check whether the array entries are properly aligned. Like, zero vibe check on alignment. And if the datatype is too small to do a FEB operation on, they will abort, if sanity checks are turned on. 😭 So pls be careful out there.

πŸŽ€ RETURN VALUE πŸŽ€

The sum of the first length entries of array. that's the tea. πŸ“


🫢 SEE ALSO 🫢


and that's a wrap on the qutil_double_sum(3) page πŸ’– this lil masterpiece lives in libqthread, and it was last touched in APRIL 2011 β€” yeah, she's vintage, she's iconic, she's still slaying. πŸ‘‘βœ¨ bye bestie, go sum something πŸ§šπŸ’œ

πŸ“¦ where this page comes from