1flexiblas_switch(3) The FlexiBLAS Library flexiblas_switch(3)
2
3
4
6 flexiblas_switch - switch the currently used FlexiBLAS backend.
7
8
10 #include <flexiblas/flexiblas_api.h>
11
12 int flexiblas_switch(int id );
13
14 Link with -lflexiblas.
15
16
18 flexiblas_switch switches the currently used BLAS backend. The id
19 parameter is the id of the previously loaded backend. This id value is
20 returned by flexiblas_load_backend or flexiblas_load_backend_library.
21 The function is not thread safe and switching the backend inside a
22 threaded environment can cause problems if there is a BLAS call running
23 at the same time.
24
25 The special id 0 resets the backend to the default backend which is
26 loaded at the initialization before the program starts.
27
28
29
31 On success, it returns zero.
32
33
35 All negative return values are errors. This happens if the id is out of
36 range.
37
38
40 The following example loads the NETLIB BLAS backend and switches to it.
41
42 Program Source
43
44 #include <stdio.h>
45 #include <flexiblas/flexiblas_api.h>
46
47 int main ( int argc, char **argv ) {
48 int netlib_id;
49
50 netlib_id = flexiblas_load_backend("NETLIB");
51 if ( netlib_id < 0 ) {
52 fprintf(stderr, "Failed to load the NETLIB backend.\n");
53 return -1;
54 }
55 /* Switch to the NETLIB backend */
56 flexiblas_switch(netlib_id);
57
58 /* DGEMM performed with the NETLIB backend. */
59 dgemm_(.....);
60
61 return 0;
62 }
63
64
66 flexiblas_load_backend_library(3), flexiblas_load_backend(3)
67
68
70 The current information about the developers and reporting bugs can be
71 found on the FlexiBLAS homepage.
72
73 FlexiBLAS Homepage: <http://www.mpi-magdeburg.mpg.de/projects/flexi‐
74 blas>
75
76
78 Martin Koehler, Jens Saak
79
80
82 Copyright (C) 2013-2020 Martin Koehler
83
85 License GPLv3+: GNU GPL version 3 or later
86 <http://gnu.org/licenses/gpl.html>. This is free software: you are
87 free to change and redistribute it. There is NO WARRANTY, to the
88 extent permitted by law.
89
90
91
92
93M. Koehler Mar. 2017 flexiblas_switch(3)