sourCEntral - mobile manpages

pdf

flexiblas_switch

NAME

flexiblas_switch - switch the currently used FlexiBLAS backend.

SYNOPSIS

#include <flexiblas/flexiblas_api.h>

int flexiblas_switch(int id );

Link with -lflexiblas.

DESCRIPTION

flexiblas_switch switches the currently used BLAS backend. The id parameter is the id of the previously loaded backend. This id value is returned by flexiblas_load_backend or flexiblas_load_backend_library. The 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.

The special id 0 resets the backend to the default backend which is loaded at the initialization before the program starts.

RETURN VALUE

On success, it returns zero.

ERRORS

All negative return values are errors. This happens if the id is out of range.

EXAMPLES

The following example loads the NETLIB BLAS backend and switches to it.

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

flexiblas_load_backend_library(3), flexiblas_load_backend(3)

REPORTING BUGS

The current information about the developers and reporting bugs can be found on the FlexiBLAS homepage.

FlexiBLAS Homepage: <http://www.mpi-magdeburg.mpg.de/projects/flexiblas>

AUTHORS

Martin Koehler, Jens Saak

COPYRIGHT

Copyright (C) 2013-2022 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.

pdf