Commit 91c6d36f authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #12796 from alalek:fix_openmp_performance

parents be76b451 4e629000
...@@ -420,7 +420,16 @@ static int numThreads = -1; ...@@ -420,7 +420,16 @@ static int numThreads = -1;
#elif defined HAVE_CSTRIPES #elif defined HAVE_CSTRIPES
// nothing for C= // nothing for C=
#elif defined HAVE_OPENMP #elif defined HAVE_OPENMP
static int numThreadsMax = omp_get_max_threads(); static inline int _initMaxThreads()
{
int maxThreads = omp_get_max_threads();
if (!utils::getConfigurationParameterBool("OPENCV_FOR_OPENMP_DYNAMIC_DISABLE", false))
{
omp_set_dynamic(maxThreads);
}
return numThreads;
}
static int numThreadsMax = _initMaxThreads();
#elif defined HAVE_GCD #elif defined HAVE_GCD
// nothing for GCD // nothing for GCD
#elif defined WINRT #elif defined WINRT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment