flexiblas_switch(3)
π flexiblas_switch(3) π
okay bestie, welcome to the flexiblas_switch(3) manual page, like, the actual official one but make it cute β¨ It lives in The FlexiBLAS Library section of your man pages, and honestly? it's giving "tiny function, huge power". Let's get into it πΈ
β¨ NAME β¨
flexiblas_switch β switch the currently used FlexiBLAS backend. no cap, that's literally the whole job π«Ά
π SYNOPSIS π
#include <flexiblas/flexiblas_api.h>
int flexiblas_switch(int id );
Link with -lflexiblas.
bestie do NOT forget the -lflexiblas flag, she will NOT link herself π
π¦ DESCRIPTION π¦
flexiblas_switch switches the currently used BLAS backend. main character move, honestly π
The id parameter is the id of the previously loaded backend. Where does that id come from, you ask? It's returned by flexiblas_load_backend or flexiblas_load_backend_library β so you gotta load first, then switch. that's the pipeline π₯
β οΈ okay serious moment: this function is not thread safe, and switching the backend inside a threaded environment can cause problems if there is a BLAS call running at the same time. like, imagine changing the entire vibe of the party while someone's mid-dance. chaos. don't do it π
The special id of 0 resets the backend to the default backend, which is the one loaded at the initialization before the program starts. so 0 is basically the "factory reset my backend" button π
β RETURN VALUE β
On success, it returns zero. slay π
π ERRORS π
All negative return values are errors. This happens if the id is out of range. (out of range = not a real backend id, bestie, don't make one up π)
πΈ EXAMPLES πΈ
The following example loads the NETLIB BLAS backend and switches to it. iconic behaviour, fr fr π§
π Program Source π
#include <stdio.h>
#include <flexiblas/flexiblas_api.h>
int main ( int argc, char **argv ) {
int netlib_id;
netlib_id = flexiblas_load_backend("NETLIB");
if ( netlib_id < 0 ) {
fprintf(stderr, "Failed to load the NETLIB backend.\n");
return -1;
}
/* Switch to the NETLIB backend */
flexiblas_switch(netlib_id);
/* DGEMM performed with the NETLIB backend. */
dgemm_(.....);
return 0;
}
π SEE ALSO π
(go read those too, they're the prequel to this one π)
π REPORTING BUGS π
The current information about the developers and reporting bugs can be found on the FlexiBLAS homepage. found a bug? tell the devs, not the group chat, they actually fix things π«Ά
FlexiBLAS Homepage: <http://www.mpi-magdeburg.mpg.de/projects/flexiblas>
π AUTHORS π
Martin Koehler, Jens Saak
π COPYRIGHT π
Copyright (C) 2013-2025 Martin Koehler
π LICENSE π
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
yes bestie, NO WARRANTY, capital letters, they meant it π
M. Koehler β 2013-2025 β flexiblas_switch(3)
and that's the whole page, bestie!! source & version: M. Koehler, dated 2013-2025, from the flexiblas_switch(3) page in The FlexiBLAS Library. now go forth and switch those backends responsibly β¨π
π¦
π¦ where this page comes from
- fedora 43: flexiblas-devel 3.4.5-5.fc43 Β· LGPL-3.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause-Open-MPI
- fedora 43: flexiblas-devel 3.4.5-5.fc43 Β· LGPL-3.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause-Open-MPI
- fedora 43: flexiblas-devel 3.5.0-1.fc43 Β· LGPL-3.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause-Open-MPI
- fedora 43: flexiblas-devel 3.5.0-1.fc43 Β· LGPL-3.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause-Open-MPI
- fedora 44: flexiblas-devel 3.5.0-2.fc44 Β· LGPL-3.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause-Open-MPI
- fedora 44: flexiblas-devel 3.5.0-2.fc44 Β· LGPL-3.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause-Open-MPI
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms