mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 03:39:01 +08:00
Refactor the unsupported CXX11/Core module to internal headers only.
This commit is contained in:
parent
4a164d2c46
commit
3dddd34133
@ -1,4 +1,4 @@
|
|||||||
set(Eigen_CXX11_HEADERS Core Tensor TensorSymmetry)
|
set(Eigen_CXX11_HEADERS Tensor TensorSymmetry ThreadPool)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
${Eigen_CXX11_HEADERS}
|
${Eigen_CXX11_HEADERS}
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
// This file is part of Eigen, a lightweight C++ template library
|
|
||||||
// for linear algebra.
|
|
||||||
//
|
|
||||||
// Copyright (C) 2013 Christian Seiler <christian@iwakd.de>
|
|
||||||
// Copyright (C) 2014 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_CORE_MODULE
|
|
||||||
#define EIGEN_CXX11_CORE_MODULE
|
|
||||||
|
|
||||||
#include <Eigen/Core>
|
|
||||||
|
|
||||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
|
||||||
|
|
||||||
/** \defgroup CXX11_Core_Module C++11 Core Module
|
|
||||||
*
|
|
||||||
* This module provides common core features for all modules that
|
|
||||||
* explicitly depend on C++11. Currently, this is only the Tensor
|
|
||||||
* module. Note that at this stage, you should not need to include
|
|
||||||
* this module directly.
|
|
||||||
*
|
|
||||||
* It also provides a limited fallback for compilers that don't support
|
|
||||||
* CXX11 yet, such as nvcc.
|
|
||||||
*
|
|
||||||
* \code
|
|
||||||
* #include <Eigen/CXX11/Core>
|
|
||||||
* \endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "src/Core/util/EmulateArray.h"
|
|
||||||
#include "src/Core/util/MaxSizeVector.h"
|
|
||||||
|
|
||||||
// Emulate the cxx11 functionality that we need if the compiler doesn't support it.
|
|
||||||
// Visual studio 2015 doesn't advertise itself as cxx11 compliant, although it
|
|
||||||
// supports enough of the standard for our needs
|
|
||||||
#if __cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900
|
|
||||||
#include "src/Core/util/CXX11Workarounds.h"
|
|
||||||
#include "src/Core/util/CXX11Meta.h"
|
|
||||||
#else
|
|
||||||
#include "src/Core/util/EmulateCXX11Meta.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
|
|
||||||
|
|
||||||
#endif // EIGEN_CXX11_CORE_MODULE
|
|
||||||
|
|
@ -11,10 +11,10 @@
|
|||||||
//#ifndef EIGEN_CXX11_TENSOR_MODULE
|
//#ifndef EIGEN_CXX11_TENSOR_MODULE
|
||||||
//#define EIGEN_CXX11_TENSOR_MODULE
|
//#define EIGEN_CXX11_TENSOR_MODULE
|
||||||
|
|
||||||
#include "Core"
|
|
||||||
|
|
||||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||||
|
|
||||||
|
#include "src/util/CXX11Meta.h"
|
||||||
|
#include "src/util/MaxSizeVector.h"
|
||||||
|
|
||||||
/** \defgroup CXX11_Tensor_Module Tensor Module
|
/** \defgroup CXX11_Tensor_Module Tensor Module
|
||||||
*
|
*
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||||
|
|
||||||
|
#include "src/util/CXX11Meta.h"
|
||||||
|
|
||||||
/** \defgroup CXX11_TensorSymmetry_Module Tensor Symmetry Module
|
/** \defgroup CXX11_TensorSymmetry_Module Tensor Symmetry Module
|
||||||
*
|
*
|
||||||
* This module provides a classes that allow for the definition of
|
* This module provides a classes that allow for the definition of
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
#ifndef EIGEN_CXX11_THREADPOOL_MODULE
|
#ifndef EIGEN_CXX11_THREADPOOL_MODULE
|
||||||
#define EIGEN_CXX11_THREADPOOL_MODULE
|
#define EIGEN_CXX11_THREADPOOL_MODULE
|
||||||
|
|
||||||
#include "Core"
|
|
||||||
|
|
||||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||||
|
|
||||||
/** \defgroup CXX11_ThreadPool_Module C++11 ThreadPool Module
|
/** \defgroup CXX11_ThreadPool_Module C++11 ThreadPool Module
|
||||||
@ -45,6 +43,9 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "src/util/CXX11Meta.h"
|
||||||
|
#include "src/util/MaxSizeVector.h"
|
||||||
|
|
||||||
#include "src/ThreadPool/ThreadLocal.h"
|
#include "src/ThreadPool/ThreadLocal.h"
|
||||||
#include "src/ThreadPool/ThreadYield.h"
|
#include "src/ThreadPool/ThreadYield.h"
|
||||||
#include "src/ThreadPool/EventCount.h"
|
#include "src/ThreadPool/EventCount.h"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
add_subdirectory(Core)
|
add_subdirectory(util)
|
||||||
|
add_subdirectory(ThreadPool)
|
||||||
add_subdirectory(Tensor)
|
add_subdirectory(Tensor)
|
||||||
add_subdirectory(TensorSymmetry)
|
add_subdirectory(TensorSymmetry)
|
||||||
|
@ -1 +0,0 @@
|
|||||||
add_subdirectory(util)
|
|
@ -1,6 +0,0 @@
|
|||||||
FILE(GLOB Eigen_CXX11_Core_util_SRCS "*.h")
|
|
||||||
|
|
||||||
INSTALL(FILES
|
|
||||||
${Eigen_CXX11_Core_util_SRCS}
|
|
||||||
DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/CXX11/src/Core/util COMPONENT Devel
|
|
||||||
)
|
|
6
unsupported/Eigen/CXX11/src/ThreadPool/CMakeLists.txt
Normal file
6
unsupported/Eigen/CXX11/src/ThreadPool/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FILE(GLOB Eigen_CXX11_ThreadPool_SRCS "*.h")
|
||||||
|
|
||||||
|
INSTALL(FILES
|
||||||
|
${Eigen_CXX11_ThreadPool_SRCS}
|
||||||
|
DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/CXX11/src/ThreadPool COMPONENT Devel
|
||||||
|
)
|
6
unsupported/Eigen/CXX11/src/util/CMakeLists.txt
Normal file
6
unsupported/Eigen/CXX11/src/util/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FILE(GLOB Eigen_CXX11_util_SRCS "*.h")
|
||||||
|
|
||||||
|
INSTALL(FILES
|
||||||
|
${Eigen_CXX11_util_SRCS}
|
||||||
|
DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/CXX11/src/util COMPONENT Devel
|
||||||
|
)
|
@ -10,12 +10,22 @@
|
|||||||
#ifndef EIGEN_CXX11META_H
|
#ifndef EIGEN_CXX11META_H
|
||||||
#define EIGEN_CXX11META_H
|
#define EIGEN_CXX11META_H
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include "EmulateArray.h"
|
||||||
|
|
||||||
|
// Emulate the cxx11 functionality that we need if the compiler doesn't support it.
|
||||||
|
// Visual studio 2015 doesn't advertise itself as cxx11 compliant, although it
|
||||||
|
// supports enough of the standard for our needs
|
||||||
|
#if __cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900
|
||||||
|
|
||||||
|
#include "CXX11Workarounds.h"
|
||||||
|
|
||||||
namespace Eigen {
|
namespace Eigen {
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
/** \internal
|
/** \internal
|
||||||
* \file CXX11/Core/util/CXX11Meta.h
|
* \file CXX11/util/CXX11Meta.h
|
||||||
* This file contains generic metaprogramming classes which are not specifically related to Eigen.
|
* This file contains generic metaprogramming classes which are not specifically related to Eigen.
|
||||||
* This file expands upon Core/util/Meta.h and adds support for C++11 specific features.
|
* This file expands upon Core/util/Meta.h and adds support for C++11 specific features.
|
||||||
*/
|
*/
|
||||||
@ -523,4 +533,10 @@ InstType instantiate_by_c_array(ArrType* arr)
|
|||||||
|
|
||||||
} // end namespace Eigen
|
} // end namespace Eigen
|
||||||
|
|
||||||
|
#else // Non C++11, fallback to emulation mode
|
||||||
|
|
||||||
|
#include "src/Core/util/EmulateCXX11Meta.h"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // EIGEN_CXX11META_H
|
#endif // EIGEN_CXX11META_H
|
@ -222,7 +222,7 @@ template<class T, std::size_t N> struct array_size<const array<T,N>& > {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// The compiler supports c++11, and we're not targetting cuda: use std::array as Eigen array
|
// The compiler supports c++11, and we're not targetting cuda: use std::array as Eigen::array
|
||||||
#include <array>
|
#include <array>
|
||||||
namespace Eigen {
|
namespace Eigen {
|
||||||
|
|
||||||
@ -264,8 +264,4 @@ template<class T, std::size_t N> struct array_size<std::array<T,N> > {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // EIGEN_EMULATE_ARRAY_H
|
#endif // EIGEN_EMULATE_ARRAY_H
|
@ -17,7 +17,7 @@ namespace Eigen {
|
|||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
/** \internal
|
/** \internal
|
||||||
* \file CXX11/Core/util/EmulateCXX11Meta.h
|
* \file CXX11/util/EmulateCXX11Meta.h
|
||||||
* This file emulates a subset of the functionality provided by CXXMeta.h for
|
* This file emulates a subset of the functionality provided by CXXMeta.h for
|
||||||
* compilers that don't yet support cxx11 such as nvcc.
|
* compilers that don't yet support cxx11 such as nvcc.
|
||||||
*/
|
*/
|
@ -10,7 +10,7 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <Eigen/CXX11/Core>
|
#include <Eigen/CXX11/src/util/CXX11Meta.h>
|
||||||
|
|
||||||
using Eigen::internal::is_same;
|
using Eigen::internal::is_same;
|
||||||
using Eigen::internal::type_list;
|
using Eigen::internal::type_list;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user