Commit | Line | Data |
---|---|---|
ba902a15 TGR |
1 | From ef3cc72cb65e2d500459c178c63e349bacfa834f Mon Sep 17 00:00:00 2001 |
2 | From: Luke Peterson <hazelnusse@gmail.com> | |
3 | Date: Thu, 8 Oct 2020 12:16:53 -0700 | |
4 | Subject: [PATCH] Remove error counting in OpenMP parallelize_gemm | |
5 | ||
6 | This resolves a compilation error associated with | |
7 | Eigen::eigen_assert_exception. It also eliminates the counting of | |
8 | exceptions that may occur in the OpenMP parallel section. If an | |
9 | unhandled exception occurs in this section, the behavior is non-conforming | |
10 | according to the OpenMP specification. | |
11 | --- | |
12 | Eigen/src/Core/products/Parallelizer.h | 14 +++++--------- | |
13 | test/CMakeLists.txt | 2 +- | |
14 | 2 files changed, 6 insertions(+), 10 deletions(-) | |
15 | ||
16 | diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h | |
17 | index 67b2442b5..a3cc05b77 100644 | |
18 | --- a/Eigen/src/Core/products/Parallelizer.h | |
19 | +++ b/Eigen/src/Core/products/Parallelizer.h | |
20 | @@ -132,8 +132,7 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, | |
21 | ||
22 | ei_declare_aligned_stack_constructed_variable(GemmParallelInfo<Index>,info,threads,0); | |
23 | ||
24 | - int errorCount = 0; | |
25 | - #pragma omp parallel num_threads(threads) reduction(+: errorCount) | |
26 | + #pragma omp parallel num_threads(threads) | |
27 | { | |
28 | Index i = omp_get_thread_num(); | |
29 | // Note that the actual number of threads might be lower than the number of request ones. | |
30 | @@ -152,14 +151,11 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, | |
31 | info[i].lhs_start = r0; | |
32 | info[i].lhs_length = actualBlockRows; | |
33 | ||
34 | - EIGEN_TRY { | |
35 | - if(transpose) func(c0, actualBlockCols, 0, rows, info); | |
36 | - else func(0, rows, c0, actualBlockCols, info); | |
37 | - } EIGEN_CATCH(...) { | |
38 | - ++errorCount; | |
39 | - } | |
40 | + if(transpose) | |
41 | + func(c0, actualBlockCols, 0, rows, info); | |
42 | + else | |
43 | + func(0, rows, c0, actualBlockCols, info); | |
44 | } | |
45 | - if (errorCount) EIGEN_THROW_X(Eigen::eigen_assert_exception()); | |
46 | #endif | |
47 | } | |
48 | ||
49 | diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt | |
50 | index 0747aa6cb..b02577780 100644 | |
51 | --- a/test/CMakeLists.txt | |
52 | +++ b/test/CMakeLists.txt | |
53 | @@ -163,7 +163,7 @@ ei_add_test(constructor) | |
54 | ei_add_test(linearstructure) | |
55 | ei_add_test(integer_types) | |
56 | ei_add_test(unalignedcount) | |
57 | -if(NOT EIGEN_TEST_NO_EXCEPTIONS) | |
58 | +if(NOT EIGEN_TEST_NO_EXCEPTIONS AND NOT EIGEN_TEST_OPENMP) | |
59 | ei_add_test(exceptions) | |
60 | endif() | |
61 | ei_add_test(redux) | |
62 | -- | |
63 | GitLab | |
64 |