flexiblas_switch - Man Page

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

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.

Referenced By

flexiblas_load_backend(3), flexiblas_load_backend_library(3).

2013-2022 M. Koehler The FlexiBLAS Library