Fix a regression when using OpenMP, and fix bug #714: the number of threads might be lower than the number of requested ones

This commit is contained in:
Gael Guennebaud
2015-02-18 15:19:23 +01:00
parent 548b781380
commit c7bb1e8ea8
3 changed files with 33 additions and 14 deletions

View File

@@ -64,8 +64,7 @@ void test_product_large()
#endif
// Regression test for bug 714:
#ifdef EIGEN_HAS_OPENMP
std::cout << "Testing omp_set_dynamic(1)\n";
#if defined EIGEN_HAS_OPENMP
omp_set_dynamic(1);
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_6( product(Matrix<float,Dynamic,Dynamic>(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );