Handle misleading thread count when OMP_PLACES=threads
This commit is contained in:
parent
a83680b40b
commit
fb5d13e37b
|
@ -135,12 +135,13 @@ static __inline int num_cpu_avail(int level) {
|
||||||
int openmp_nthreads=0;
|
int openmp_nthreads=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (blas_cpu_number == 1
|
#ifndef USE_OPENMP
|
||||||
|
if ( blas_cpu_number == 1 )
|
||||||
#ifdef USE_OPENMP
|
#else
|
||||||
|| omp_in_parallel()
|
if ( omp_in_parallel() ||
|
||||||
#endif
|
(blas_cpu_number == 1 && !openblas_env_omp_places_threads) )
|
||||||
) return 1;
|
#endif
|
||||||
|
return 1;
|
||||||
|
|
||||||
#ifdef USE_OPENMP
|
#ifdef USE_OPENMP
|
||||||
openmp_nthreads=omp_get_max_threads();
|
openmp_nthreads=omp_get_max_threads();
|
||||||
|
|
Loading…
Reference in New Issue