qt_double_max(3)
π qt_double_max β bestie's guide to finding the max in parallel π
okay so this is a page from libqthread's manual, and it's all about three little icons: qt_double_max, qt_uint_max, and qt_int_max. they all do the same gorgeous thing, just for different types. let's get into it β¨
β¨ NAME β¨
qt_double_max, qt_uint_max, qt_int_max β find the maximum value within an array, but likeβ¦ in parallel π¦
πΈ SYNOPSIS πΈ
#include <qthread/qloop.h>
double
qt_double_max (double *array, size_t length, int checkfeb);
unsigned int
qt_uint_max (unsigned int *array, size_t length, int checkfeb);
int
qt_int_max (int *array, size_t length, int checkfeb);
π DESCRIPTION π
so basically, these functions take an array that has length numbers in it, and they hand you back the maximum value hiding in there. and the way they find it?? in parallel, babes. the possible values get divvied up evenly among the shepherds, so everybody's working on their slice at the same time. teamwork makes the dream work fr fr π«Ά
now, about that checkfeb argument β if it's non-zero, these functions will wait for the entries in the array to be full before comparing them. so they'll chill until everything's ready, no rushing π
β οΈ but listen, bestie, they DO NOT check whether the array entries are properly aligned. like, at all. not even a little. so if your alignment is a mess, that's on you, not them π
β RETURN VALUE β
the maximum value of the first length entries of array. that's it, that's the tea π
π SEE ALSO π
go give these a lil read too, they're all in the same friend group:
qt_double_prod(3)qt_double_sum(3)qt_double_min(3)qt_uint_prod(3)qt_uint_sum(3)qt_uint_min(3)qt_int_prod(3)qt_int_sum(3)qt_int_min(3)qt_loop(3)qt_loop_balance(3)qt_loopaccum_balance(3)
and that's the whole page, bestie!! this one's from libqthread, dated JUNE 2007 β yes, literally ancient, but the max-finding slays just as hard today πβ¨ no cap, go find your maximum π¦π
π¦ 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