Skip to content

Commit 1361bea

Browse files
committed
Eigen 3.4: update 'unsupported' #357 [skip ci]
1 parent a9d5ccb commit 1361bea

318 files changed

Lines changed: 40173 additions & 13988 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
add_subdirectory(Eigen)
2-
add_subdirectory(doc EXCLUDE_FROM_ALL)
3-
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
4-
add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest
5-
else()
6-
add_subdirectory(test EXCLUDE_FROM_ALL)
2+
if(EIGEN_BUILD_DOC)
3+
add_subdirectory(doc EXCLUDE_FROM_ALL)
4+
endif()
5+
if(BUILD_TESTING)
6+
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
7+
add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest
8+
else()
9+
add_subdirectory(test EXCLUDE_FROM_ALL)
10+
endif()
711
endif()

TMB/inst/include/unsupported/Eigen/AdolcForward

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# undef realloc
4141
#endif
4242

43-
#include <Eigen/Core>
43+
#include "../../Eigen/Core"
4444

4545
namespace Eigen {
4646

@@ -74,6 +74,9 @@ inline adouble imag(const adouble&) { return 0.; }
7474
inline adouble abs(const adouble& x) { return fabs(x); }
7575
inline adouble abs2(const adouble& x) { return x*x; }
7676

77+
inline bool (isinf)(const adouble& x) { return (Eigen::numext::isinf)(x.getValue()); }
78+
inline bool (isnan)(const adouble& x) { return (Eigen::numext::isnan)(x.getValue()); }
79+
7780
}
7881

7982
namespace Eigen {

TMB/inst/include/unsupported/Eigen/AlignedVector3

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
#ifndef EIGEN_ALIGNED_VECTOR3
1111
#define EIGEN_ALIGNED_VECTOR3
1212

13-
#include <Eigen/Geometry>
13+
#include "../../Eigen/Geometry"
14+
15+
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
1416

1517
namespace Eigen {
1618

@@ -76,6 +78,9 @@ template<typename _Scalar> class AlignedVector3
7678
{ return m_coeffs.coeffRef(index);}
7779

7880

81+
inline AlignedVector3()
82+
{}
83+
7984
inline AlignedVector3(const Scalar& x, const Scalar& y, const Scalar& z)
8085
: m_coeffs(x, y, z, Scalar(0))
8186
{}
@@ -129,6 +134,9 @@ template<typename _Scalar> class AlignedVector3
129134
inline AlignedVector3 operator-(const AlignedVector3& other) const
130135
{ return AlignedVector3(m_coeffs - other.m_coeffs); }
131136

137+
inline AlignedVector3 operator-() const
138+
{ return AlignedVector3(-m_coeffs); }
139+
132140
inline AlignedVector3 operator-=(const AlignedVector3& other)
133141
{ m_coeffs -= other.m_coeffs; return *this; }
134142

@@ -221,4 +229,6 @@ struct evaluator<AlignedVector3<Scalar> >
221229

222230
}
223231

232+
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
233+
224234
#endif // EIGEN_ALIGNED_VECTOR3

TMB/inst/include/unsupported/Eigen/ArpackSupport

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#ifndef EIGEN_ARPACKSUPPORT_MODULE_H
1010
#define EIGEN_ARPACKSUPPORT_MODULE_H
1111

12-
#include <Eigen/Core>
13-
14-
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
12+
#include "../../Eigen/Core"
1513

1614
/** \defgroup ArpackSupport_Module Arpack support module
1715
*
@@ -22,10 +20,11 @@
2220
* \endcode
2321
*/
2422

25-
#include <Eigen/SparseCholesky>
23+
#include "../../Eigen/SparseCholesky"
24+
25+
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
2626
#include "src/Eigenvalues/ArpackSelfAdjointEigenSolver.h"
2727

28-
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
28+
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
2929

3030
#endif // EIGEN_ARPACKSUPPORT_MODULE_H
31-
/* vim: set filetype=cpp et sw=2 ts=2 ai: */

TMB/inst/include/unsupported/Eigen/AutoDiff

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,17 @@ namespace Eigen {
2828
//@{
2929

3030
}
31+
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
32+
3133

3234
#include "src/AutoDiff/AutoDiffScalar.h"
3335
// #include "src/AutoDiff/AutoDiffVector.h"
3436
#include "src/AutoDiff/AutoDiffJacobian.h"
3537

38+
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
39+
40+
41+
3642
namespace Eigen {
3743
//@}
3844
}

TMB/inst/include/unsupported/Eigen/BVH

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#ifndef EIGEN_BVH_MODULE_H
1111
#define EIGEN_BVH_MODULE_H
1212

13-
#include <Eigen/Core>
14-
#include <Eigen/Geometry>
15-
#include <Eigen/StdVector>
13+
#include "../../Eigen/Core"
14+
#include "../../Eigen/Geometry"
15+
#include "../../Eigen/StdVector"
1616
#include <algorithm>
1717
#include <queue>
1818

TMB/inst/include/unsupported/Eigen/CXX11/Tensor

Lines changed: 32 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,11 @@
1313

1414
#include "../../../Eigen/Core"
1515

16-
#ifdef EIGEN_USE_SYCL
17-
#undef min
18-
#undef max
19-
#undef isnan
20-
#undef isinf
21-
#undef isfinite
22-
#include <SYCL/sycl.hpp>
23-
#include <map>
24-
#include <memory>
25-
#include <utility>
26-
#endif
27-
28-
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
16+
#if EIGEN_HAS_CXX11
2917

3018
#include "../SpecialFunctions"
19+
20+
#include "../../../Eigen/src/Core/util/DisableStupidWarnings.h"
3121
#include "src/util/CXX11Meta.h"
3222
#include "src/util/MaxSizeVector.h"
3323

@@ -39,46 +29,29 @@
3929
* \code
4030
* #include <Eigen/CXX11/Tensor>
4131
* \endcode
32+
*
33+
* Much of the documentation can be found \ref eigen_tensors "here".
4234
*/
4335

36+
#include <atomic>
37+
#include <chrono>
4438
#include <cmath>
4539
#include <cstddef>
4640
#include <cstring>
47-
48-
#ifdef _WIN32
49-
typedef __int16 int16_t;
50-
typedef unsigned __int16 uint16_t;
51-
typedef __int32 int32_t;
52-
typedef unsigned __int32 uint32_t;
53-
typedef __int64 int64_t;
54-
typedef unsigned __int64 uint64_t;
55-
#else
56-
#include <stdint.h>
57-
#endif
58-
59-
#if __cplusplus > 199711 || EIGEN_COMP_MSVC >= 1900
6041
#include <random>
61-
#endif
62-
63-
#ifdef _WIN32
64-
#include <windows.h>
65-
#elif defined(__APPLE__)
66-
#include <mach/mach_time.h>
67-
#else
68-
#include <time.h>
69-
#endif
42+
#include <thread>
7043

71-
#ifdef EIGEN_USE_THREADS
44+
#if defined(EIGEN_USE_THREADS) || defined(EIGEN_USE_SYCL)
7245
#include "ThreadPool"
7346
#endif
7447

7548
#ifdef EIGEN_USE_GPU
76-
#include <iostream>
77-
#include <cuda_runtime.h>
78-
#if __cplusplus >= 201103L
79-
#include <atomic>
80-
#include <unistd.h>
81-
#endif
49+
#include <iostream>
50+
#if defined(EIGEN_USE_HIP)
51+
#include <hip/hip_runtime.h>
52+
#else
53+
#include <cuda_runtime.h>
54+
#endif
8255
#endif
8356

8457
#include "src/Tensor/TensorMacros.h"
@@ -88,7 +61,10 @@ typedef unsigned __int64 uint64_t;
8861
#include "src/Tensor/TensorCostModel.h"
8962
#include "src/Tensor/TensorDeviceDefault.h"
9063
#include "src/Tensor/TensorDeviceThreadPool.h"
91-
#include "src/Tensor/TensorDeviceCuda.h"
64+
#include "src/Tensor/TensorDeviceGpu.h"
65+
#ifndef gpu_assert
66+
#define gpu_assert(x)
67+
#endif
9268
#include "src/Tensor/TensorDeviceSycl.h"
9369
#include "src/Tensor/TensorIndexList.h"
9470
#include "src/Tensor/TensorDimensionList.h"
@@ -101,18 +77,19 @@ typedef unsigned __int64 uint64_t;
10177
#include "src/Tensor/TensorGlobalFunctions.h"
10278

10379
#include "src/Tensor/TensorBase.h"
80+
#include "src/Tensor/TensorBlock.h"
10481

10582
#include "src/Tensor/TensorEvaluator.h"
10683
#include "src/Tensor/TensorExpr.h"
10784
#include "src/Tensor/TensorReduction.h"
108-
#include "src/Tensor/TensorReductionCuda.h"
85+
#include "src/Tensor/TensorReductionGpu.h"
10986
#include "src/Tensor/TensorArgMax.h"
11087
#include "src/Tensor/TensorConcatenation.h"
11188
#include "src/Tensor/TensorContractionMapper.h"
11289
#include "src/Tensor/TensorContractionBlocking.h"
11390
#include "src/Tensor/TensorContraction.h"
11491
#include "src/Tensor/TensorContractionThreadPool.h"
115-
#include "src/Tensor/TensorContractionCuda.h"
92+
#include "src/Tensor/TensorContractionGpu.h"
11693
#include "src/Tensor/TensorConversion.h"
11794
#include "src/Tensor/TensorConvolution.h"
11895
#include "src/Tensor/TensorFFT.h"
@@ -134,8 +111,15 @@ typedef unsigned __int64 uint64_t;
134111
#include "src/Tensor/TensorGenerator.h"
135112
#include "src/Tensor/TensorAssign.h"
136113
#include "src/Tensor/TensorScan.h"
114+
#include "src/Tensor/TensorTrace.h"
115+
116+
#ifdef EIGEN_USE_SYCL
117+
#include "src/Tensor/TensorReductionSycl.h"
118+
#include "src/Tensor/TensorConvolutionSycl.h"
119+
#include "src/Tensor/TensorContractionSycl.h"
120+
#include "src/Tensor/TensorScanSycl.h"
121+
#endif
137122

138-
#include "src/Tensor/TensorSycl.h"
139123
#include "src/Tensor/TensorExecutor.h"
140124
#include "src/Tensor/TensorDevice.h"
141125

@@ -147,6 +131,7 @@ typedef unsigned __int64 uint64_t;
147131

148132
#include "src/Tensor/TensorIO.h"
149133

150-
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
134+
#include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h"
151135

136+
#endif // EIGEN_HAS_CXX11
152137
//#endif // EIGEN_CXX11_TENSOR_MODULE

TMB/inst/include/unsupported/Eigen/CXX11/TensorSymmetry

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#ifndef EIGEN_CXX11_TENSORSYMMETRY_MODULE
1111
#define EIGEN_CXX11_TENSORSYMMETRY_MODULE
1212

13-
#include <unsupported/Eigen/CXX11/Tensor>
13+
#include "Tensor"
1414

15-
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
15+
#include "../../../Eigen/src/Core/util/DisableStupidWarnings.h"
1616

1717
#include "src/util/CXX11Meta.h"
1818

@@ -33,7 +33,7 @@
3333
#include "src/TensorSymmetry/StaticSymmetry.h"
3434
#include "src/TensorSymmetry/DynamicSymmetry.h"
3535

36-
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
36+
#include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h"
3737

3838
#endif // EIGEN_CXX11_TENSORSYMMETRY_MODULE
3939

TMB/inst/include/unsupported/Eigen/CXX11/ThreadPool

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "../../../Eigen/Core"
1414

15-
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
15+
#include "../../../Eigen/src/Core/util/DisableStupidWarnings.h"
1616

1717
/** \defgroup CXX11_ThreadPool_Module C++11 ThreadPool Module
1818
*
@@ -30,10 +30,9 @@
3030

3131
// The code depends on CXX11, so only include the module if the
3232
// compiler supports it.
33-
#if __cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900
33+
#if (EIGEN_COMP_CXXVER >= 11)
3434
#include <cstddef>
3535
#include <cstring>
36-
#include <stdint.h>
3736
#include <time.h>
3837

3938
#include <vector>
@@ -44,22 +43,32 @@
4443
#include <thread>
4544
#include <functional>
4645
#include <memory>
46+
#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>
4756

4857
#include "src/util/CXX11Meta.h"
4958
#include "src/util/MaxSizeVector.h"
5059

5160
#include "src/ThreadPool/ThreadLocal.h"
5261
#include "src/ThreadPool/ThreadYield.h"
62+
#include "src/ThreadPool/ThreadCancel.h"
5363
#include "src/ThreadPool/EventCount.h"
5464
#include "src/ThreadPool/RunQueue.h"
5565
#include "src/ThreadPool/ThreadPoolInterface.h"
5666
#include "src/ThreadPool/ThreadEnvironment.h"
57-
#include "src/ThreadPool/SimpleThreadPool.h"
67+
#include "src/ThreadPool/Barrier.h"
5868
#include "src/ThreadPool/NonBlockingThreadPool.h"
5969

6070
#endif
6171

62-
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
72+
#include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h"
6373

6474
#endif // EIGEN_CXX11_THREADPOOL_MODULE
65-

0 commit comments

Comments
 (0)