blob: c5cafb2a1ece6f1d0b1fa10c0feff0e35bd53222 [file] [log] [blame]
Austin Schuh189376f2018-12-20 22:11:15 +11001// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2016 Benoit Steiner <benoit.steiner.goog@gmail.com>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10#ifndef EIGEN_CXX11_THREADPOOL_MODULE
11#define EIGEN_CXX11_THREADPOOL_MODULE
12
13#include "../../../Eigen/Core"
14
Austin Schuhc55b0172022-02-20 17:52:35 -080015#include "../../../Eigen/src/Core/util/DisableStupidWarnings.h"
Austin Schuh189376f2018-12-20 22:11:15 +110016
17/** \defgroup CXX11_ThreadPool_Module C++11 ThreadPool Module
18 *
19 * This module provides 2 threadpool implementations
20 * - a simple reference implementation
21 * - a faster non blocking implementation
22 *
23 * This module requires C++11.
24 *
25 * \code
26 * #include <Eigen/CXX11/ThreadPool>
27 * \endcode
28 */
29
30
31// The code depends on CXX11, so only include the module if the
32// compiler supports it.
Austin Schuhc55b0172022-02-20 17:52:35 -080033#if (EIGEN_COMP_CXXVER >= 11)
Austin Schuh189376f2018-12-20 22:11:15 +110034#include <cstddef>
35#include <cstring>
Austin Schuh189376f2018-12-20 22:11:15 +110036#include <time.h>
37
38#include <vector>
39#include <atomic>
40#include <condition_variable>
41#include <deque>
42#include <mutex>
43#include <thread>
44#include <functional>
45#include <memory>
Austin Schuhc55b0172022-02-20 17:52:35 -080046#include <utility>
47
48// There are non-parenthesized calls to "max" in the <unordered_map> header,
49// which trigger a check in test/main.h causing compilation to fail.
50// We work around the check here by removing the check for max in
51// the case where we have to emulate thread_local.
52#ifdef max
53#undef max
54#endif
55#include <unordered_map>
Austin Schuh189376f2018-12-20 22:11:15 +110056
57#include "src/util/CXX11Meta.h"
58#include "src/util/MaxSizeVector.h"
59
60#include "src/ThreadPool/ThreadLocal.h"
61#include "src/ThreadPool/ThreadYield.h"
Austin Schuhc55b0172022-02-20 17:52:35 -080062#include "src/ThreadPool/ThreadCancel.h"
Austin Schuh189376f2018-12-20 22:11:15 +110063#include "src/ThreadPool/EventCount.h"
64#include "src/ThreadPool/RunQueue.h"
65#include "src/ThreadPool/ThreadPoolInterface.h"
66#include "src/ThreadPool/ThreadEnvironment.h"
Austin Schuhc55b0172022-02-20 17:52:35 -080067#include "src/ThreadPool/Barrier.h"
Austin Schuh189376f2018-12-20 22:11:15 +110068#include "src/ThreadPool/NonBlockingThreadPool.h"
69
70#endif
71
Austin Schuhc55b0172022-02-20 17:52:35 -080072#include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h"
Austin Schuh189376f2018-12-20 22:11:15 +110073
74#endif // EIGEN_CXX11_THREADPOOL_MODULE