blob: c6e2cee5b6252ff0abad3623ec7efca341649e0b [file] [log] [blame]
Tobias Wood94f57862023-05-05 16:23:34 +00001// 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_THREADPOOL_MODULE_H
11#define EIGEN_THREADPOOL_MODULE_H
12
13#include "Core"
14
15#include "src/Core/util/DisableStupidWarnings.h"
16
17/** \defgroup ThreadPool_Module ThreadPool Module
Tobias Woodf38e16c2023-11-29 11:12:48 +000018 *
19 * This module provides 2 threadpool implementations
20 * - a simple reference implementation
21 * - a faster non blocking implementation
22 *
23 * \code
24 * #include <Eigen/ThreadPool>
25 * \endcode
26 */
Tobias Wood94f57862023-05-05 16:23:34 +000027
28#include <cstddef>
29#include <cstring>
30#include <time.h>
31
32#include <vector>
33#include <atomic>
34#include <condition_variable>
35#include <deque>
36#include <mutex>
37#include <thread>
38#include <functional>
39#include <memory>
40#include <utility>
41
42// There are non-parenthesized calls to "max" in the <unordered_map> header,
43// which trigger a check in test/main.h causing compilation to fail.
44// We work around the check here by removing the check for max in
45// the case where we have to emulate thread_local.
46#ifdef max
47#undef max
48#endif
49#include <unordered_map>
50
51#include "src/Core/util/Meta.h"
52#include "src/Core/util/MaxSizeVector.h"
53
Rasmus Munk Larsen96c42772023-05-09 19:36:17 +000054#ifndef EIGEN_MUTEX
55#define EIGEN_MUTEX std::mutex
56#endif
57#ifndef EIGEN_MUTEX_LOCK
58#define EIGEN_MUTEX_LOCK std::unique_lock<std::mutex>
59#endif
60#ifndef EIGEN_CONDVAR
61#define EIGEN_CONDVAR std::condition_variable
62#endif
63
Tobias Wood94f57862023-05-05 16:23:34 +000064// IWYU pragma: begin_exports
65#include "src/ThreadPool/ThreadLocal.h"
66#include "src/ThreadPool/ThreadYield.h"
67#include "src/ThreadPool/ThreadCancel.h"
68#include "src/ThreadPool/EventCount.h"
69#include "src/ThreadPool/RunQueue.h"
70#include "src/ThreadPool/ThreadPoolInterface.h"
71#include "src/ThreadPool/ThreadEnvironment.h"
72#include "src/ThreadPool/Barrier.h"
73#include "src/ThreadPool/NonBlockingThreadPool.h"
Charles Schlosser99adca82024-05-20 23:42:51 +000074#include "src/ThreadPool/CoreThreadPoolDevice.h"
Tobias Wood94f57862023-05-05 16:23:34 +000075// IWYU pragma: end_exports
76
77#include "src/Core/util/ReenableStupidWarnings.h"
78
Tobias Woodf38e16c2023-11-29 11:12:48 +000079#endif // EIGEN_CXX11_THREADPOOL_MODULE_H