From 3ffefcb95c73240e0681d25a9771de854c21ca0c Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Thu, 2 Dec 2021 23:55:25 +0000 Subject: [PATCH] Only include if needed. --- Eigen/Core | 1 + Eigen/src/Core/products/Parallelizer.h | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Eigen/Core b/Eigen/Core index 9f96eaa79..b8d8bc659 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -67,6 +67,7 @@ #endif #ifdef EIGEN_HAS_OPENMP +#include #include #endif diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h index d38d3da55..da4affb80 100644 --- a/Eigen/src/Core/products/Parallelizer.h +++ b/Eigen/src/Core/products/Parallelizer.h @@ -10,8 +10,6 @@ #ifndef EIGEN_PARALLELIZER_H #define EIGEN_PARALLELIZER_H -#include - #include "../InternalHeaderCheck.h" namespace Eigen { @@ -78,14 +76,14 @@ namespace internal { template struct GemmParallelInfo { - GemmParallelInfo() : sync(-1), users(0), lhs_start(0), lhs_length(0) {} - // volatile is not enough on all architectures (see bug 1572) - // to guarantee that when thread A says to thread B that it is - // done with packing a block, then all writes have been really - // carried out... C++11 memory model+atomic guarantees this. +#ifdef EIGEN_HAS_OPENMP + GemmParallelInfo() : sync(-1), users(0), lhs_start(0), lhs_length(0) {} std::atomic sync; std::atomic users; +#else + GemmParallelInfo() : lhs_start(0), lhs_length(0) {} +#endif Index lhs_start; Index lhs_length;