qutil_double_sum(3)
π 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 π«Ά
qutil_double_mult(3)qutil_double_max(3)qutil_double_min(3)qutil_uint_mult(3)qutil_uint_max(3)qutil_uint_min(3)qutil_int_mult(3)qutil_int_max(3)qutil_int_min(3)qutil_mergesort(3)qutil_qsort(3)
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
- fedora 43: qthreads-devel 1.22^20251007gitcedb1fc-1.fc43 Β· BSD-3-Clause AND MIT AND dtoa
- fedora 44: qthreads-devel 1.22^20251007gitcedb1fc-2.fc44 Β· BSD-3-Clause AND MIT AND dtoa
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms