@smake/eigen 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/eigen/COPYING.APACHE +203 -0
- package/eigen/COPYING.BSD +26 -0
- package/eigen/COPYING.GPL +674 -0
- package/eigen/COPYING.LGPL +502 -0
- package/eigen/COPYING.MINPACK +51 -0
- package/eigen/COPYING.MPL2 +373 -0
- package/eigen/COPYING.README +18 -0
- package/eigen/Eigen/Cholesky +0 -1
- package/eigen/Eigen/Core +108 -266
- package/eigen/Eigen/Eigenvalues +0 -1
- package/eigen/Eigen/Geometry +3 -6
- package/eigen/Eigen/Householder +0 -1
- package/eigen/Eigen/Jacobi +0 -1
- package/eigen/Eigen/KLUSupport +41 -0
- package/eigen/Eigen/LU +2 -5
- package/eigen/Eigen/OrderingMethods +0 -3
- package/eigen/Eigen/PaStiXSupport +1 -0
- package/eigen/Eigen/PardisoSupport +0 -0
- package/eigen/Eigen/QR +0 -1
- package/eigen/Eigen/QtAlignedMalloc +0 -1
- package/eigen/Eigen/SVD +0 -1
- package/eigen/Eigen/Sparse +0 -2
- package/eigen/Eigen/SparseCholesky +0 -8
- package/eigen/Eigen/SparseLU +4 -0
- package/eigen/Eigen/src/Cholesky/LDLT.h +42 -27
- package/eigen/Eigen/src/Cholesky/LLT.h +39 -23
- package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +90 -47
- package/eigen/Eigen/src/Core/ArithmeticSequence.h +413 -0
- package/eigen/Eigen/src/Core/Array.h +99 -11
- package/eigen/Eigen/src/Core/ArrayBase.h +1 -1
- package/eigen/Eigen/src/Core/ArrayWrapper.h +21 -21
- package/eigen/Eigen/src/Core/Assign.h +1 -1
- package/eigen/Eigen/src/Core/AssignEvaluator.h +125 -50
- package/eigen/Eigen/src/Core/Assign_MKL.h +10 -10
- package/eigen/Eigen/src/Core/BandMatrix.h +16 -16
- package/eigen/Eigen/src/Core/Block.h +56 -60
- package/eigen/Eigen/src/Core/BooleanRedux.h +29 -31
- package/eigen/Eigen/src/Core/CommaInitializer.h +7 -3
- package/eigen/Eigen/src/Core/CoreEvaluators.h +325 -272
- package/eigen/Eigen/src/Core/CoreIterators.h +5 -0
- package/eigen/Eigen/src/Core/CwiseBinaryOp.h +21 -22
- package/eigen/Eigen/src/Core/CwiseNullaryOp.h +153 -18
- package/eigen/Eigen/src/Core/CwiseUnaryOp.h +6 -6
- package/eigen/Eigen/src/Core/CwiseUnaryView.h +12 -10
- package/eigen/Eigen/src/Core/DenseBase.h +128 -39
- package/eigen/Eigen/src/Core/DenseCoeffsBase.h +25 -21
- package/eigen/Eigen/src/Core/DenseStorage.h +150 -68
- package/eigen/Eigen/src/Core/Diagonal.h +21 -23
- package/eigen/Eigen/src/Core/DiagonalMatrix.h +50 -2
- package/eigen/Eigen/src/Core/DiagonalProduct.h +1 -1
- package/eigen/Eigen/src/Core/Dot.h +10 -10
- package/eigen/Eigen/src/Core/EigenBase.h +10 -9
- package/eigen/Eigen/src/Core/ForceAlignedAccess.h +8 -4
- package/eigen/Eigen/src/Core/Fuzzy.h +3 -3
- package/eigen/Eigen/src/Core/GeneralProduct.h +20 -10
- package/eigen/Eigen/src/Core/GenericPacketMath.h +597 -147
- package/eigen/Eigen/src/Core/GlobalFunctions.h +40 -33
- package/eigen/Eigen/src/Core/IO.h +40 -7
- package/eigen/Eigen/src/Core/IndexedView.h +237 -0
- package/eigen/Eigen/src/Core/Inverse.h +9 -10
- package/eigen/Eigen/src/Core/Map.h +7 -7
- package/eigen/Eigen/src/Core/MapBase.h +5 -3
- package/eigen/Eigen/src/Core/MathFunctions.h +756 -120
- package/eigen/Eigen/src/Core/MathFunctionsImpl.h +118 -19
- package/eigen/Eigen/src/Core/Matrix.h +131 -25
- package/eigen/Eigen/src/Core/MatrixBase.h +19 -2
- package/eigen/Eigen/src/Core/NestByValue.h +25 -50
- package/eigen/Eigen/src/Core/NoAlias.h +4 -3
- package/eigen/Eigen/src/Core/NumTraits.h +107 -20
- package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
- package/eigen/Eigen/src/Core/PermutationMatrix.h +3 -3
- package/eigen/Eigen/src/Core/PlainObjectBase.h +145 -54
- package/eigen/Eigen/src/Core/Product.h +30 -25
- package/eigen/Eigen/src/Core/ProductEvaluators.h +183 -142
- package/eigen/Eigen/src/Core/Random.h +37 -1
- package/eigen/Eigen/src/Core/Redux.h +180 -170
- package/eigen/Eigen/src/Core/Ref.h +118 -21
- package/eigen/Eigen/src/Core/Replicate.h +8 -8
- package/eigen/Eigen/src/Core/Reshaped.h +454 -0
- package/eigen/Eigen/src/Core/ReturnByValue.h +7 -5
- package/eigen/Eigen/src/Core/Reverse.h +18 -12
- package/eigen/Eigen/src/Core/Select.h +8 -6
- package/eigen/Eigen/src/Core/SelfAdjointView.h +33 -20
- package/eigen/Eigen/src/Core/Solve.h +14 -14
- package/eigen/Eigen/src/Core/SolveTriangular.h +13 -13
- package/eigen/Eigen/src/Core/SolverBase.h +41 -3
- package/eigen/Eigen/src/Core/StableNorm.h +100 -70
- package/eigen/Eigen/src/Core/StlIterators.h +463 -0
- package/eigen/Eigen/src/Core/Stride.h +9 -4
- package/eigen/Eigen/src/Core/Swap.h +5 -4
- package/eigen/Eigen/src/Core/Transpose.h +86 -27
- package/eigen/Eigen/src/Core/Transpositions.h +26 -8
- package/eigen/Eigen/src/Core/TriangularMatrix.h +88 -72
- package/eigen/Eigen/src/Core/VectorBlock.h +5 -5
- package/eigen/Eigen/src/Core/VectorwiseOp.h +159 -70
- package/eigen/Eigen/src/Core/Visitor.h +137 -29
- package/eigen/Eigen/src/Core/arch/AVX/Complex.h +50 -129
- package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +126 -337
- package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +1092 -155
- package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +65 -1
- package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
- package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +186 -213
- package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +1250 -252
- package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +152 -165
- package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +19 -251
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
- package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +2042 -392
- package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +235 -80
- package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
- package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +102 -14
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
- package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
- package/eigen/Eigen/src/Core/arch/Default/Half.h +942 -0
- package/eigen/Eigen/src/Core/arch/Default/Settings.h +1 -1
- package/eigen/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
- package/eigen/Eigen/src/Core/arch/{CUDA → GPU}/MathFunctions.h +16 -4
- package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
- package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
- package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- package/eigen/Eigen/src/Core/arch/MSA/Complex.h +648 -0
- package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
- package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
- package/eigen/Eigen/src/Core/arch/NEON/Complex.h +313 -219
- package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
- package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +54 -70
- package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +4376 -549
- package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
- package/eigen/Eigen/src/Core/arch/SSE/Complex.h +59 -179
- package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +65 -428
- package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +893 -283
- package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +65 -0
- package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
- package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
- package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
- package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
- package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
- package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
- package/eigen/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
- package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
- package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +212 -183
- package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +101 -5
- package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +510 -395
- package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +11 -2
- package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +112 -46
- package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +31 -30
- package/eigen/Eigen/src/Core/functors/StlFunctors.h +32 -2
- package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +354 -15
- package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +1073 -585
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +29 -7
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +4 -4
- package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +1 -1
- package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +382 -483
- package/eigen/Eigen/src/Core/products/Parallelizer.h +23 -9
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +23 -6
- package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +8 -6
- package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +2 -2
- package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +5 -4
- package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +3 -3
- package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +5 -3
- package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +13 -10
- package/eigen/Eigen/src/Core/util/BlasUtil.h +208 -124
- package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
- package/eigen/Eigen/src/Core/util/Constants.h +25 -9
- package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +14 -2
- package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +28 -4
- package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
- package/eigen/Eigen/src/Core/util/IntegralConstant.h +272 -0
- package/eigen/Eigen/src/Core/util/MKL_support.h +8 -1
- package/eigen/Eigen/src/Core/util/Macros.h +661 -250
- package/eigen/Eigen/src/Core/util/Memory.h +222 -52
- package/eigen/Eigen/src/Core/util/Meta.h +349 -105
- package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- package/eigen/Eigen/src/Core/util/StaticAssert.h +8 -5
- package/eigen/Eigen/src/Core/util/SymbolicIndex.h +293 -0
- package/eigen/Eigen/src/Core/util/XprHelper.h +48 -30
- package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +1 -1
- package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +2 -2
- package/eigen/Eigen/src/Eigenvalues/RealQZ.h +9 -6
- package/eigen/Eigen/src/Eigenvalues/RealSchur.h +10 -5
- package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +75 -42
- package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +20 -15
- package/eigen/Eigen/src/Geometry/AlignedBox.h +99 -5
- package/eigen/Eigen/src/Geometry/AngleAxis.h +4 -4
- package/eigen/Eigen/src/Geometry/EulerAngles.h +3 -3
- package/eigen/Eigen/src/Geometry/Homogeneous.h +15 -11
- package/eigen/Eigen/src/Geometry/Hyperplane.h +1 -1
- package/eigen/Eigen/src/Geometry/OrthoMethods.h +3 -2
- package/eigen/Eigen/src/Geometry/ParametrizedLine.h +39 -2
- package/eigen/Eigen/src/Geometry/Quaternion.h +52 -14
- package/eigen/Eigen/src/Geometry/Rotation2D.h +3 -3
- package/eigen/Eigen/src/Geometry/Scaling.h +22 -4
- package/eigen/Eigen/src/Geometry/Transform.h +86 -65
- package/eigen/Eigen/src/Geometry/Translation.h +6 -6
- package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
- package/eigen/Eigen/src/Householder/BlockHouseholder.h +9 -2
- package/eigen/Eigen/src/Householder/Householder.h +8 -4
- package/eigen/Eigen/src/Householder/HouseholderSequence.h +123 -48
- package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +15 -15
- package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +7 -23
- package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +5 -22
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +41 -47
- package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +51 -60
- package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +70 -20
- package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +2 -20
- package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +11 -9
- package/eigen/Eigen/src/Jacobi/Jacobi.h +31 -10
- package/eigen/Eigen/src/KLUSupport/KLUSupport.h +358 -0
- package/eigen/Eigen/src/LU/Determinant.h +35 -19
- package/eigen/Eigen/src/LU/FullPivLU.h +29 -43
- package/eigen/Eigen/src/LU/InverseImpl.h +25 -8
- package/eigen/Eigen/src/LU/PartialPivLU.h +67 -57
- package/eigen/Eigen/src/LU/arch/InverseSize4.h +351 -0
- package/eigen/Eigen/src/OrderingMethods/Amd.h +7 -17
- package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +297 -277
- package/eigen/Eigen/src/OrderingMethods/Ordering.h +6 -10
- package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +1 -1
- package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +10 -9
- package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +41 -20
- package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +100 -27
- package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +59 -22
- package/eigen/Eigen/src/QR/HouseholderQR.h +48 -23
- package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +25 -3
- package/eigen/Eigen/src/SVD/BDCSVD.h +137 -48
- package/eigen/Eigen/src/SVD/JacobiSVD.h +22 -14
- package/eigen/Eigen/src/SVD/SVDBase.h +82 -21
- package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +3 -3
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +16 -8
- package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +11 -36
- package/eigen/Eigen/src/SparseCore/CompressedStorage.h +16 -0
- package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +6 -6
- package/eigen/Eigen/src/SparseCore/SparseAssign.h +81 -27
- package/eigen/Eigen/src/SparseCore/SparseBlock.h +25 -57
- package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +40 -11
- package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +11 -15
- package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +2 -2
- package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +30 -8
- package/eigen/Eigen/src/SparseCore/SparseMatrix.h +124 -10
- package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +5 -12
- package/eigen/Eigen/src/SparseCore/SparseProduct.h +13 -1
- package/eigen/Eigen/src/SparseCore/SparseRef.h +7 -7
- package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +3 -0
- package/eigen/Eigen/src/SparseCore/SparseUtil.h +8 -0
- package/eigen/Eigen/src/SparseCore/SparseVector.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU.h +160 -10
- package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +76 -2
- package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +2 -2
- package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +1 -1
- package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +1 -1
- package/eigen/Eigen/src/SparseQR/SparseQR.h +19 -6
- package/eigen/Eigen/src/StlSupport/StdDeque.h +2 -14
- package/eigen/Eigen/src/StlSupport/StdList.h +2 -2
- package/eigen/Eigen/src/StlSupport/StdVector.h +2 -2
- package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +6 -8
- package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +175 -39
- package/eigen/Eigen/src/misc/lapacke.h +5 -4
- package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +27 -1
- package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +155 -11
- package/eigen/Eigen/src/plugins/BlockMethods.h +626 -242
- package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +14 -0
- package/eigen/Eigen/src/plugins/IndexedViewMethods.h +262 -0
- package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +4 -4
- package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +10 -0
- package/eigen/Eigen/src/plugins/ReshapedMethods.h +149 -0
- package/eigen/README.md +5 -0
- package/lib/LibEigen.d.ts +4 -0
- package/lib/LibEigen.js +14 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -3
- package/package.json +2 -10
- package/eigen/Eigen/CMakeLists.txt +0 -19
- package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
- package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
- package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
- package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
- package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
- package/lib/eigen.d.ts +0 -2
- package/lib/eigen.js +0 -15
|
@@ -11,19 +11,56 @@
|
|
|
11
11
|
#ifndef EIGEN_MACROS_H
|
|
12
12
|
#define EIGEN_MACROS_H
|
|
13
13
|
|
|
14
|
+
//------------------------------------------------------------------------------------------
|
|
15
|
+
// Eigen version and basic defaults
|
|
16
|
+
//------------------------------------------------------------------------------------------
|
|
17
|
+
|
|
14
18
|
#define EIGEN_WORLD_VERSION 3
|
|
15
|
-
#define EIGEN_MAJOR_VERSION
|
|
16
|
-
#define EIGEN_MINOR_VERSION
|
|
19
|
+
#define EIGEN_MAJOR_VERSION 4
|
|
20
|
+
#define EIGEN_MINOR_VERSION 0
|
|
17
21
|
|
|
18
22
|
#define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
|
|
19
23
|
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
|
|
20
24
|
EIGEN_MINOR_VERSION>=z))))
|
|
21
25
|
|
|
26
|
+
#ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
|
|
27
|
+
#define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor
|
|
28
|
+
#else
|
|
29
|
+
#define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::ColMajor
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#ifndef EIGEN_DEFAULT_DENSE_INDEX_TYPE
|
|
33
|
+
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE std::ptrdiff_t
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
// Upperbound on the C++ version to use.
|
|
37
|
+
// Expected values are 03, 11, 14, 17, etc.
|
|
38
|
+
// By default, let's use an arbitrarily large C++ version.
|
|
39
|
+
#ifndef EIGEN_MAX_CPP_VER
|
|
40
|
+
#define EIGEN_MAX_CPP_VER 99
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
/** Allows to disable some optimizations which might affect the accuracy of the result.
|
|
44
|
+
* Such optimization are enabled by default, and set EIGEN_FAST_MATH to 0 to disable them.
|
|
45
|
+
* They currently include:
|
|
46
|
+
* - single precision ArrayBase::sin() and ArrayBase::cos() for SSE and AVX vectorization.
|
|
47
|
+
*/
|
|
48
|
+
#ifndef EIGEN_FAST_MATH
|
|
49
|
+
#define EIGEN_FAST_MATH 1
|
|
50
|
+
#endif
|
|
51
|
+
|
|
52
|
+
#ifndef EIGEN_STACK_ALLOCATION_LIMIT
|
|
53
|
+
// 131072 == 128 KB
|
|
54
|
+
#define EIGEN_STACK_ALLOCATION_LIMIT 131072
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
//------------------------------------------------------------------------------------------
|
|
22
58
|
// Compiler identification, EIGEN_COMP_*
|
|
59
|
+
//------------------------------------------------------------------------------------------
|
|
23
60
|
|
|
24
61
|
/// \internal EIGEN_COMP_GNUC set to 1 for all compilers compatible with GCC
|
|
25
62
|
#ifdef __GNUC__
|
|
26
|
-
#define EIGEN_COMP_GNUC
|
|
63
|
+
#define EIGEN_COMP_GNUC (__GNUC__*10+__GNUC_MINOR__)
|
|
27
64
|
#else
|
|
28
65
|
#define EIGEN_COMP_GNUC 0
|
|
29
66
|
#endif
|
|
@@ -35,6 +72,12 @@
|
|
|
35
72
|
#define EIGEN_COMP_CLANG 0
|
|
36
73
|
#endif
|
|
37
74
|
|
|
75
|
+
/// \internal EIGEN_COMP_CASTXML set to 1 if being preprocessed by CastXML
|
|
76
|
+
#if defined(__castxml__)
|
|
77
|
+
#define EIGEN_COMP_CASTXML 1
|
|
78
|
+
#else
|
|
79
|
+
#define EIGEN_COMP_CASTXML 0
|
|
80
|
+
#endif
|
|
38
81
|
|
|
39
82
|
/// \internal EIGEN_COMP_LLVM set to 1 if the compiler backend is llvm
|
|
40
83
|
#if defined(__llvm__)
|
|
@@ -71,14 +114,44 @@
|
|
|
71
114
|
#define EIGEN_COMP_MSVC 0
|
|
72
115
|
#endif
|
|
73
116
|
|
|
117
|
+
#if defined(__NVCC__)
|
|
118
|
+
#if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9)
|
|
119
|
+
#define EIGEN_COMP_NVCC ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100))
|
|
120
|
+
#elif defined(__CUDACC_VER__)
|
|
121
|
+
#define EIGEN_COMP_NVCC __CUDACC_VER__
|
|
122
|
+
#else
|
|
123
|
+
#error "NVCC did not define compiler version."
|
|
124
|
+
#endif
|
|
125
|
+
#else
|
|
126
|
+
#define EIGEN_COMP_NVCC 0
|
|
127
|
+
#endif
|
|
128
|
+
|
|
74
129
|
// For the record, here is a table summarizing the possible values for EIGEN_COMP_MSVC:
|
|
75
|
-
// name
|
|
76
|
-
// 2008
|
|
77
|
-
// 2010
|
|
78
|
-
// 2012
|
|
79
|
-
// 2013
|
|
80
|
-
// 2015
|
|
81
|
-
// "15"
|
|
130
|
+
// name ver MSC_VER
|
|
131
|
+
// 2008 9 1500
|
|
132
|
+
// 2010 10 1600
|
|
133
|
+
// 2012 11 1700
|
|
134
|
+
// 2013 12 1800
|
|
135
|
+
// 2015 14 1900
|
|
136
|
+
// "15" 15 1900
|
|
137
|
+
// 2017-14.1 15.0 1910
|
|
138
|
+
// 2017-14.11 15.3 1911
|
|
139
|
+
// 2017-14.12 15.5 1912
|
|
140
|
+
// 2017-14.13 15.6 1913
|
|
141
|
+
// 2017-14.14 15.7 1914
|
|
142
|
+
|
|
143
|
+
/// \internal EIGEN_COMP_MSVC_LANG set to _MSVC_LANG if the compiler is Microsoft Visual C++, 0 otherwise.
|
|
144
|
+
#if defined(_MSVC_LANG)
|
|
145
|
+
#define EIGEN_COMP_MSVC_LANG _MSVC_LANG
|
|
146
|
+
#else
|
|
147
|
+
#define EIGEN_COMP_MSVC_LANG 0
|
|
148
|
+
#endif
|
|
149
|
+
|
|
150
|
+
// For the record, here is a table summarizing the possible values for EIGEN_COMP_MSVC_LANG:
|
|
151
|
+
// MSVC option Standard MSVC_LANG
|
|
152
|
+
// /std:c++14 (default as of VS 2019) C++14 201402L
|
|
153
|
+
// /std:c++17 C++17 201703L
|
|
154
|
+
// /std:c++latest >C++17 >201703L
|
|
82
155
|
|
|
83
156
|
/// \internal EIGEN_COMP_MSVC_STRICT set to 1 if the compiler is really Microsoft Visual C++ and not ,e.g., ICC or clang-cl
|
|
84
157
|
#if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC || EIGEN_COMP_LLVM || EIGEN_COMP_CLANG)
|
|
@@ -87,16 +160,21 @@
|
|
|
87
160
|
#define EIGEN_COMP_MSVC_STRICT 0
|
|
88
161
|
#endif
|
|
89
162
|
|
|
90
|
-
/// \internal EIGEN_COMP_IBM set to
|
|
91
|
-
|
|
92
|
-
|
|
163
|
+
/// \internal EIGEN_COMP_IBM set to xlc version if the compiler is IBM XL C++
|
|
164
|
+
// XLC version
|
|
165
|
+
// 3.1 0x0301
|
|
166
|
+
// 4.5 0x0405
|
|
167
|
+
// 5.0 0x0500
|
|
168
|
+
// 12.1 0x0C01
|
|
169
|
+
#if defined(__IBMCPP__) || defined(__xlc__) || defined(__ibmxl__)
|
|
170
|
+
#define EIGEN_COMP_IBM __xlC__
|
|
93
171
|
#else
|
|
94
172
|
#define EIGEN_COMP_IBM 0
|
|
95
173
|
#endif
|
|
96
174
|
|
|
97
|
-
/// \internal EIGEN_COMP_PGI set to
|
|
175
|
+
/// \internal EIGEN_COMP_PGI set to PGI version if the compiler is Portland Group Compiler
|
|
98
176
|
#if defined(__PGI)
|
|
99
|
-
#define EIGEN_COMP_PGI
|
|
177
|
+
#define EIGEN_COMP_PGI (__PGIC__*100+__PGIC_MINOR__)
|
|
100
178
|
#else
|
|
101
179
|
#define EIGEN_COMP_PGI 0
|
|
102
180
|
#endif
|
|
@@ -108,7 +186,7 @@
|
|
|
108
186
|
#define EIGEN_COMP_ARM 0
|
|
109
187
|
#endif
|
|
110
188
|
|
|
111
|
-
/// \internal
|
|
189
|
+
/// \internal EIGEN_COMP_EMSCRIPTEN set to 1 if the compiler is Emscripten Compiler
|
|
112
190
|
#if defined(__EMSCRIPTEN__)
|
|
113
191
|
#define EIGEN_COMP_EMSCRIPTEN 1
|
|
114
192
|
#else
|
|
@@ -142,9 +220,13 @@
|
|
|
142
220
|
#endif
|
|
143
221
|
|
|
144
222
|
|
|
223
|
+
|
|
224
|
+
//------------------------------------------------------------------------------------------
|
|
145
225
|
// Architecture identification, EIGEN_ARCH_*
|
|
226
|
+
//------------------------------------------------------------------------------------------
|
|
146
227
|
|
|
147
|
-
|
|
228
|
+
|
|
229
|
+
#if defined(__x86_64__) || (defined(_M_X64) && !defined(_M_ARM64EC)) || defined(__amd64)
|
|
148
230
|
#define EIGEN_ARCH_x86_64 1
|
|
149
231
|
#else
|
|
150
232
|
#define EIGEN_ARCH_x86_64 0
|
|
@@ -170,18 +252,61 @@
|
|
|
170
252
|
#endif
|
|
171
253
|
|
|
172
254
|
/// \internal EIGEN_ARCH_ARM64 set to 1 if the architecture is ARM64
|
|
173
|
-
#if defined(__aarch64__)
|
|
255
|
+
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
|
|
174
256
|
#define EIGEN_ARCH_ARM64 1
|
|
175
257
|
#else
|
|
176
258
|
#define EIGEN_ARCH_ARM64 0
|
|
177
259
|
#endif
|
|
178
260
|
|
|
261
|
+
/// \internal EIGEN_ARCH_ARM_OR_ARM64 set to 1 if the architecture is ARM or ARM64
|
|
179
262
|
#if EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64
|
|
180
263
|
#define EIGEN_ARCH_ARM_OR_ARM64 1
|
|
181
264
|
#else
|
|
182
265
|
#define EIGEN_ARCH_ARM_OR_ARM64 0
|
|
183
266
|
#endif
|
|
184
267
|
|
|
268
|
+
/// \internal EIGEN_ARCH_ARMV8 set to 1 if the architecture is armv8 or greater.
|
|
269
|
+
#if EIGEN_ARCH_ARM_OR_ARM64 && defined(__ARM_ARCH) && __ARM_ARCH >= 8
|
|
270
|
+
#define EIGEN_ARCH_ARMV8 1
|
|
271
|
+
#else
|
|
272
|
+
#define EIGEN_ARCH_ARMV8 0
|
|
273
|
+
#endif
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
/// \internal EIGEN_HAS_ARM64_FP16 set to 1 if the architecture provides an IEEE
|
|
277
|
+
/// compliant Arm fp16 type
|
|
278
|
+
#if EIGEN_ARCH_ARM64
|
|
279
|
+
#ifndef EIGEN_HAS_ARM64_FP16
|
|
280
|
+
#if defined(__ARM_FP16_FORMAT_IEEE)
|
|
281
|
+
#define EIGEN_HAS_ARM64_FP16 1
|
|
282
|
+
#else
|
|
283
|
+
#define EIGEN_HAS_ARM64_FP16 0
|
|
284
|
+
#endif
|
|
285
|
+
#endif
|
|
286
|
+
#endif
|
|
287
|
+
|
|
288
|
+
/// \internal EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC set to 1 if the architecture
|
|
289
|
+
/// supports Neon vector intrinsics for fp16.
|
|
290
|
+
#if EIGEN_ARCH_ARM64
|
|
291
|
+
#ifndef EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC
|
|
292
|
+
#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
|
|
293
|
+
#define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 1
|
|
294
|
+
#else
|
|
295
|
+
#define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 0
|
|
296
|
+
#endif
|
|
297
|
+
#endif
|
|
298
|
+
#endif
|
|
299
|
+
|
|
300
|
+
/// \internal EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC set to 1 if the architecture
|
|
301
|
+
/// supports Neon scalar intrinsics for fp16.
|
|
302
|
+
#if EIGEN_ARCH_ARM64
|
|
303
|
+
#ifndef EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC
|
|
304
|
+
#if defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC)
|
|
305
|
+
#define EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC 1
|
|
306
|
+
#endif
|
|
307
|
+
#endif
|
|
308
|
+
#endif
|
|
309
|
+
|
|
185
310
|
/// \internal EIGEN_ARCH_MIPS set to 1 if the architecture is MIPS
|
|
186
311
|
#if defined(__mips__) || defined(__mips)
|
|
187
312
|
#define EIGEN_ARCH_MIPS 1
|
|
@@ -212,7 +337,9 @@
|
|
|
212
337
|
|
|
213
338
|
|
|
214
339
|
|
|
340
|
+
//------------------------------------------------------------------------------------------
|
|
215
341
|
// Operating system identification, EIGEN_OS_*
|
|
342
|
+
//------------------------------------------------------------------------------------------
|
|
216
343
|
|
|
217
344
|
/// \internal EIGEN_OS_UNIX set to 1 if the OS is a unix variant
|
|
218
345
|
#if defined(__unix__) || defined(__unix)
|
|
@@ -299,9 +426,17 @@
|
|
|
299
426
|
#define EIGEN_OS_WIN_STRICT 0
|
|
300
427
|
#endif
|
|
301
428
|
|
|
302
|
-
/// \internal EIGEN_OS_SUN set to
|
|
429
|
+
/// \internal EIGEN_OS_SUN set to __SUNPRO_C if the OS is SUN
|
|
430
|
+
// compiler solaris __SUNPRO_C
|
|
431
|
+
// version studio
|
|
432
|
+
// 5.7 10 0x570
|
|
433
|
+
// 5.8 11 0x580
|
|
434
|
+
// 5.9 12 0x590
|
|
435
|
+
// 5.10 12.1 0x5100
|
|
436
|
+
// 5.11 12.2 0x5110
|
|
437
|
+
// 5.12 12.3 0x5120
|
|
303
438
|
#if (defined(sun) || defined(__sun)) && !(defined(__SVR4) || defined(__svr4__))
|
|
304
|
-
#define EIGEN_OS_SUN
|
|
439
|
+
#define EIGEN_OS_SUN __SUNPRO_C
|
|
305
440
|
#else
|
|
306
441
|
#define EIGEN_OS_SUN 0
|
|
307
442
|
#endif
|
|
@@ -314,26 +449,137 @@
|
|
|
314
449
|
#endif
|
|
315
450
|
|
|
316
451
|
|
|
452
|
+
//------------------------------------------------------------------------------------------
|
|
453
|
+
// Detect GPU compilers and architectures
|
|
454
|
+
//------------------------------------------------------------------------------------------
|
|
317
455
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
#
|
|
322
|
-
#define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 1
|
|
456
|
+
// NVCC is not supported as the target platform for HIPCC
|
|
457
|
+
// Note that this also makes EIGEN_CUDACC and EIGEN_HIPCC mutually exclusive
|
|
458
|
+
#if defined(__NVCC__) && defined(__HIPCC__)
|
|
459
|
+
#error "NVCC as the target platform for HIPCC is currently not supported."
|
|
323
460
|
#endif
|
|
324
461
|
|
|
325
|
-
|
|
326
|
-
//
|
|
327
|
-
#define
|
|
462
|
+
#if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA)
|
|
463
|
+
// Means the compiler is either nvcc or clang with CUDA enabled
|
|
464
|
+
#define EIGEN_CUDACC __CUDACC__
|
|
465
|
+
#endif
|
|
328
466
|
|
|
329
|
-
#
|
|
330
|
-
|
|
467
|
+
#if defined(__CUDA_ARCH__) && !defined(EIGEN_NO_CUDA)
|
|
468
|
+
// Means we are generating code for the device
|
|
469
|
+
#define EIGEN_CUDA_ARCH __CUDA_ARCH__
|
|
470
|
+
#endif
|
|
471
|
+
|
|
472
|
+
#if defined(EIGEN_CUDACC)
|
|
473
|
+
#include <cuda.h>
|
|
474
|
+
#define EIGEN_CUDA_SDK_VER (CUDA_VERSION * 10)
|
|
331
475
|
#else
|
|
332
|
-
#define
|
|
476
|
+
#define EIGEN_CUDA_SDK_VER 0
|
|
333
477
|
#endif
|
|
334
478
|
|
|
335
|
-
#
|
|
336
|
-
|
|
479
|
+
#if defined(__HIPCC__) && !defined(EIGEN_NO_HIP)
|
|
480
|
+
// Means the compiler is HIPCC (analogous to EIGEN_CUDACC, but for HIP)
|
|
481
|
+
#define EIGEN_HIPCC __HIPCC__
|
|
482
|
+
|
|
483
|
+
// We need to include hip_runtime.h here because it pulls in
|
|
484
|
+
// ++ hip_common.h which contains the define for __HIP_DEVICE_COMPILE__
|
|
485
|
+
// ++ host_defines.h which contains the defines for the __host__ and __device__ macros
|
|
486
|
+
#include <hip/hip_runtime.h>
|
|
487
|
+
|
|
488
|
+
#if defined(__HIP_DEVICE_COMPILE__)
|
|
489
|
+
// analogous to EIGEN_CUDA_ARCH, but for HIP
|
|
490
|
+
#define EIGEN_HIP_DEVICE_COMPILE __HIP_DEVICE_COMPILE__
|
|
491
|
+
#endif
|
|
492
|
+
|
|
493
|
+
// For HIP (ROCm 3.5 and higher), we need to explicitly set the launch_bounds attribute
|
|
494
|
+
// value to 1024. The compiler assigns a default value of 256 when the attribute is not
|
|
495
|
+
// specified. This results in failures on the HIP platform, for cases when a GPU kernel
|
|
496
|
+
// without an explicit launch_bounds attribute is called with a threads_per_block value
|
|
497
|
+
// greater than 256.
|
|
498
|
+
//
|
|
499
|
+
// This is a regression in functioanlity and is expected to be fixed within the next
|
|
500
|
+
// couple of ROCm releases (compiler will go back to using 1024 value as the default)
|
|
501
|
+
//
|
|
502
|
+
// In the meantime, we will use a "only enabled for HIP" macro to set the launch_bounds
|
|
503
|
+
// attribute.
|
|
504
|
+
|
|
505
|
+
#define EIGEN_HIP_LAUNCH_BOUNDS_1024 __launch_bounds__(1024)
|
|
506
|
+
|
|
507
|
+
#endif
|
|
508
|
+
|
|
509
|
+
#if !defined(EIGEN_HIP_LAUNCH_BOUNDS_1024)
|
|
510
|
+
#define EIGEN_HIP_LAUNCH_BOUNDS_1024
|
|
511
|
+
#endif // !defined(EIGEN_HIP_LAUNCH_BOUNDS_1024)
|
|
512
|
+
|
|
513
|
+
// Unify CUDA/HIPCC
|
|
514
|
+
|
|
515
|
+
#if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
|
|
516
|
+
//
|
|
517
|
+
// If either EIGEN_CUDACC or EIGEN_HIPCC is defined, then define EIGEN_GPUCC
|
|
518
|
+
//
|
|
519
|
+
#define EIGEN_GPUCC
|
|
520
|
+
//
|
|
521
|
+
// EIGEN_HIPCC implies the HIP compiler and is used to tweak Eigen code for use in HIP kernels
|
|
522
|
+
// EIGEN_CUDACC implies the CUDA compiler and is used to tweak Eigen code for use in CUDA kernels
|
|
523
|
+
//
|
|
524
|
+
// In most cases the same tweaks are required to the Eigen code to enable in both the HIP and CUDA kernels.
|
|
525
|
+
// For those cases, the corresponding code should be guarded with
|
|
526
|
+
// #if defined(EIGEN_GPUCC)
|
|
527
|
+
// instead of
|
|
528
|
+
// #if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
|
|
529
|
+
//
|
|
530
|
+
// For cases where the tweak is specific to HIP, the code should be guarded with
|
|
531
|
+
// #if defined(EIGEN_HIPCC)
|
|
532
|
+
//
|
|
533
|
+
// For cases where the tweak is specific to CUDA, the code should be guarded with
|
|
534
|
+
// #if defined(EIGEN_CUDACC)
|
|
535
|
+
//
|
|
536
|
+
#endif
|
|
537
|
+
|
|
538
|
+
#if defined(EIGEN_CUDA_ARCH) || defined(EIGEN_HIP_DEVICE_COMPILE)
|
|
539
|
+
//
|
|
540
|
+
// If either EIGEN_CUDA_ARCH or EIGEN_HIP_DEVICE_COMPILE is defined, then define EIGEN_GPU_COMPILE_PHASE
|
|
541
|
+
//
|
|
542
|
+
#define EIGEN_GPU_COMPILE_PHASE
|
|
543
|
+
//
|
|
544
|
+
// GPU compilers (HIPCC, NVCC) typically do two passes over the source code,
|
|
545
|
+
// + one to compile the source for the "host" (ie CPU)
|
|
546
|
+
// + another to compile the source for the "device" (ie. GPU)
|
|
547
|
+
//
|
|
548
|
+
// Code that needs to enabled only during the either the "host" or "device" compilation phase
|
|
549
|
+
// needs to be guarded with a macro that indicates the current compilation phase
|
|
550
|
+
//
|
|
551
|
+
// EIGEN_HIP_DEVICE_COMPILE implies the device compilation phase in HIP
|
|
552
|
+
// EIGEN_CUDA_ARCH implies the device compilation phase in CUDA
|
|
553
|
+
//
|
|
554
|
+
// In most cases, the "host" / "device" specific code is the same for both HIP and CUDA
|
|
555
|
+
// For those cases, the code should be guarded with
|
|
556
|
+
// #if defined(EIGEN_GPU_COMPILE_PHASE)
|
|
557
|
+
// instead of
|
|
558
|
+
// #if defined(EIGEN_CUDA_ARCH) || defined(EIGEN_HIP_DEVICE_COMPILE)
|
|
559
|
+
//
|
|
560
|
+
// For cases where the tweak is specific to HIP, the code should be guarded with
|
|
561
|
+
// #if defined(EIGEN_HIP_DEVICE_COMPILE)
|
|
562
|
+
//
|
|
563
|
+
// For cases where the tweak is specific to CUDA, the code should be guarded with
|
|
564
|
+
// #if defined(EIGEN_CUDA_ARCH)
|
|
565
|
+
//
|
|
566
|
+
#endif
|
|
567
|
+
|
|
568
|
+
#if defined(EIGEN_USE_SYCL) && defined(__SYCL_DEVICE_ONLY__)
|
|
569
|
+
// EIGEN_USE_SYCL is a user-defined macro while __SYCL_DEVICE_ONLY__ is a compiler-defined macro.
|
|
570
|
+
// In most cases we want to check if both macros are defined which can be done using the define below.
|
|
571
|
+
#define SYCL_DEVICE_ONLY
|
|
572
|
+
#endif
|
|
573
|
+
|
|
574
|
+
//------------------------------------------------------------------------------------------
|
|
575
|
+
// Detect Compiler/Architecture/OS specific features
|
|
576
|
+
//------------------------------------------------------------------------------------------
|
|
577
|
+
|
|
578
|
+
#if EIGEN_GNUC_AT_MOST(4,3) && !EIGEN_COMP_CLANG
|
|
579
|
+
// see bug 89
|
|
580
|
+
#define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 0
|
|
581
|
+
#else
|
|
582
|
+
#define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 1
|
|
337
583
|
#endif
|
|
338
584
|
|
|
339
585
|
// Cross compiler wrapper around LLVM's __has_builtin
|
|
@@ -349,26 +595,79 @@
|
|
|
349
595
|
# define __has_feature(x) 0
|
|
350
596
|
#endif
|
|
351
597
|
|
|
352
|
-
//
|
|
353
|
-
//
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
598
|
+
// Some old compilers do not support template specializations like:
|
|
599
|
+
// template<typename T,int N> void foo(const T x[N]);
|
|
600
|
+
#if !( EIGEN_COMP_CLANG && ( (EIGEN_COMP_CLANG<309) \
|
|
601
|
+
|| (defined(__apple_build_version__) && (__apple_build_version__ < 9000000))) \
|
|
602
|
+
|| EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC<49)
|
|
603
|
+
#define EIGEN_HAS_STATIC_ARRAY_TEMPLATE 1
|
|
604
|
+
#else
|
|
605
|
+
#define EIGEN_HAS_STATIC_ARRAY_TEMPLATE 0
|
|
606
|
+
#endif
|
|
607
|
+
|
|
608
|
+
// The macro EIGEN_CPLUSPLUS is a replacement for __cplusplus/_MSVC_LANG that
|
|
609
|
+
// works for both platforms, indicating the C++ standard version number.
|
|
610
|
+
//
|
|
611
|
+
// With MSVC, without defining /Zc:__cplusplus, the __cplusplus macro will
|
|
612
|
+
// report 199711L regardless of the language standard specified via /std.
|
|
613
|
+
// We need to rely on _MSVC_LANG instead, which is only available after
|
|
614
|
+
// VS2015.3.
|
|
615
|
+
#if EIGEN_COMP_MSVC_LANG > 0
|
|
616
|
+
#define EIGEN_CPLUSPLUS EIGEN_COMP_MSVC_LANG
|
|
617
|
+
#elif EIGEN_COMP_MSVC >= 1900
|
|
618
|
+
#define EIGEN_CPLUSPLUS 201103L
|
|
619
|
+
#elif defined(__cplusplus)
|
|
620
|
+
#define EIGEN_CPLUSPLUS __cplusplus
|
|
621
|
+
#else
|
|
622
|
+
#define EIGEN_CPLUSPLUS 0
|
|
623
|
+
#endif
|
|
624
|
+
|
|
625
|
+
// The macro EIGEN_COMP_CXXVER defines the c++ verson expected by the compiler.
|
|
626
|
+
// For instance, if compiling with gcc and -std=c++17, then EIGEN_COMP_CXXVER
|
|
627
|
+
// is defined to 17.
|
|
628
|
+
#if EIGEN_CPLUSPLUS > 201703L
|
|
629
|
+
#define EIGEN_COMP_CXXVER 20
|
|
630
|
+
#elif EIGEN_CPLUSPLUS > 201402L
|
|
631
|
+
#define EIGEN_COMP_CXXVER 17
|
|
632
|
+
#elif EIGEN_CPLUSPLUS > 201103L
|
|
633
|
+
#define EIGEN_COMP_CXXVER 14
|
|
634
|
+
#elif EIGEN_CPLUSPLUS >= 201103L
|
|
635
|
+
#define EIGEN_COMP_CXXVER 11
|
|
636
|
+
#else
|
|
637
|
+
#define EIGEN_COMP_CXXVER 03
|
|
638
|
+
#endif
|
|
639
|
+
|
|
640
|
+
#ifndef EIGEN_HAS_CXX14_VARIABLE_TEMPLATES
|
|
641
|
+
#if defined(__cpp_variable_templates) && __cpp_variable_templates >= 201304 && EIGEN_MAX_CPP_VER>=14
|
|
642
|
+
#define EIGEN_HAS_CXX14_VARIABLE_TEMPLATES 1
|
|
643
|
+
#else
|
|
644
|
+
#define EIGEN_HAS_CXX14_VARIABLE_TEMPLATES 0
|
|
645
|
+
#endif
|
|
357
646
|
#endif
|
|
358
647
|
|
|
359
|
-
|
|
648
|
+
|
|
649
|
+
// The macros EIGEN_HAS_CXX?? defines a rough estimate of available c++ features
|
|
650
|
+
// but in practice we should not rely on them but rather on the availabilty of
|
|
651
|
+
// individual features as defined later.
|
|
652
|
+
// This is why there is no EIGEN_HAS_CXX17.
|
|
653
|
+
// FIXME: get rid of EIGEN_HAS_CXX14 and maybe even EIGEN_HAS_CXX11.
|
|
654
|
+
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_COMP_CXXVER>=11
|
|
360
655
|
#define EIGEN_HAS_CXX11 1
|
|
361
656
|
#else
|
|
362
657
|
#define EIGEN_HAS_CXX11 0
|
|
363
658
|
#endif
|
|
364
659
|
|
|
660
|
+
#if EIGEN_MAX_CPP_VER>=14 && EIGEN_COMP_CXXVER>=14
|
|
661
|
+
#define EIGEN_HAS_CXX14 1
|
|
662
|
+
#else
|
|
663
|
+
#define EIGEN_HAS_CXX14 0
|
|
664
|
+
#endif
|
|
365
665
|
|
|
366
666
|
// Do we support r-value references?
|
|
367
667
|
#ifndef EIGEN_HAS_RVALUE_REFERENCES
|
|
368
668
|
#if EIGEN_MAX_CPP_VER>=11 && \
|
|
369
669
|
(__has_feature(cxx_rvalue_references) || \
|
|
370
|
-
|
|
371
|
-
(EIGEN_COMP_MSVC >= 1600))
|
|
670
|
+
(EIGEN_COMP_CXXVER >= 11) || (EIGEN_COMP_MSVC >= 1600))
|
|
372
671
|
#define EIGEN_HAS_RVALUE_REFERENCES 1
|
|
373
672
|
#else
|
|
374
673
|
#define EIGEN_HAS_RVALUE_REFERENCES 0
|
|
@@ -376,12 +675,14 @@
|
|
|
376
675
|
#endif
|
|
377
676
|
|
|
378
677
|
// Does the compiler support C99?
|
|
678
|
+
// Need to include <cmath> to make sure _GLIBCXX_USE_C99 gets defined
|
|
679
|
+
#include <cmath>
|
|
379
680
|
#ifndef EIGEN_HAS_C99_MATH
|
|
380
681
|
#if EIGEN_MAX_CPP_VER>=11 && \
|
|
381
682
|
((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \
|
|
382
683
|
|| (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \
|
|
383
684
|
|| (defined(_LIBCPP_VERSION) && !defined(_MSC_VER)) \
|
|
384
|
-
|| (EIGEN_COMP_MSVC >= 1900) )
|
|
685
|
+
|| (EIGEN_COMP_MSVC >= 1900) || defined(SYCL_DEVICE_ONLY))
|
|
385
686
|
#define EIGEN_HAS_C99_MATH 1
|
|
386
687
|
#else
|
|
387
688
|
#define EIGEN_HAS_C99_MATH 0
|
|
@@ -389,14 +690,50 @@
|
|
|
389
690
|
#endif
|
|
390
691
|
|
|
391
692
|
// Does the compiler support result_of?
|
|
693
|
+
// result_of was deprecated in c++17 and removed in c++ 20
|
|
392
694
|
#ifndef EIGEN_HAS_STD_RESULT_OF
|
|
393
|
-
#if
|
|
695
|
+
#if EIGEN_HAS_CXX11 && EIGEN_COMP_CXXVER < 17
|
|
394
696
|
#define EIGEN_HAS_STD_RESULT_OF 1
|
|
395
697
|
#else
|
|
396
698
|
#define EIGEN_HAS_STD_RESULT_OF 0
|
|
397
699
|
#endif
|
|
398
700
|
#endif
|
|
399
701
|
|
|
702
|
+
// Does the compiler support std::hash?
|
|
703
|
+
#ifndef EIGEN_HAS_STD_HASH
|
|
704
|
+
// The std::hash struct is defined in C++11 but is not labelled as a __device__
|
|
705
|
+
// function and is not constexpr, so cannot be used on device.
|
|
706
|
+
#if EIGEN_HAS_CXX11 && !defined(EIGEN_GPU_COMPILE_PHASE)
|
|
707
|
+
#define EIGEN_HAS_STD_HASH 1
|
|
708
|
+
#else
|
|
709
|
+
#define EIGEN_HAS_STD_HASH 0
|
|
710
|
+
#endif
|
|
711
|
+
#endif // EIGEN_HAS_STD_HASH
|
|
712
|
+
|
|
713
|
+
#ifndef EIGEN_HAS_STD_INVOKE_RESULT
|
|
714
|
+
#if EIGEN_MAX_CPP_VER >= 17 && EIGEN_COMP_CXXVER >= 17
|
|
715
|
+
#define EIGEN_HAS_STD_INVOKE_RESULT 1
|
|
716
|
+
#else
|
|
717
|
+
#define EIGEN_HAS_STD_INVOKE_RESULT 0
|
|
718
|
+
#endif
|
|
719
|
+
#endif
|
|
720
|
+
|
|
721
|
+
#ifndef EIGEN_HAS_ALIGNAS
|
|
722
|
+
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \
|
|
723
|
+
( __has_feature(cxx_alignas) \
|
|
724
|
+
|| EIGEN_HAS_CXX14 \
|
|
725
|
+
|| (EIGEN_COMP_MSVC >= 1800) \
|
|
726
|
+
|| (EIGEN_GNUC_AT_LEAST(4,8)) \
|
|
727
|
+
|| (EIGEN_COMP_CLANG>=305) \
|
|
728
|
+
|| (EIGEN_COMP_ICC>=1500) \
|
|
729
|
+
|| (EIGEN_COMP_PGI>=1500) \
|
|
730
|
+
|| (EIGEN_COMP_SUNCC>=0x5130))
|
|
731
|
+
#define EIGEN_HAS_ALIGNAS 1
|
|
732
|
+
#else
|
|
733
|
+
#define EIGEN_HAS_ALIGNAS 0
|
|
734
|
+
#endif
|
|
735
|
+
#endif
|
|
736
|
+
|
|
400
737
|
// Does the compiler support type_traits?
|
|
401
738
|
// - full support of type traits was added only to GCC 5.1.0.
|
|
402
739
|
// - 20150626 corresponds to the last release of 4.x libstdc++
|
|
@@ -413,11 +750,13 @@
|
|
|
413
750
|
|
|
414
751
|
// Does the compiler support variadic templates?
|
|
415
752
|
#ifndef EIGEN_HAS_VARIADIC_TEMPLATES
|
|
416
|
-
#if EIGEN_MAX_CPP_VER>=11 && (
|
|
417
|
-
&& (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (
|
|
753
|
+
#if EIGEN_MAX_CPP_VER>=11 && (EIGEN_COMP_CXXVER >= 11) \
|
|
754
|
+
&& (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (EIGEN_COMP_NVCC >= 80000) )
|
|
418
755
|
// ^^ Disable the use of variadic templates when compiling with versions of nvcc older than 8.0 on ARM devices:
|
|
419
756
|
// this prevents nvcc from crashing when compiling Eigen on Tegra X1
|
|
420
757
|
#define EIGEN_HAS_VARIADIC_TEMPLATES 1
|
|
758
|
+
#elif EIGEN_MAX_CPP_VER>=11 && (EIGEN_COMP_CXXVER >= 11) && defined(SYCL_DEVICE_ONLY)
|
|
759
|
+
#define EIGEN_HAS_VARIADIC_TEMPLATES 1
|
|
421
760
|
#else
|
|
422
761
|
#define EIGEN_HAS_VARIADIC_TEMPLATES 0
|
|
423
762
|
#endif
|
|
@@ -425,27 +764,33 @@
|
|
|
425
764
|
|
|
426
765
|
// Does the compiler fully support const expressions? (as in c++14)
|
|
427
766
|
#ifndef EIGEN_HAS_CONSTEXPR
|
|
767
|
+
#if defined(EIGEN_CUDACC)
|
|
768
|
+
// Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above
|
|
769
|
+
#if EIGEN_MAX_CPP_VER>=14 && (EIGEN_COMP_CXXVER >= 11 && (EIGEN_COMP_CLANG || EIGEN_COMP_NVCC >= 70500))
|
|
770
|
+
#define EIGEN_HAS_CONSTEXPR 1
|
|
771
|
+
#endif
|
|
772
|
+
#elif EIGEN_MAX_CPP_VER>=14 && (__has_feature(cxx_relaxed_constexpr) || (EIGEN_COMP_CXXVER >= 14) || \
|
|
773
|
+
(EIGEN_GNUC_AT_LEAST(4,8) && (EIGEN_COMP_CXXVER >= 11)) || \
|
|
774
|
+
(EIGEN_COMP_CLANG >= 306 && (EIGEN_COMP_CXXVER >= 11)))
|
|
775
|
+
#define EIGEN_HAS_CONSTEXPR 1
|
|
776
|
+
#endif
|
|
428
777
|
|
|
429
|
-
#
|
|
430
|
-
|
|
431
|
-
#
|
|
432
|
-
#define EIGEN_HAS_CONSTEXPR 1
|
|
433
|
-
#endif
|
|
434
|
-
#elif EIGEN_MAX_CPP_VER>=14 && (__has_feature(cxx_relaxed_constexpr) || (defined(__cplusplus) && __cplusplus >= 201402L) || \
|
|
435
|
-
(EIGEN_GNUC_AT_LEAST(4,8) && (__cplusplus > 199711L)))
|
|
436
|
-
#define EIGEN_HAS_CONSTEXPR 1
|
|
437
|
-
#endif
|
|
778
|
+
#ifndef EIGEN_HAS_CONSTEXPR
|
|
779
|
+
#define EIGEN_HAS_CONSTEXPR 0
|
|
780
|
+
#endif
|
|
438
781
|
|
|
439
|
-
#
|
|
440
|
-
#define EIGEN_HAS_CONSTEXPR 0
|
|
441
|
-
#endif
|
|
782
|
+
#endif // EIGEN_HAS_CONSTEXPR
|
|
442
783
|
|
|
784
|
+
#if EIGEN_HAS_CONSTEXPR
|
|
785
|
+
#define EIGEN_CONSTEXPR constexpr
|
|
786
|
+
#else
|
|
787
|
+
#define EIGEN_CONSTEXPR
|
|
443
788
|
#endif
|
|
444
789
|
|
|
445
790
|
// Does the compiler support C++11 math?
|
|
446
791
|
// Let's be conservative and enable the default C++11 implementation only if we are sure it exists
|
|
447
792
|
#ifndef EIGEN_HAS_CXX11_MATH
|
|
448
|
-
#if EIGEN_MAX_CPP_VER>=11 && ((
|
|
793
|
+
#if EIGEN_MAX_CPP_VER>=11 && ((EIGEN_COMP_CXXVER > 11) || (EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \
|
|
449
794
|
&& (EIGEN_ARCH_i386_OR_x86_64) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC))
|
|
450
795
|
#define EIGEN_HAS_CXX11_MATH 1
|
|
451
796
|
#else
|
|
@@ -456,9 +801,8 @@
|
|
|
456
801
|
// Does the compiler support proper C++11 containers?
|
|
457
802
|
#ifndef EIGEN_HAS_CXX11_CONTAINERS
|
|
458
803
|
#if EIGEN_MAX_CPP_VER>=11 && \
|
|
459
|
-
((
|
|
460
|
-
|| ((
|
|
461
|
-
|| EIGEN_COMP_MSVC >= 1900)
|
|
804
|
+
((EIGEN_COMP_CXXVER > 11) \
|
|
805
|
+
|| ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC>=1400)))
|
|
462
806
|
#define EIGEN_HAS_CXX11_CONTAINERS 1
|
|
463
807
|
#else
|
|
464
808
|
#define EIGEN_HAS_CXX11_CONTAINERS 0
|
|
@@ -469,24 +813,88 @@
|
|
|
469
813
|
#ifndef EIGEN_HAS_CXX11_NOEXCEPT
|
|
470
814
|
#if EIGEN_MAX_CPP_VER>=11 && \
|
|
471
815
|
(__has_feature(cxx_noexcept) \
|
|
472
|
-
|| (
|
|
473
|
-
|| ((
|
|
474
|
-
|| EIGEN_COMP_MSVC >= 1900)
|
|
816
|
+
|| (EIGEN_COMP_CXXVER > 11) \
|
|
817
|
+
|| ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC>=1400)))
|
|
475
818
|
#define EIGEN_HAS_CXX11_NOEXCEPT 1
|
|
476
819
|
#else
|
|
477
820
|
#define EIGEN_HAS_CXX11_NOEXCEPT 0
|
|
478
821
|
#endif
|
|
479
822
|
#endif
|
|
480
823
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
#
|
|
487
|
-
#
|
|
824
|
+
#ifndef EIGEN_HAS_CXX11_ATOMIC
|
|
825
|
+
#if EIGEN_MAX_CPP_VER>=11 && \
|
|
826
|
+
(__has_feature(cxx_atomic) \
|
|
827
|
+
|| (EIGEN_COMP_CXXVER > 11) \
|
|
828
|
+
|| ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_MSVC==0 || EIGEN_COMP_MSVC >= 1700)))
|
|
829
|
+
#define EIGEN_HAS_CXX11_ATOMIC 1
|
|
830
|
+
#else
|
|
831
|
+
#define EIGEN_HAS_CXX11_ATOMIC 0
|
|
832
|
+
#endif
|
|
833
|
+
#endif
|
|
834
|
+
|
|
835
|
+
#ifndef EIGEN_HAS_CXX11_OVERRIDE_FINAL
|
|
836
|
+
#if EIGEN_MAX_CPP_VER>=11 && \
|
|
837
|
+
(EIGEN_COMP_CXXVER >= 11 || EIGEN_COMP_MSVC >= 1700)
|
|
838
|
+
#define EIGEN_HAS_CXX11_OVERRIDE_FINAL 1
|
|
839
|
+
#else
|
|
840
|
+
#define EIGEN_HAS_CXX11_OVERRIDE_FINAL 0
|
|
841
|
+
#endif
|
|
842
|
+
#endif
|
|
843
|
+
|
|
844
|
+
// NOTE: the required Apple's clang version is very conservative
|
|
845
|
+
// and it could be that XCode 9 works just fine.
|
|
846
|
+
// NOTE: the MSVC version is based on https://en.cppreference.com/w/cpp/compiler_support
|
|
847
|
+
// and not tested.
|
|
848
|
+
#ifndef EIGEN_HAS_CXX17_OVERALIGN
|
|
849
|
+
#if EIGEN_MAX_CPP_VER>=17 && EIGEN_COMP_CXXVER>=17 && ( \
|
|
850
|
+
(EIGEN_COMP_MSVC >= 1912) \
|
|
851
|
+
|| (EIGEN_GNUC_AT_LEAST(7,0)) \
|
|
852
|
+
|| ((!defined(__apple_build_version__)) && (EIGEN_COMP_CLANG>=500)) \
|
|
853
|
+
|| (( defined(__apple_build_version__)) && (__apple_build_version__>=10000000)) \
|
|
854
|
+
)
|
|
855
|
+
#define EIGEN_HAS_CXX17_OVERALIGN 1
|
|
856
|
+
#else
|
|
857
|
+
#define EIGEN_HAS_CXX17_OVERALIGN 0
|
|
858
|
+
#endif
|
|
859
|
+
#endif
|
|
860
|
+
|
|
861
|
+
#if defined(EIGEN_CUDACC) && EIGEN_HAS_CONSTEXPR
|
|
862
|
+
// While available already with c++11, this is useful mostly starting with c++14 and relaxed constexpr rules
|
|
863
|
+
#if defined(__NVCC__)
|
|
864
|
+
// nvcc considers constexpr functions as __host__ __device__ with the option --expt-relaxed-constexpr
|
|
865
|
+
#ifdef __CUDACC_RELAXED_CONSTEXPR__
|
|
866
|
+
#define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
|
|
867
|
+
#endif
|
|
868
|
+
#elif defined(__clang__) && defined(__CUDA__) && __has_feature(cxx_relaxed_constexpr)
|
|
869
|
+
// clang++ always considers constexpr functions as implicitly __host__ __device__
|
|
870
|
+
#define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
|
|
871
|
+
#endif
|
|
872
|
+
#endif
|
|
873
|
+
|
|
874
|
+
// Does the compiler support the __int128 and __uint128_t extensions for 128-bit
|
|
875
|
+
// integer arithmetic?
|
|
876
|
+
//
|
|
877
|
+
// Clang and GCC define __SIZEOF_INT128__ when these extensions are supported,
|
|
878
|
+
// but we avoid using them in certain cases:
|
|
879
|
+
//
|
|
880
|
+
// * Building using Clang for Windows, where the Clang runtime library has
|
|
881
|
+
// 128-bit support only on LP64 architectures, but Windows is LLP64.
|
|
882
|
+
#ifndef EIGEN_HAS_BUILTIN_INT128
|
|
883
|
+
#if defined(__SIZEOF_INT128__) && !(EIGEN_OS_WIN && EIGEN_COMP_CLANG)
|
|
884
|
+
#define EIGEN_HAS_BUILTIN_INT128 1
|
|
885
|
+
#else
|
|
886
|
+
#define EIGEN_HAS_BUILTIN_INT128 0
|
|
887
|
+
#endif
|
|
488
888
|
#endif
|
|
489
889
|
|
|
890
|
+
//------------------------------------------------------------------------------------------
|
|
891
|
+
// Preprocessor programming helpers
|
|
892
|
+
//------------------------------------------------------------------------------------------
|
|
893
|
+
|
|
894
|
+
// This macro can be used to prevent from macro expansion, e.g.:
|
|
895
|
+
// std::max EIGEN_NOT_A_MACRO(a,b)
|
|
896
|
+
#define EIGEN_NOT_A_MACRO
|
|
897
|
+
|
|
490
898
|
#define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl;
|
|
491
899
|
|
|
492
900
|
// concatenate two tokens
|
|
@@ -503,7 +911,7 @@
|
|
|
503
911
|
// but it still doesn't use GCC's always_inline. This is useful in (common) situations where MSVC needs forceinline
|
|
504
912
|
// but GCC is still doing fine with just inline.
|
|
505
913
|
#ifndef EIGEN_STRONG_INLINE
|
|
506
|
-
#if EIGEN_COMP_MSVC || EIGEN_COMP_ICC
|
|
914
|
+
#if (EIGEN_COMP_MSVC || EIGEN_COMP_ICC) && !defined(EIGEN_GPUCC)
|
|
507
915
|
#define EIGEN_STRONG_INLINE __forceinline
|
|
508
916
|
#else
|
|
509
917
|
#define EIGEN_STRONG_INLINE inline
|
|
@@ -518,7 +926,7 @@
|
|
|
518
926
|
// Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const'
|
|
519
927
|
// : function body not available
|
|
520
928
|
// See also bug 1367
|
|
521
|
-
#if EIGEN_GNUC_AT_LEAST(4,2)
|
|
929
|
+
#if EIGEN_GNUC_AT_LEAST(4,2) && !defined(SYCL_DEVICE_ONLY)
|
|
522
930
|
#define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline
|
|
523
931
|
#else
|
|
524
932
|
#define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE
|
|
@@ -538,12 +946,43 @@
|
|
|
538
946
|
#define EIGEN_PERMISSIVE_EXPR
|
|
539
947
|
#endif
|
|
540
948
|
|
|
949
|
+
// GPU stuff
|
|
950
|
+
|
|
951
|
+
// Disable some features when compiling with GPU compilers (NVCC/clang-cuda/SYCL/HIPCC)
|
|
952
|
+
#if defined(EIGEN_CUDACC) || defined(SYCL_DEVICE_ONLY) || defined(EIGEN_HIPCC)
|
|
953
|
+
// Do not try asserts on device code
|
|
954
|
+
#ifndef EIGEN_NO_DEBUG
|
|
955
|
+
#define EIGEN_NO_DEBUG
|
|
956
|
+
#endif
|
|
957
|
+
|
|
958
|
+
#ifdef EIGEN_INTERNAL_DEBUGGING
|
|
959
|
+
#undef EIGEN_INTERNAL_DEBUGGING
|
|
960
|
+
#endif
|
|
961
|
+
|
|
962
|
+
#ifdef EIGEN_EXCEPTIONS
|
|
963
|
+
#undef EIGEN_EXCEPTIONS
|
|
964
|
+
#endif
|
|
965
|
+
#endif
|
|
966
|
+
|
|
967
|
+
#if defined(SYCL_DEVICE_ONLY)
|
|
968
|
+
#ifndef EIGEN_DONT_VECTORIZE
|
|
969
|
+
#define EIGEN_DONT_VECTORIZE
|
|
970
|
+
#endif
|
|
971
|
+
#define EIGEN_DEVICE_FUNC __attribute__((flatten)) __attribute__((always_inline))
|
|
972
|
+
// All functions callable from CUDA/HIP code must be qualified with __device__
|
|
973
|
+
#elif defined(EIGEN_GPUCC)
|
|
974
|
+
#define EIGEN_DEVICE_FUNC __host__ __device__
|
|
975
|
+
#else
|
|
976
|
+
#define EIGEN_DEVICE_FUNC
|
|
977
|
+
#endif
|
|
978
|
+
|
|
979
|
+
|
|
541
980
|
// this macro allows to get rid of linking errors about multiply defined functions.
|
|
542
981
|
// - static is not very good because it prevents definitions from different object files to be merged.
|
|
543
982
|
// So static causes the resulting linked executable to be bloated with multiple copies of the same function.
|
|
544
983
|
// - inline is not perfect either as it unwantedly hints the compiler toward inlining the function.
|
|
545
|
-
#define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
|
|
546
|
-
#define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS inline
|
|
984
|
+
#define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC
|
|
985
|
+
#define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC inline
|
|
547
986
|
|
|
548
987
|
#ifdef NDEBUG
|
|
549
988
|
# ifndef EIGEN_NO_DEBUG
|
|
@@ -553,7 +992,11 @@
|
|
|
553
992
|
|
|
554
993
|
// eigen_plain_assert is where we implement the workaround for the assert() bug in GCC <= 4.3, see bug 89
|
|
555
994
|
#ifdef EIGEN_NO_DEBUG
|
|
556
|
-
#
|
|
995
|
+
#ifdef SYCL_DEVICE_ONLY // used to silence the warning on SYCL device
|
|
996
|
+
#define eigen_plain_assert(x) EIGEN_UNUSED_VARIABLE(x)
|
|
997
|
+
#else
|
|
998
|
+
#define eigen_plain_assert(x)
|
|
999
|
+
#endif
|
|
557
1000
|
#else
|
|
558
1001
|
#if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO
|
|
559
1002
|
namespace Eigen {
|
|
@@ -627,7 +1070,7 @@
|
|
|
627
1070
|
// Suppresses 'unused variable' warnings.
|
|
628
1071
|
namespace Eigen {
|
|
629
1072
|
namespace internal {
|
|
630
|
-
template<typename T> EIGEN_DEVICE_FUNC void ignore_unused_variable(const T&) {}
|
|
1073
|
+
template<typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void ignore_unused_variable(const T&) {}
|
|
631
1074
|
}
|
|
632
1075
|
}
|
|
633
1076
|
#define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var);
|
|
@@ -641,169 +1084,75 @@ namespace Eigen {
|
|
|
641
1084
|
#endif
|
|
642
1085
|
|
|
643
1086
|
|
|
644
|
-
|
|
645
|
-
//
|
|
646
|
-
//
|
|
647
|
-
// The main purpose of this section is to define EIGEN_MAX_ALIGN_BYTES and EIGEN_MAX_STATIC_ALIGN_BYTES
|
|
648
|
-
// as the maximal boundary in bytes on which dynamically and statically allocated data may be alignment respectively.
|
|
649
|
-
// The values of EIGEN_MAX_ALIGN_BYTES and EIGEN_MAX_STATIC_ALIGN_BYTES can be specified by the user. If not,
|
|
650
|
-
// a default value is automatically computed based on architecture, compiler, and OS.
|
|
1087
|
+
// Acts as a barrier preventing operations involving `X` from crossing. This
|
|
1088
|
+
// occurs, for example, in the fast rounding trick where a magic constant is
|
|
1089
|
+
// added then subtracted, which is otherwise compiled away with -ffast-math.
|
|
651
1090
|
//
|
|
652
|
-
//
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
//
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
//
|
|
692
|
-
#define
|
|
693
|
-
|
|
694
|
-
//
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
#
|
|
699
|
-
#
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
// They imply EIGEN_MAX_STATIC_ALIGN_BYTES=0
|
|
704
|
-
#if defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN)
|
|
705
|
-
#ifdef EIGEN_MAX_STATIC_ALIGN_BYTES
|
|
706
|
-
#undef EIGEN_MAX_STATIC_ALIGN_BYTES
|
|
707
|
-
#endif
|
|
708
|
-
#define EIGEN_MAX_STATIC_ALIGN_BYTES 0
|
|
709
|
-
#endif
|
|
710
|
-
|
|
711
|
-
#ifndef EIGEN_MAX_STATIC_ALIGN_BYTES
|
|
712
|
-
|
|
713
|
-
// Try to automatically guess what is the best default value for EIGEN_MAX_STATIC_ALIGN_BYTES
|
|
714
|
-
|
|
715
|
-
// 16 byte alignment is only useful for vectorization. Since it affects the ABI, we need to enable
|
|
716
|
-
// 16 byte alignment on all platforms where vectorization might be enabled. In theory we could always
|
|
717
|
-
// enable alignment, but it can be a cause of problems on some platforms, so we just disable it in
|
|
718
|
-
// certain common platform (compiler+architecture combinations) to avoid these problems.
|
|
719
|
-
// Only static alignment is really problematic (relies on nonstandard compiler extensions),
|
|
720
|
-
// try to keep heap alignment even when we have to disable static alignment.
|
|
721
|
-
#if EIGEN_COMP_GNUC && !(EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64 || EIGEN_ARCH_PPC || EIGEN_ARCH_IA64)
|
|
722
|
-
#define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1
|
|
723
|
-
#elif EIGEN_ARCH_ARM_OR_ARM64 && EIGEN_COMP_GNUC_STRICT && EIGEN_GNUC_AT_MOST(4, 6)
|
|
724
|
-
// Old versions of GCC on ARM, at least 4.4, were once seen to have buggy static alignment support.
|
|
725
|
-
// Not sure which version fixed it, hopefully it doesn't affect 4.7, which is still somewhat in use.
|
|
726
|
-
// 4.8 and newer seem definitely unaffected.
|
|
727
|
-
#define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 1
|
|
728
|
-
#else
|
|
729
|
-
#define EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT 0
|
|
730
|
-
#endif
|
|
731
|
-
|
|
732
|
-
// static alignment is completely disabled with GCC 3, Sun Studio, and QCC/QNX
|
|
733
|
-
#if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT \
|
|
734
|
-
&& !EIGEN_GCC3_OR_OLDER \
|
|
735
|
-
&& !EIGEN_COMP_SUNCC \
|
|
736
|
-
&& !EIGEN_OS_QNX
|
|
737
|
-
#define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1
|
|
738
|
-
#else
|
|
739
|
-
#define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 0
|
|
740
|
-
#endif
|
|
741
|
-
|
|
742
|
-
#if EIGEN_ARCH_WANTS_STACK_ALIGNMENT
|
|
743
|
-
#define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
|
|
1091
|
+
// See bug 1674
|
|
1092
|
+
#if !defined(EIGEN_OPTIMIZATION_BARRIER)
|
|
1093
|
+
#if EIGEN_COMP_GNUC
|
|
1094
|
+
// According to https://gcc.gnu.org/onlinedocs/gcc/Constraints.html:
|
|
1095
|
+
// X: Any operand whatsoever.
|
|
1096
|
+
// r: A register operand is allowed provided that it is in a general
|
|
1097
|
+
// register.
|
|
1098
|
+
// g: Any register, memory or immediate integer operand is allowed, except
|
|
1099
|
+
// for registers that are not general registers.
|
|
1100
|
+
// w: (AArch32/AArch64) Floating point register, Advanced SIMD vector
|
|
1101
|
+
// register or SVE vector register.
|
|
1102
|
+
// x: (SSE) Any SSE register.
|
|
1103
|
+
// (AArch64) Like w, but restricted to registers 0 to 15 inclusive.
|
|
1104
|
+
// v: (PowerPC) An Altivec vector register.
|
|
1105
|
+
// wa:(PowerPC) A VSX register.
|
|
1106
|
+
//
|
|
1107
|
+
// "X" (uppercase) should work for all cases, though this seems to fail for
|
|
1108
|
+
// some versions of GCC for arm/aarch64 with
|
|
1109
|
+
// "error: inconsistent operand constraints in an 'asm'"
|
|
1110
|
+
// Clang x86_64/arm/aarch64 seems to require "g" to support both scalars and
|
|
1111
|
+
// vectors, otherwise
|
|
1112
|
+
// "error: non-trivial scalar-to-vector conversion, possible invalid
|
|
1113
|
+
// constraint for vector type"
|
|
1114
|
+
//
|
|
1115
|
+
// GCC for ppc64le generates an internal compiler error with x/X/g.
|
|
1116
|
+
// GCC for AVX generates an internal compiler error with X.
|
|
1117
|
+
//
|
|
1118
|
+
// Tested on icc/gcc/clang for sse, avx, avx2, avx512dq
|
|
1119
|
+
// gcc for arm, aarch64,
|
|
1120
|
+
// gcc for ppc64le,
|
|
1121
|
+
// both vectors and scalars.
|
|
1122
|
+
//
|
|
1123
|
+
// Note that this is restricted to plain types - this will not work
|
|
1124
|
+
// directly for std::complex<T>, Eigen::half, Eigen::bfloat16. For these,
|
|
1125
|
+
// you will need to apply to the underlying POD type.
|
|
1126
|
+
#if EIGEN_ARCH_PPC && EIGEN_COMP_GNUC_STRICT
|
|
1127
|
+
// This seems to be broken on clang. Packet4f is loaded into a single
|
|
1128
|
+
// register rather than a vector, zeroing out some entries. Integer
|
|
1129
|
+
// types also generate a compile error.
|
|
1130
|
+
// General, Altivec, VSX.
|
|
1131
|
+
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+r,v,wa" (X));
|
|
1132
|
+
#elif EIGEN_ARCH_ARM_OR_ARM64
|
|
1133
|
+
// General, NEON.
|
|
1134
|
+
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+g,w" (X));
|
|
1135
|
+
#elif EIGEN_ARCH_i386_OR_x86_64
|
|
1136
|
+
// General, SSE.
|
|
1137
|
+
#define EIGEN_OPTIMIZATION_BARRIER(X) __asm__ ("" : "+g,x" (X));
|
|
1138
|
+
#else
|
|
1139
|
+
// Not implemented for other architectures.
|
|
1140
|
+
#define EIGEN_OPTIMIZATION_BARRIER(X)
|
|
1141
|
+
#endif
|
|
744
1142
|
#else
|
|
745
|
-
|
|
1143
|
+
// Not implemented for other compilers.
|
|
1144
|
+
#define EIGEN_OPTIMIZATION_BARRIER(X)
|
|
746
1145
|
#endif
|
|
747
|
-
|
|
748
1146
|
#endif
|
|
749
1147
|
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
#define
|
|
754
|
-
#endif
|
|
755
|
-
|
|
756
|
-
#if EIGEN_MAX_STATIC_ALIGN_BYTES==0 && !defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
|
|
757
|
-
#define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
|
|
758
|
-
#endif
|
|
759
|
-
|
|
760
|
-
// At this stage, EIGEN_MAX_STATIC_ALIGN_BYTES>0 is the true test whether we want to align arrays on the stack or not.
|
|
761
|
-
// It takes into account both the user choice to explicitly enable/disable alignment (by settting EIGEN_MAX_STATIC_ALIGN_BYTES)
|
|
762
|
-
// and the architecture config (EIGEN_ARCH_WANTS_STACK_ALIGNMENT).
|
|
763
|
-
// Henceforth, only EIGEN_MAX_STATIC_ALIGN_BYTES should be used.
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
// Shortcuts to EIGEN_ALIGN_TO_BOUNDARY
|
|
767
|
-
#define EIGEN_ALIGN8 EIGEN_ALIGN_TO_BOUNDARY(8)
|
|
768
|
-
#define EIGEN_ALIGN16 EIGEN_ALIGN_TO_BOUNDARY(16)
|
|
769
|
-
#define EIGEN_ALIGN32 EIGEN_ALIGN_TO_BOUNDARY(32)
|
|
770
|
-
#define EIGEN_ALIGN64 EIGEN_ALIGN_TO_BOUNDARY(64)
|
|
771
|
-
#if EIGEN_MAX_STATIC_ALIGN_BYTES>0
|
|
772
|
-
#define EIGEN_ALIGN_MAX EIGEN_ALIGN_TO_BOUNDARY(EIGEN_MAX_STATIC_ALIGN_BYTES)
|
|
1148
|
+
#if EIGEN_COMP_MSVC
|
|
1149
|
+
// NOTE MSVC often gives C4127 warnings with compiletime if statements. See bug 1362.
|
|
1150
|
+
// This workaround is ugly, but it does the job.
|
|
1151
|
+
# define EIGEN_CONST_CONDITIONAL(cond) (void)0, cond
|
|
773
1152
|
#else
|
|
774
|
-
#define
|
|
1153
|
+
# define EIGEN_CONST_CONDITIONAL(cond) cond
|
|
775
1154
|
#endif
|
|
776
1155
|
|
|
777
|
-
|
|
778
|
-
// Dynamic alignment control
|
|
779
|
-
|
|
780
|
-
#if defined(EIGEN_DONT_ALIGN) && defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES>0
|
|
781
|
-
#error EIGEN_MAX_ALIGN_BYTES and EIGEN_DONT_ALIGN are both defined with EIGEN_MAX_ALIGN_BYTES!=0. Use EIGEN_MAX_ALIGN_BYTES=0 as a synonym of EIGEN_DONT_ALIGN.
|
|
782
|
-
#endif
|
|
783
|
-
|
|
784
|
-
#ifdef EIGEN_DONT_ALIGN
|
|
785
|
-
#ifdef EIGEN_MAX_ALIGN_BYTES
|
|
786
|
-
#undef EIGEN_MAX_ALIGN_BYTES
|
|
787
|
-
#endif
|
|
788
|
-
#define EIGEN_MAX_ALIGN_BYTES 0
|
|
789
|
-
#elif !defined(EIGEN_MAX_ALIGN_BYTES)
|
|
790
|
-
#define EIGEN_MAX_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
|
|
791
|
-
#endif
|
|
792
|
-
|
|
793
|
-
#if EIGEN_IDEAL_MAX_ALIGN_BYTES > EIGEN_MAX_ALIGN_BYTES
|
|
794
|
-
#define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
|
|
795
|
-
#else
|
|
796
|
-
#define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES
|
|
797
|
-
#endif
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
#ifndef EIGEN_UNALIGNED_VECTORIZE
|
|
801
|
-
#define EIGEN_UNALIGNED_VECTORIZE 1
|
|
802
|
-
#endif
|
|
803
|
-
|
|
804
|
-
//----------------------------------------------------------------------
|
|
805
|
-
|
|
806
|
-
|
|
807
1156
|
#ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD
|
|
808
1157
|
#define EIGEN_RESTRICT
|
|
809
1158
|
#endif
|
|
@@ -811,10 +1160,6 @@ namespace Eigen {
|
|
|
811
1160
|
#define EIGEN_RESTRICT __restrict
|
|
812
1161
|
#endif
|
|
813
1162
|
|
|
814
|
-
#ifndef EIGEN_STACK_ALLOCATION_LIMIT
|
|
815
|
-
// 131072 == 128 KB
|
|
816
|
-
#define EIGEN_STACK_ALLOCATION_LIMIT 131072
|
|
817
|
-
#endif
|
|
818
1163
|
|
|
819
1164
|
#ifndef EIGEN_DEFAULT_IO_FORMAT
|
|
820
1165
|
#ifdef EIGEN_MAKING_DOCS
|
|
@@ -829,8 +1174,23 @@ namespace Eigen {
|
|
|
829
1174
|
// just an empty macro !
|
|
830
1175
|
#define EIGEN_EMPTY
|
|
831
1176
|
|
|
832
|
-
|
|
833
|
-
|
|
1177
|
+
|
|
1178
|
+
// When compiling CUDA/HIP device code with NVCC or HIPCC
|
|
1179
|
+
// pull in math functions from the global namespace.
|
|
1180
|
+
// In host mode, and when device code is compiled with clang,
|
|
1181
|
+
// use the std versions.
|
|
1182
|
+
#if (defined(EIGEN_CUDA_ARCH) && defined(__NVCC__)) || defined(EIGEN_HIP_DEVICE_COMPILE)
|
|
1183
|
+
#define EIGEN_USING_STD(FUNC) using ::FUNC;
|
|
1184
|
+
#else
|
|
1185
|
+
#define EIGEN_USING_STD(FUNC) using std::FUNC;
|
|
1186
|
+
#endif
|
|
1187
|
+
|
|
1188
|
+
#if EIGEN_COMP_MSVC_STRICT && (EIGEN_COMP_MSVC < 1900 || (EIGEN_COMP_MSVC == 1900 && EIGEN_COMP_NVCC))
|
|
1189
|
+
// For older MSVC versions, as well as 1900 && CUDA 8, using the base operator is necessary,
|
|
1190
|
+
// otherwise we get duplicate definition errors
|
|
1191
|
+
// For later MSVC versions, we require explicit operator= definition, otherwise we get
|
|
1192
|
+
// use of implicitly deleted operator errors.
|
|
1193
|
+
// (cf Bugs 920, 1000, 1324, 2291)
|
|
834
1194
|
#define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
|
|
835
1195
|
using Base::operator =;
|
|
836
1196
|
#elif EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653)
|
|
@@ -856,7 +1216,7 @@ namespace Eigen {
|
|
|
856
1216
|
* This is necessary, because the implicit definition is deprecated if the copy-assignment is overridden.
|
|
857
1217
|
*/
|
|
858
1218
|
#if EIGEN_HAS_CXX11
|
|
859
|
-
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
|
|
1219
|
+
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) CLASS(const CLASS&) = default;
|
|
860
1220
|
#else
|
|
861
1221
|
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
|
|
862
1222
|
#endif
|
|
@@ -881,12 +1241,12 @@ namespace Eigen {
|
|
|
881
1241
|
*/
|
|
882
1242
|
#if EIGEN_HAS_CXX11
|
|
883
1243
|
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
|
|
884
|
-
|
|
885
|
-
|
|
1244
|
+
Derived() = default; \
|
|
1245
|
+
~Derived() = default;
|
|
886
1246
|
#else
|
|
887
1247
|
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
|
|
888
|
-
|
|
889
|
-
/*
|
|
1248
|
+
Derived() {}; \
|
|
1249
|
+
/* ~Derived() {}; */
|
|
890
1250
|
#endif
|
|
891
1251
|
|
|
892
1252
|
|
|
@@ -908,7 +1268,8 @@ namespace Eigen {
|
|
|
908
1268
|
typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \
|
|
909
1269
|
typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
|
|
910
1270
|
typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \
|
|
911
|
-
enum
|
|
1271
|
+
enum CompileTimeTraits \
|
|
1272
|
+
{ RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \
|
|
912
1273
|
ColsAtCompileTime = Eigen::internal::traits<Derived>::ColsAtCompileTime, \
|
|
913
1274
|
Flags = Eigen::internal::traits<Derived>::Flags, \
|
|
914
1275
|
SizeAtCompileTime = Base::SizeAtCompileTime, \
|
|
@@ -953,6 +1314,14 @@ namespace Eigen {
|
|
|
953
1314
|
|
|
954
1315
|
#define EIGEN_IMPLIES(a,b) (!(a) || (b))
|
|
955
1316
|
|
|
1317
|
+
#if EIGEN_HAS_BUILTIN(__builtin_expect) || EIGEN_COMP_GNUC
|
|
1318
|
+
#define EIGEN_PREDICT_FALSE(x) (__builtin_expect(x, false))
|
|
1319
|
+
#define EIGEN_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
|
|
1320
|
+
#else
|
|
1321
|
+
#define EIGEN_PREDICT_FALSE(x) (x)
|
|
1322
|
+
#define EIGEN_PREDICT_TRUE(x) (x)
|
|
1323
|
+
#endif
|
|
1324
|
+
|
|
956
1325
|
// the expression type of a standard coefficient wise binary operation
|
|
957
1326
|
#define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS,RHS,OPNAME) \
|
|
958
1327
|
CwiseBinaryOp< \
|
|
@@ -984,14 +1353,14 @@ namespace Eigen {
|
|
|
984
1353
|
const typename internal::plain_constant_type<EXPR,SCALAR>::type, const EXPR>
|
|
985
1354
|
|
|
986
1355
|
// Workaround for MSVC 2010 (see ML thread "patch with compile for for MSVC 2010")
|
|
987
|
-
#if EIGEN_COMP_MSVC_STRICT<=1600
|
|
1356
|
+
#if EIGEN_COMP_MSVC_STRICT && (EIGEN_COMP_MSVC_STRICT<=1600)
|
|
988
1357
|
#define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) typename internal::enable_if<true,X>::type
|
|
989
1358
|
#else
|
|
990
1359
|
#define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) X
|
|
991
1360
|
#endif
|
|
992
1361
|
|
|
993
1362
|
#define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) \
|
|
994
|
-
template <typename T> EIGEN_DEVICE_FUNC
|
|
1363
|
+
template <typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
|
|
995
1364
|
EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type,OPNAME))\
|
|
996
1365
|
(METHOD)(const T& scalar) const { \
|
|
997
1366
|
typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type PromotedT; \
|
|
@@ -1000,7 +1369,7 @@ namespace Eigen {
|
|
|
1000
1369
|
}
|
|
1001
1370
|
|
|
1002
1371
|
#define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \
|
|
1003
|
-
template <typename T> EIGEN_DEVICE_FUNC
|
|
1372
|
+
template <typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend \
|
|
1004
1373
|
EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type,Derived,OPNAME)) \
|
|
1005
1374
|
(METHOD)(const T& scalar, const StorageBaseType& matrix) { \
|
|
1006
1375
|
typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type PromotedT; \
|
|
@@ -1013,15 +1382,23 @@ namespace Eigen {
|
|
|
1013
1382
|
EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME)
|
|
1014
1383
|
|
|
1015
1384
|
|
|
1385
|
+
#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(EIGEN_CUDA_ARCH) && !defined(EIGEN_EXCEPTIONS) && !defined(EIGEN_USE_SYCL) && !defined(EIGEN_HIP_DEVICE_COMPILE)
|
|
1386
|
+
#define EIGEN_EXCEPTIONS
|
|
1387
|
+
#endif
|
|
1388
|
+
|
|
1389
|
+
|
|
1016
1390
|
#ifdef EIGEN_EXCEPTIONS
|
|
1017
1391
|
# define EIGEN_THROW_X(X) throw X
|
|
1018
1392
|
# define EIGEN_THROW throw
|
|
1019
1393
|
# define EIGEN_TRY try
|
|
1020
1394
|
# define EIGEN_CATCH(X) catch (X)
|
|
1021
1395
|
#else
|
|
1022
|
-
#
|
|
1396
|
+
# if defined(EIGEN_CUDA_ARCH)
|
|
1023
1397
|
# define EIGEN_THROW_X(X) asm("trap;")
|
|
1024
1398
|
# define EIGEN_THROW asm("trap;")
|
|
1399
|
+
# elif defined(EIGEN_HIP_DEVICE_COMPILE)
|
|
1400
|
+
# define EIGEN_THROW_X(X) asm("s_trap 0")
|
|
1401
|
+
# define EIGEN_THROW asm("s_trap 0")
|
|
1025
1402
|
# else
|
|
1026
1403
|
# define EIGEN_THROW_X(X) std::abort()
|
|
1027
1404
|
# define EIGEN_THROW std::abort()
|
|
@@ -1041,13 +1418,47 @@ namespace Eigen {
|
|
|
1041
1418
|
# define EIGEN_NOEXCEPT
|
|
1042
1419
|
# define EIGEN_NOEXCEPT_IF(x)
|
|
1043
1420
|
# define EIGEN_NO_THROW throw()
|
|
1044
|
-
# if EIGEN_COMP_MSVC
|
|
1421
|
+
# if EIGEN_COMP_MSVC || EIGEN_COMP_CXXVER>=17
|
|
1045
1422
|
// MSVC does not support exception specifications (warning C4290),
|
|
1046
|
-
// and they are deprecated in c++11 anyway.
|
|
1423
|
+
// and they are deprecated in c++11 anyway. This is even an error in c++17.
|
|
1047
1424
|
# define EIGEN_EXCEPTION_SPEC(X) throw()
|
|
1048
1425
|
# else
|
|
1049
1426
|
# define EIGEN_EXCEPTION_SPEC(X) throw(X)
|
|
1050
1427
|
# endif
|
|
1051
1428
|
#endif
|
|
1052
1429
|
|
|
1430
|
+
#if EIGEN_HAS_VARIADIC_TEMPLATES
|
|
1431
|
+
// The all function is used to enable a variadic version of eigen_assert which can take a parameter pack as its input.
|
|
1432
|
+
namespace Eigen {
|
|
1433
|
+
namespace internal {
|
|
1434
|
+
|
|
1435
|
+
inline bool all(){ return true; }
|
|
1436
|
+
|
|
1437
|
+
template<typename T, typename ...Ts>
|
|
1438
|
+
bool all(T t, Ts ... ts){ return t && all(ts...); }
|
|
1439
|
+
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
#endif
|
|
1443
|
+
|
|
1444
|
+
#if EIGEN_HAS_CXX11_OVERRIDE_FINAL
|
|
1445
|
+
// provide override and final specifiers if they are available:
|
|
1446
|
+
# define EIGEN_OVERRIDE override
|
|
1447
|
+
# define EIGEN_FINAL final
|
|
1448
|
+
#else
|
|
1449
|
+
# define EIGEN_OVERRIDE
|
|
1450
|
+
# define EIGEN_FINAL
|
|
1451
|
+
#endif
|
|
1452
|
+
|
|
1453
|
+
// Wrapping #pragma unroll in a macro since it is required for SYCL
|
|
1454
|
+
#if defined(SYCL_DEVICE_ONLY)
|
|
1455
|
+
#if defined(_MSC_VER)
|
|
1456
|
+
#define EIGEN_UNROLL_LOOP __pragma(unroll)
|
|
1457
|
+
#else
|
|
1458
|
+
#define EIGEN_UNROLL_LOOP _Pragma("unroll")
|
|
1459
|
+
#endif
|
|
1460
|
+
#else
|
|
1461
|
+
#define EIGEN_UNROLL_LOOP
|
|
1462
|
+
#endif
|
|
1463
|
+
|
|
1053
1464
|
#endif // EIGEN_MACROS_H
|