3#include <uni20/config.hpp>
13#if !UNI20_BACKEND_OPENBLAS
14#error "backend_openblas.hpp requires UNI20_BACKEND_OPENBLAS"
19namespace blas::openblas
26 int openblas_get_num_threads();
27 int openblas_get_num_procs();
28 char* openblas_get_config();
29 char* openblas_get_corename();
30 int openblas_get_parallel();
37inline std::string copy_string(
char const*
value) {
return value ==
nullptr ? std::string{} : std::string(
value); }
52inline std::string
config() {
return detail::copy_string(detail::openblas_get_config()); }
57inline std::string
core_name() {
return detail::copy_string(detail::openblas_get_corename()); }
62inline void set_num_threads(
int threads) { detail::openblas_set_num_threads(threads); }
67inline int num_threads() {
return detail::openblas_get_num_threads(); }
72inline int num_procs() {
return detail::openblas_get_num_procs(); }
locale_t value
Definition data_table.cpp:49
int num_threads()
Return the current number of OpenBLAS worker threads.
Definition backend_openblas.hpp:67
std::string config()
Return the OpenBLAS build configuration string.
Definition backend_openblas.hpp:52
ParallelMode parallel_mode()
Return the OpenBLAS parallel runtime mode.
Definition backend_openblas.hpp:77
ParallelMode
OpenBLAS parallel runtime mode.
Definition backend_openblas.hpp:43
std::string core_name()
Return the OpenBLAS CPU core name selected by the library.
Definition backend_openblas.hpp:57
int num_procs()
Return the processor count reported by OpenBLAS.
Definition backend_openblas.hpp:72
void set_num_threads(int threads)
Set the number of OpenBLAS worker threads.
Definition backend_openblas.hpp:62
Definition async/async.hpp:26