From 38b9cc263bbaeb03ce408a4e26084543a6c0dedb Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Wed, 29 May 2024 13:38:00 -0700 Subject: [PATCH] Fix warnings about repeated deinitions of macros. --- Eigen/src/ThreadPool/CoreThreadPoolDevice.h | 36 ++++++++++----------- test/assignment_threaded.cpp | 7 ++-- test/main.h | 7 ---- 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/Eigen/src/ThreadPool/CoreThreadPoolDevice.h b/Eigen/src/ThreadPool/CoreThreadPoolDevice.h index ad786fe18..acf1d628b 100644 --- a/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +++ b/Eigen/src/ThreadPool/CoreThreadPoolDevice.h @@ -15,24 +15,24 @@ namespace Eigen { // CoreThreadPoolDevice provides an easy-to-understand Device for parallelizing Eigen Core expressions with // Threadpool. Expressions are recursively split evenly until the evaluation cost is less than the threshold for // delegating the task to a thread. - -// a -// / \ -// / \ -// / \ -// / \ -// / \ -// / \ -// / \ -// a e -// / \ / \ -// / \ / \ -// / \ / \ -// a c e g -// / \ / \ / \ / \ -// / \ / \ / \ / \ -// a b c d e f g h - +/* + a + / \ + / \ + / \ + / \ + / \ + / \ + / \ + a e + / \ / \ + / \ / \ + / \ / \ + a c e g + / \ / \ / \ / \ + / \ / \ / \ / \ + a b c d e f g h +*/ // Each task descends the binary tree to the left, delegates the right task to a new thread, and continues to the // left. This ensures that work is evenly distributed to the thread pool as quickly as possible and minimizes the number // of tasks created during the evaluation. Consider an expression that is divided into 8 chunks. The diff --git a/test/assignment_threaded.cpp b/test/assignment_threaded.cpp index 0ba8c219a..7505a109a 100644 --- a/test/assignment_threaded.cpp +++ b/test/assignment_threaded.cpp @@ -7,13 +7,10 @@ // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -#if defined(EIGEN_USE_THREADS) -#undef EIGEN_USE_THREADS -#endif - -#define EIGEN_USE_THREADS +#define EIGEN_USE_THREADS 1 #include "main.h" +#include namespace Eigen { namespace internal { diff --git a/test/main.h b/test/main.h index ca485ba80..e86c58481 100644 --- a/test/main.h +++ b/test/main.h @@ -52,9 +52,6 @@ #if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) #include #include -#ifdef EIGEN_USE_THREADS -#include -#endif #endif #if __cplusplus > 201703L // libstdc++ 9's indirectly uses max() via . @@ -219,11 +216,7 @@ class EigenTest { } // namespace Eigen #define TRACK std::cerr << __FILE__ << " " << __LINE__ << std::endl -// #define TRACK while() -#ifdef EIGEN_DEFAULT_IO_FORMAT -#undef EIGEN_DEFAULT_IO_FORMAT -#endif #define EIGEN_DEFAULT_IO_FORMAT IOFormat(4, 0, " ", "\n", "", "", "", "") #if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(__HIP_DEVICE_COMPILE__) && \