Octopus
openblas_version.c
Go to the documentation of this file.
1
#include <string.h>
2
#include <stdio.h>
3
4
#if defined(__APPLE__)
5
extern
char
*openblas_get_config(
void
)
__attribute__
((weak_import));
6
#else
7
extern
char
*openblas_get_config(
void
)
__attribute__
((weak));
8
#endif
9
16
int
openblas_get_version(
int
*major,
int
*minor,
int
*patch) {
17
// Permissive rather than defensive. Assume if openblas configuration
18
// cannot be retrieved, we are probably not using openblas as a backend
19
if
(!openblas_get_config) {
20
return
1;
21
}
22
/* string guaranteed to start with OpenBLAS:
23
static char* openblas_config_str=""
24
"OpenBLAS "
25
VERSION
26
" "
27
See https://github.com/OpenMathLib/OpenBLAS/blob/develop/driver/others/openblas_get_config.c
28
*/
29
if
(sscanf(openblas_get_config(),
"OpenBLAS %d.%d.%d"
, major, minor, patch) != 3) {
30
return
0;
31
}
32
return
1;
33
}
__attribute__
void __leaf__ __attribute__((__nonnull__(1, 2)))
Definition:
openblas_version.c:65
basic
openblas_version.c
Generated on Tue May 19 2026 00:18:03 for Octopus by
1.9.4