From 7497fb28670f311bfebcf1edd2e82dd27ea442c5 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 29 Nov 2020 22:50:00 +0000 Subject: user/eigen: Fix usage of assertion exception --- user/eigen/APKBUILD | 7 ++-- user/eigen/assert-compile-error.patch | 64 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 user/eigen/assert-compile-error.patch (limited to 'user/eigen') diff --git a/user/eigen/APKBUILD b/user/eigen/APKBUILD index aa2a537d2..c44ed3011 100644 --- a/user/eigen/APKBUILD +++ b/user/eigen/APKBUILD @@ -11,7 +11,9 @@ license="MPL-2.0" depends="" makedepends="" subpackages="$pkgname-dev" -source="https://gitlab.com/libeigen/eigen/-/archive/$pkgver/eigen-$pkgver.tar.gz" +source="https://gitlab.com/libeigen/eigen/-/archive/$pkgver/eigen-$pkgver.tar.gz + assert-compile-error.patch + " package() { mkdir -p "$pkgdir"/usr/include/eigen3 @@ -19,4 +21,5 @@ package() { cp -r "$builddir"/unsupported "$pkgdir"/usr/include/eigen3 } -sha512sums="5b4b5985b0294e07b3ed1155720cbbfea322fe9ccad0fc8b0a10060b136a9169a15d5b9cb7a434470cadd45dff0a43049edc20d2e1070005481a120212edc355 eigen-3.3.8.tar.gz" +sha512sums="5b4b5985b0294e07b3ed1155720cbbfea322fe9ccad0fc8b0a10060b136a9169a15d5b9cb7a434470cadd45dff0a43049edc20d2e1070005481a120212edc355 eigen-3.3.8.tar.gz +26cdf877d4d3378b322cc08c0430b0628a07279a030732661ba4acb85d6c835956c99474fc4587a170d11437ca6715e56d8eaabb625a1eba7c46ce4d6e4d66f9 assert-compile-error.patch" diff --git a/user/eigen/assert-compile-error.patch b/user/eigen/assert-compile-error.patch new file mode 100644 index 000000000..556474e8b --- /dev/null +++ b/user/eigen/assert-compile-error.patch @@ -0,0 +1,64 @@ +From ef3cc72cb65e2d500459c178c63e349bacfa834f Mon Sep 17 00:00:00 2001 +From: Luke Peterson +Date: Thu, 8 Oct 2020 12:16:53 -0700 +Subject: [PATCH] Remove error counting in OpenMP parallelize_gemm + +This resolves a compilation error associated with +Eigen::eigen_assert_exception. It also eliminates the counting of +exceptions that may occur in the OpenMP parallel section. If an +unhandled exception occurs in this section, the behavior is non-conforming +according to the OpenMP specification. +--- + Eigen/src/Core/products/Parallelizer.h | 14 +++++--------- + test/CMakeLists.txt | 2 +- + 2 files changed, 6 insertions(+), 10 deletions(-) + +diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h +index 67b2442b5..a3cc05b77 100644 +--- a/Eigen/src/Core/products/Parallelizer.h ++++ b/Eigen/src/Core/products/Parallelizer.h +@@ -132,8 +132,7 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, + + ei_declare_aligned_stack_constructed_variable(GemmParallelInfo,info,threads,0); + +- int errorCount = 0; +- #pragma omp parallel num_threads(threads) reduction(+: errorCount) ++ #pragma omp parallel num_threads(threads) + { + Index i = omp_get_thread_num(); + // Note that the actual number of threads might be lower than the number of request ones. +@@ -152,14 +151,11 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, + info[i].lhs_start = r0; + info[i].lhs_length = actualBlockRows; + +- EIGEN_TRY { +- if(transpose) func(c0, actualBlockCols, 0, rows, info); +- else func(0, rows, c0, actualBlockCols, info); +- } EIGEN_CATCH(...) { +- ++errorCount; +- } ++ if(transpose) ++ func(c0, actualBlockCols, 0, rows, info); ++ else ++ func(0, rows, c0, actualBlockCols, info); + } +- if (errorCount) EIGEN_THROW_X(Eigen::eigen_assert_exception()); + #endif + } + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 0747aa6cb..b02577780 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -163,7 +163,7 @@ ei_add_test(constructor) + ei_add_test(linearstructure) + ei_add_test(integer_types) + ei_add_test(unalignedcount) +-if(NOT EIGEN_TEST_NO_EXCEPTIONS) ++if(NOT EIGEN_TEST_NO_EXCEPTIONS AND NOT EIGEN_TEST_OPENMP) + ei_add_test(exceptions) + endif() + ei_add_test(redux) +-- +GitLab + -- cgit v1.2.3-60-g2f50