2016-04-15 06:23:10 +08:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
|
|
|
// for linear algebra.
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016 Benoit Steiner <benoit.steiner.goog@gmail.com>
|
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
|
|
// 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/.
|
|
|
|
|
|
|
|
#ifndef EIGEN_CXX11_THREADPOOL_MODULE
|
|
|
|
#define EIGEN_CXX11_THREADPOOL_MODULE
|
|
|
|
|
2016-04-28 05:05:40 +08:00
|
|
|
#include "../../../Eigen/Core"
|
|
|
|
|
2016-04-15 06:23:10 +08:00
|
|
|
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
|
|
|
|
|
|
|
/** \defgroup CXX11_ThreadPool_Module C++11 ThreadPool Module
|
|
|
|
*
|
|
|
|
* This module provides 2 threadpool implementations
|
|
|
|
* - a simple reference implementation
|
|
|
|
* - a faster non blocking implementation
|
|
|
|
*
|
|
|
|
* This module requires C++11.
|
|
|
|
*
|
|
|
|
* \code
|
|
|
|
* #include <Eigen/CXX11/ThreadPool>
|
|
|
|
* \endcode
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2016-04-15 07:41:31 +08:00
|
|
|
// The code depends on CXX11, so only include the module if the
|
|
|
|
// compiler supports it.
|
2016-04-15 06:23:10 +08:00
|
|
|
#if __cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900
|
|
|
|
#include <cstddef>
|
|
|
|
#include <cstring>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <atomic>
|
|
|
|
#include <condition_variable>
|
|
|
|
#include <deque>
|
|
|
|
#include <mutex>
|
|
|
|
#include <thread>
|
|
|
|
#include <functional>
|
|
|
|
#include <memory>
|
2018-08-25 01:24:54 +08:00
|
|
|
#include "src/util/CXX11Meta.h"
|
|
|
|
#include "src/util/MaxSizeVector.h"
|
|
|
|
|
|
|
|
#include "src/ThreadPool/ThreadLocal.h"
|
2018-08-14 06:31:23 +08:00
|
|
|
#ifndef EIGEN_THREAD_LOCAL
|
|
|
|
// There are non-parenthesized calls to "max" in the <unordered_map> header,
|
|
|
|
// which trigger a check in test/main.h causing compilation to fail.
|
|
|
|
// We work around the check here by removing the check for max in
|
|
|
|
// the case where we have to emulate thread_local.
|
2018-08-24 02:42:05 +08:00
|
|
|
#ifdef max
|
2018-08-14 06:31:23 +08:00
|
|
|
#undef max
|
2018-08-24 02:42:05 +08:00
|
|
|
#endif
|
2018-08-14 06:31:23 +08:00
|
|
|
#include <unordered_map>
|
|
|
|
#endif
|
2016-04-20 08:59:58 +08:00
|
|
|
#include "src/ThreadPool/ThreadYield.h"
|
2016-12-09 00:12:49 +08:00
|
|
|
#include "src/ThreadPool/ThreadCancel.h"
|
2016-04-15 06:23:10 +08:00
|
|
|
#include "src/ThreadPool/EventCount.h"
|
|
|
|
#include "src/ThreadPool/RunQueue.h"
|
|
|
|
#include "src/ThreadPool/ThreadPoolInterface.h"
|
|
|
|
#include "src/ThreadPool/ThreadEnvironment.h"
|
2018-08-14 06:31:23 +08:00
|
|
|
#include "src/ThreadPool/Barrier.h"
|
2016-04-15 06:23:10 +08:00
|
|
|
#include "src/ThreadPool/NonBlockingThreadPool.h"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
|
|
|
|
|
|
|
|
#endif // EIGEN_CXX11_THREADPOOL_MODULE
|