use omp_get_max_threads if setNbThreads is not set

This commit is contained in:
Joerg Buchwald 2024-12-20 21:16:15 +00:00 committed by Antonio Sánchez
parent a32db43966
commit 24e0c2a125

View File

@ -153,7 +153,14 @@ inline void manage_multi_threading(Action action, int* v) {
#endif
} else if (action == GetAction) {
eigen_internal_assert(v != nullptr);
#if defined(EIGEN_HAS_OPENMP)
if (m_maxThreads > 0)
*v = m_maxThreads;
else
*v = omp_get_max_threads();
#else
*v = m_maxThreads;
#endif
} else {
eigen_internal_assert(false);
}