We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ff83a4 commit 10a2923Copy full SHA for 10a2923
common_thread.h
@@ -132,18 +132,18 @@ extern int blas_server_avail;
132
static __inline int num_cpu_avail(int level) {
133
134
#ifdef USE_OPENMP
135
- int openmp_nthreads=0;
+ int openmp_nthreads=omp_get_max_threads();
136
#endif
137
138
+#ifndef USE_OPENMP
139
if (blas_cpu_number == 1
-
140
+#endif
141
- || omp_in_parallel()
142
+ if (openmp_nthreads == 1 || omp_in_parallel()
143
- ) return 1;
144
+ ) return 1;
145
146
- openmp_nthreads=omp_get_max_threads();
147
if (blas_cpu_number != openmp_nthreads) {
148
goto_set_num_threads(openmp_nthreads);
149
}
0 commit comments