Handle runtime OMP thread count exceeding build-time NUM_THREADS
This commit is contained in:
parent
26ce2705f1
commit
8116299631
|
@ -140,6 +140,7 @@ static __inline int num_cpu_avail(int level) {
|
||||||
|
|
||||||
#ifdef USE_OPENMP
|
#ifdef USE_OPENMP
|
||||||
int openmp_nthreads=omp_get_max_threads();
|
int openmp_nthreads=omp_get_max_threads();
|
||||||
|
if (openmp_nthreads > MAX_CPU_NUMBER) openmp_nthreads=MAX_CPU_NUMBER;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef USE_OPENMP
|
#ifndef USE_OPENMP
|
||||||
|
|
Loading…
Reference in New Issue