Skip to content

Commit b6b0456

Browse files
committed
Default to 1 if no threading libraries are found.
1 parent 6b1398d commit b6b0456

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/threading.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ LBT_DLLEXPORT void lbt_register_thread_interface(const char * getter, const char
4747
/*
4848
* Returns the number of threads configured in all loaded libraries.
4949
* In the event of a mismatch, returns the largest value.
50+
* If no BLAS libraries with a known threading interface are loaded,
51+
* returns `1`.
5052
*/
5153
LBT_DLLEXPORT int32_t lbt_get_num_threads() {
52-
int32_t max_threads = 0;
54+
int32_t max_threads = 1;
5355

5456
const lbt_config_t * config = lbt_get_config();
5557
for (int lib_idx=0; config->loaded_libs[lib_idx] != NULL; ++lib_idx) {

0 commit comments

Comments
 (0)