@smake/eigen 1.0.2 → 1.1.1

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.
Files changed (435) hide show
  1. package/README.md +1 -1
  2. package/eigen/Eigen/AccelerateSupport +52 -0
  3. package/eigen/Eigen/Cholesky +18 -21
  4. package/eigen/Eigen/CholmodSupport +28 -28
  5. package/eigen/Eigen/Core +235 -326
  6. package/eigen/Eigen/Eigenvalues +16 -14
  7. package/eigen/Eigen/Geometry +21 -24
  8. package/eigen/Eigen/Householder +9 -8
  9. package/eigen/Eigen/IterativeLinearSolvers +8 -4
  10. package/eigen/Eigen/Jacobi +14 -14
  11. package/eigen/Eigen/KLUSupport +43 -0
  12. package/eigen/Eigen/LU +16 -20
  13. package/eigen/Eigen/MetisSupport +12 -12
  14. package/eigen/Eigen/OrderingMethods +54 -54
  15. package/eigen/Eigen/PaStiXSupport +23 -20
  16. package/eigen/Eigen/PardisoSupport +17 -14
  17. package/eigen/Eigen/QR +18 -21
  18. package/eigen/Eigen/QtAlignedMalloc +5 -13
  19. package/eigen/Eigen/SPQRSupport +21 -14
  20. package/eigen/Eigen/SVD +23 -18
  21. package/eigen/Eigen/Sparse +1 -4
  22. package/eigen/Eigen/SparseCholesky +18 -23
  23. package/eigen/Eigen/SparseCore +18 -17
  24. package/eigen/Eigen/SparseLU +12 -8
  25. package/eigen/Eigen/SparseQR +16 -14
  26. package/eigen/Eigen/StdDeque +5 -2
  27. package/eigen/Eigen/StdList +5 -2
  28. package/eigen/Eigen/StdVector +5 -2
  29. package/eigen/Eigen/SuperLUSupport +30 -24
  30. package/eigen/Eigen/ThreadPool +80 -0
  31. package/eigen/Eigen/UmfPackSupport +19 -17
  32. package/eigen/Eigen/Version +14 -0
  33. package/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
  34. package/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
  35. package/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
  36. package/eigen/Eigen/src/Cholesky/LDLT.h +377 -401
  37. package/eigen/Eigen/src/Cholesky/LLT.h +332 -360
  38. package/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +81 -56
  39. package/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +620 -521
  40. package/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
  41. package/eigen/Eigen/src/Core/ArithmeticSequence.h +239 -0
  42. package/eigen/Eigen/src/Core/Array.h +341 -294
  43. package/eigen/Eigen/src/Core/ArrayBase.h +190 -203
  44. package/eigen/Eigen/src/Core/ArrayWrapper.h +127 -171
  45. package/eigen/Eigen/src/Core/Assign.h +30 -40
  46. package/eigen/Eigen/src/Core/AssignEvaluator.h +711 -589
  47. package/eigen/Eigen/src/Core/Assign_MKL.h +130 -125
  48. package/eigen/Eigen/src/Core/BandMatrix.h +268 -283
  49. package/eigen/Eigen/src/Core/Block.h +375 -398
  50. package/eigen/Eigen/src/Core/CommaInitializer.h +86 -97
  51. package/eigen/Eigen/src/Core/ConditionEstimator.h +51 -53
  52. package/eigen/Eigen/src/Core/CoreEvaluators.h +1356 -1026
  53. package/eigen/Eigen/src/Core/CoreIterators.h +73 -59
  54. package/eigen/Eigen/src/Core/CwiseBinaryOp.h +114 -132
  55. package/eigen/Eigen/src/Core/CwiseNullaryOp.h +726 -617
  56. package/eigen/Eigen/src/Core/CwiseTernaryOp.h +77 -103
  57. package/eigen/Eigen/src/Core/CwiseUnaryOp.h +56 -68
  58. package/eigen/Eigen/src/Core/CwiseUnaryView.h +132 -95
  59. package/eigen/Eigen/src/Core/DenseBase.h +632 -571
  60. package/eigen/Eigen/src/Core/DenseCoeffsBase.h +511 -624
  61. package/eigen/Eigen/src/Core/DenseStorage.h +512 -509
  62. package/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
  63. package/eigen/Eigen/src/Core/Diagonal.h +169 -210
  64. package/eigen/Eigen/src/Core/DiagonalMatrix.h +351 -274
  65. package/eigen/Eigen/src/Core/DiagonalProduct.h +12 -10
  66. package/eigen/Eigen/src/Core/Dot.h +172 -222
  67. package/eigen/Eigen/src/Core/EigenBase.h +75 -85
  68. package/eigen/Eigen/src/Core/Fill.h +138 -0
  69. package/eigen/Eigen/src/Core/FindCoeff.h +464 -0
  70. package/eigen/Eigen/src/Core/ForceAlignedAccess.h +90 -109
  71. package/eigen/Eigen/src/Core/Fuzzy.h +82 -105
  72. package/eigen/Eigen/src/Core/GeneralProduct.h +327 -263
  73. package/eigen/Eigen/src/Core/GenericPacketMath.h +1472 -360
  74. package/eigen/Eigen/src/Core/GlobalFunctions.h +194 -151
  75. package/eigen/Eigen/src/Core/IO.h +147 -139
  76. package/eigen/Eigen/src/Core/IndexedView.h +321 -0
  77. package/eigen/Eigen/src/Core/InnerProduct.h +260 -0
  78. package/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
  79. package/eigen/Eigen/src/Core/Inverse.h +56 -66
  80. package/eigen/Eigen/src/Core/Map.h +124 -142
  81. package/eigen/Eigen/src/Core/MapBase.h +256 -281
  82. package/eigen/Eigen/src/Core/MathFunctions.h +1620 -938
  83. package/eigen/Eigen/src/Core/MathFunctionsImpl.h +233 -71
  84. package/eigen/Eigen/src/Core/Matrix.h +491 -416
  85. package/eigen/Eigen/src/Core/MatrixBase.h +468 -453
  86. package/eigen/Eigen/src/Core/NestByValue.h +66 -85
  87. package/eigen/Eigen/src/Core/NoAlias.h +79 -85
  88. package/eigen/Eigen/src/Core/NumTraits.h +235 -148
  89. package/eigen/Eigen/src/Core/PartialReduxEvaluator.h +253 -0
  90. package/eigen/Eigen/src/Core/PermutationMatrix.h +461 -511
  91. package/eigen/Eigen/src/Core/PlainObjectBase.h +871 -894
  92. package/eigen/Eigen/src/Core/Product.h +260 -139
  93. package/eigen/Eigen/src/Core/ProductEvaluators.h +863 -714
  94. package/eigen/Eigen/src/Core/Random.h +161 -136
  95. package/eigen/Eigen/src/Core/RandomImpl.h +262 -0
  96. package/eigen/Eigen/src/Core/RealView.h +250 -0
  97. package/eigen/Eigen/src/Core/Redux.h +366 -336
  98. package/eigen/Eigen/src/Core/Ref.h +308 -209
  99. package/eigen/Eigen/src/Core/Replicate.h +94 -106
  100. package/eigen/Eigen/src/Core/Reshaped.h +398 -0
  101. package/eigen/Eigen/src/Core/ReturnByValue.h +49 -55
  102. package/eigen/Eigen/src/Core/Reverse.h +136 -145
  103. package/eigen/Eigen/src/Core/Select.h +70 -140
  104. package/eigen/Eigen/src/Core/SelfAdjointView.h +262 -285
  105. package/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +23 -20
  106. package/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
  107. package/eigen/Eigen/src/Core/Solve.h +97 -111
  108. package/eigen/Eigen/src/Core/SolveTriangular.h +131 -129
  109. package/eigen/Eigen/src/Core/SolverBase.h +138 -101
  110. package/eigen/Eigen/src/Core/StableNorm.h +156 -160
  111. package/eigen/Eigen/src/Core/StlIterators.h +619 -0
  112. package/eigen/Eigen/src/Core/Stride.h +91 -88
  113. package/eigen/Eigen/src/Core/Swap.h +70 -38
  114. package/eigen/Eigen/src/Core/Transpose.h +295 -273
  115. package/eigen/Eigen/src/Core/Transpositions.h +272 -317
  116. package/eigen/Eigen/src/Core/TriangularMatrix.h +670 -755
  117. package/eigen/Eigen/src/Core/VectorBlock.h +59 -72
  118. package/eigen/Eigen/src/Core/VectorwiseOp.h +668 -630
  119. package/eigen/Eigen/src/Core/Visitor.h +480 -216
  120. package/eigen/Eigen/src/Core/arch/AVX/Complex.h +407 -293
  121. package/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +79 -388
  122. package/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +2935 -491
  123. package/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
  124. package/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +279 -22
  125. package/eigen/Eigen/src/Core/arch/AVX512/Complex.h +472 -0
  126. package/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
  127. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +85 -333
  128. package/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
  129. package/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +2490 -649
  130. package/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
  131. package/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
  132. package/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
  133. package/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
  134. package/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +277 -0
  135. package/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
  136. package/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +521 -298
  137. package/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +39 -280
  138. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +3686 -0
  139. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +205 -0
  140. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +901 -0
  141. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
  142. package/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
  143. package/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +3391 -723
  144. package/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
  145. package/eigen/Eigen/src/Core/arch/Default/BFloat16.h +866 -0
  146. package/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +113 -14
  147. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +2634 -0
  148. package/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +227 -0
  149. package/eigen/Eigen/src/Core/arch/Default/Half.h +1091 -0
  150. package/eigen/Eigen/src/Core/arch/Default/Settings.h +11 -13
  151. package/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
  152. package/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +104 -0
  153. package/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1712 -0
  154. package/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
  155. package/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +77 -0
  156. package/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  157. package/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
  158. package/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
  159. package/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
  160. package/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
  161. package/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
  162. package/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
  163. package/eigen/Eigen/src/Core/arch/MSA/Complex.h +620 -0
  164. package/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +379 -0
  165. package/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1237 -0
  166. package/eigen/Eigen/src/Core/arch/NEON/Complex.h +531 -289
  167. package/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +243 -0
  168. package/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +50 -73
  169. package/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +5915 -579
  170. package/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1642 -0
  171. package/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
  172. package/eigen/Eigen/src/Core/arch/SSE/Complex.h +366 -334
  173. package/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +40 -514
  174. package/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +2164 -675
  175. package/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
  176. package/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +188 -35
  177. package/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +48 -0
  178. package/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +674 -0
  179. package/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +52 -0
  180. package/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +227 -0
  181. package/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +303 -0
  182. package/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +576 -0
  183. package/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +83 -0
  184. package/eigen/Eigen/src/Core/arch/ZVector/Complex.h +434 -261
  185. package/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +160 -53
  186. package/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +1073 -605
  187. package/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +123 -117
  188. package/eigen/Eigen/src/Core/functors/BinaryFunctors.h +594 -322
  189. package/eigen/Eigen/src/Core/functors/NullaryFunctors.h +204 -118
  190. package/eigen/Eigen/src/Core/functors/StlFunctors.h +110 -97
  191. package/eigen/Eigen/src/Core/functors/TernaryFunctors.h +34 -7
  192. package/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1158 -530
  193. package/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2329 -1333
  194. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +328 -364
  195. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +191 -178
  196. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +85 -82
  197. package/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +154 -73
  198. package/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +396 -542
  199. package/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +80 -77
  200. package/eigen/Eigen/src/Core/products/Parallelizer.h +208 -92
  201. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +331 -375
  202. package/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +206 -224
  203. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +139 -146
  204. package/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +58 -61
  205. package/eigen/Eigen/src/Core/products/SelfadjointProduct.h +71 -71
  206. package/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +48 -46
  207. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +294 -369
  208. package/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +246 -238
  209. package/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +244 -247
  210. package/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +212 -192
  211. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +328 -275
  212. package/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +108 -109
  213. package/eigen/Eigen/src/Core/products/TriangularSolverVector.h +70 -93
  214. package/eigen/Eigen/src/Core/util/Assert.h +158 -0
  215. package/eigen/Eigen/src/Core/util/BlasUtil.h +413 -290
  216. package/eigen/Eigen/src/Core/util/ConfigureVectorization.h +543 -0
  217. package/eigen/Eigen/src/Core/util/Constants.h +314 -263
  218. package/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +130 -78
  219. package/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
  220. package/eigen/Eigen/src/Core/util/ForwardDeclarations.h +450 -224
  221. package/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
  222. package/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
  223. package/eigen/Eigen/src/Core/util/IndexedViewHelper.h +487 -0
  224. package/eigen/Eigen/src/Core/util/IntegralConstant.h +279 -0
  225. package/eigen/Eigen/src/Core/util/MKL_support.h +39 -30
  226. package/eigen/Eigen/src/Core/util/Macros.h +939 -646
  227. package/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
  228. package/eigen/Eigen/src/Core/util/Memory.h +1042 -650
  229. package/eigen/Eigen/src/Core/util/Meta.h +618 -426
  230. package/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
  231. package/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +32 -19
  232. package/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  233. package/eigen/Eigen/src/Core/util/Serializer.h +209 -0
  234. package/eigen/Eigen/src/Core/util/StaticAssert.h +51 -164
  235. package/eigen/Eigen/src/Core/util/SymbolicIndex.h +445 -0
  236. package/eigen/Eigen/src/Core/util/XprHelper.h +793 -538
  237. package/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +246 -277
  238. package/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +299 -319
  239. package/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +52 -48
  240. package/eigen/Eigen/src/Eigenvalues/EigenSolver.h +413 -456
  241. package/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +309 -325
  242. package/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +157 -171
  243. package/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +292 -310
  244. package/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
  245. package/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +91 -107
  246. package/eigen/Eigen/src/Eigenvalues/RealQZ.h +539 -606
  247. package/eigen/Eigen/src/Eigenvalues/RealSchur.h +348 -382
  248. package/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +41 -35
  249. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +579 -600
  250. package/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +47 -44
  251. package/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +434 -461
  252. package/eigen/Eigen/src/Geometry/AlignedBox.h +307 -214
  253. package/eigen/Eigen/src/Geometry/AngleAxis.h +135 -137
  254. package/eigen/Eigen/src/Geometry/EulerAngles.h +163 -74
  255. package/eigen/Eigen/src/Geometry/Homogeneous.h +289 -333
  256. package/eigen/Eigen/src/Geometry/Hyperplane.h +152 -161
  257. package/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
  258. package/eigen/Eigen/src/Geometry/OrthoMethods.h +168 -145
  259. package/eigen/Eigen/src/Geometry/ParametrizedLine.h +141 -104
  260. package/eigen/Eigen/src/Geometry/Quaternion.h +595 -497
  261. package/eigen/Eigen/src/Geometry/Rotation2D.h +110 -108
  262. package/eigen/Eigen/src/Geometry/RotationBase.h +148 -145
  263. package/eigen/Eigen/src/Geometry/Scaling.h +115 -90
  264. package/eigen/Eigen/src/Geometry/Transform.h +896 -953
  265. package/eigen/Eigen/src/Geometry/Translation.h +100 -98
  266. package/eigen/Eigen/src/Geometry/Umeyama.h +79 -84
  267. package/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +154 -0
  268. package/eigen/Eigen/src/Householder/BlockHouseholder.h +54 -42
  269. package/eigen/Eigen/src/Householder/Householder.h +104 -122
  270. package/eigen/Eigen/src/Householder/HouseholderSequence.h +416 -382
  271. package/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
  272. package/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +153 -166
  273. package/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +127 -138
  274. package/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +95 -124
  275. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +269 -267
  276. package/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +246 -259
  277. package/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
  278. package/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +218 -217
  279. package/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +80 -103
  280. package/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +59 -63
  281. package/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
  282. package/eigen/Eigen/src/Jacobi/Jacobi.h +256 -291
  283. package/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
  284. package/eigen/Eigen/src/KLUSupport/KLUSupport.h +339 -0
  285. package/eigen/Eigen/src/LU/Determinant.h +60 -63
  286. package/eigen/Eigen/src/LU/FullPivLU.h +561 -626
  287. package/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
  288. package/eigen/Eigen/src/LU/InverseImpl.h +213 -275
  289. package/eigen/Eigen/src/LU/PartialPivLU.h +407 -435
  290. package/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +54 -40
  291. package/eigen/Eigen/src/LU/arch/InverseSize4.h +353 -0
  292. package/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
  293. package/eigen/Eigen/src/MetisSupport/MetisSupport.h +81 -93
  294. package/eigen/Eigen/src/OrderingMethods/Amd.h +250 -282
  295. package/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +950 -1103
  296. package/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
  297. package/eigen/Eigen/src/OrderingMethods/Ordering.h +111 -122
  298. package/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
  299. package/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +524 -570
  300. package/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
  301. package/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +385 -429
  302. package/eigen/Eigen/src/QR/ColPivHouseholderQR.h +494 -473
  303. package/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +120 -56
  304. package/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +223 -137
  305. package/eigen/Eigen/src/QR/FullPivHouseholderQR.h +517 -460
  306. package/eigen/Eigen/src/QR/HouseholderQR.h +412 -278
  307. package/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +32 -23
  308. package/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
  309. package/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
  310. package/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +263 -261
  311. package/eigen/Eigen/src/SVD/BDCSVD.h +872 -679
  312. package/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
  313. package/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
  314. package/eigen/Eigen/src/SVD/JacobiSVD.h +585 -543
  315. package/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +85 -49
  316. package/eigen/Eigen/src/SVD/SVDBase.h +281 -160
  317. package/eigen/Eigen/src/SVD/UpperBidiagonalization.h +202 -237
  318. package/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
  319. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +769 -590
  320. package/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +318 -129
  321. package/eigen/Eigen/src/SparseCore/AmbiVector.h +202 -251
  322. package/eigen/Eigen/src/SparseCore/CompressedStorage.h +184 -236
  323. package/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +140 -184
  324. package/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
  325. package/eigen/Eigen/src/SparseCore/SparseAssign.h +174 -111
  326. package/eigen/Eigen/src/SparseCore/SparseBlock.h +408 -477
  327. package/eigen/Eigen/src/SparseCore/SparseColEtree.h +100 -112
  328. package/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +531 -280
  329. package/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +559 -347
  330. package/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +100 -108
  331. package/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +185 -191
  332. package/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +71 -71
  333. package/eigen/Eigen/src/SparseCore/SparseDot.h +49 -47
  334. package/eigen/Eigen/src/SparseCore/SparseFuzzy.h +13 -11
  335. package/eigen/Eigen/src/SparseCore/SparseMap.h +243 -253
  336. package/eigen/Eigen/src/SparseCore/SparseMatrix.h +1614 -1142
  337. package/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +403 -357
  338. package/eigen/Eigen/src/SparseCore/SparsePermutation.h +186 -115
  339. package/eigen/Eigen/src/SparseCore/SparseProduct.h +100 -91
  340. package/eigen/Eigen/src/SparseCore/SparseRedux.h +22 -24
  341. package/eigen/Eigen/src/SparseCore/SparseRef.h +268 -295
  342. package/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +371 -414
  343. package/eigen/Eigen/src/SparseCore/SparseSolverBase.h +78 -87
  344. package/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +81 -95
  345. package/eigen/Eigen/src/SparseCore/SparseTranspose.h +62 -71
  346. package/eigen/Eigen/src/SparseCore/SparseTriangularView.h +132 -144
  347. package/eigen/Eigen/src/SparseCore/SparseUtil.h +146 -115
  348. package/eigen/Eigen/src/SparseCore/SparseVector.h +426 -372
  349. package/eigen/Eigen/src/SparseCore/SparseView.h +164 -193
  350. package/eigen/Eigen/src/SparseCore/TriangularSolver.h +129 -170
  351. package/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
  352. package/eigen/Eigen/src/SparseLU/SparseLU.h +814 -618
  353. package/eigen/Eigen/src/SparseLU/SparseLUImpl.h +61 -48
  354. package/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +102 -118
  355. package/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +38 -35
  356. package/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +273 -255
  357. package/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +44 -49
  358. package/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +104 -108
  359. package/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +90 -101
  360. package/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +57 -58
  361. package/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +43 -55
  362. package/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +74 -71
  363. package/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +125 -133
  364. package/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +136 -159
  365. package/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +51 -52
  366. package/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +67 -73
  367. package/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +24 -26
  368. package/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
  369. package/eigen/Eigen/src/SparseQR/SparseQR.h +451 -490
  370. package/eigen/Eigen/src/StlSupport/StdDeque.h +28 -105
  371. package/eigen/Eigen/src/StlSupport/StdList.h +28 -84
  372. package/eigen/Eigen/src/StlSupport/StdVector.h +28 -108
  373. package/eigen/Eigen/src/StlSupport/details.h +48 -50
  374. package/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
  375. package/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +634 -732
  376. package/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
  377. package/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
  378. package/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
  379. package/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
  380. package/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
  381. package/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
  382. package/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
  383. package/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
  384. package/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
  385. package/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
  386. package/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
  387. package/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
  388. package/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
  389. package/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +480 -380
  390. package/eigen/Eigen/src/misc/Image.h +41 -43
  391. package/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
  392. package/eigen/Eigen/src/misc/Kernel.h +39 -41
  393. package/eigen/Eigen/src/misc/RealSvd2x2.h +19 -21
  394. package/eigen/Eigen/src/misc/blas.h +83 -426
  395. package/eigen/Eigen/src/misc/lapacke.h +9976 -16182
  396. package/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
  397. package/eigen/Eigen/src/misc/lapacke_mangling.h +4 -5
  398. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
  399. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
  400. package/eigen/Eigen/src/plugins/BlockMethods.inc +1370 -0
  401. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
  402. package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.inc +167 -0
  403. package/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
  404. package/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
  405. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
  406. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
  407. package/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
  408. package/lib/LibEigen.d.ts +4 -0
  409. package/lib/LibEigen.js +14 -0
  410. package/lib/index.d.ts +1 -1
  411. package/lib/index.js +7 -3
  412. package/package.json +2 -10
  413. package/eigen/Eigen/CMakeLists.txt +0 -19
  414. package/eigen/Eigen/src/Core/BooleanRedux.h +0 -164
  415. package/eigen/Eigen/src/Core/arch/CUDA/Complex.h +0 -103
  416. package/eigen/Eigen/src/Core/arch/CUDA/Half.h +0 -675
  417. package/eigen/Eigen/src/Core/arch/CUDA/MathFunctions.h +0 -91
  418. package/eigen/Eigen/src/Core/arch/CUDA/PacketMath.h +0 -333
  419. package/eigen/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +0 -1124
  420. package/eigen/Eigen/src/Core/arch/CUDA/TypeCasting.h +0 -212
  421. package/eigen/Eigen/src/Core/util/NonMPL2.h +0 -3
  422. package/eigen/Eigen/src/Geometry/arch/Geometry_SSE.h +0 -161
  423. package/eigen/Eigen/src/LU/arch/Inverse_SSE.h +0 -338
  424. package/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +0 -67
  425. package/eigen/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +0 -280
  426. package/eigen/Eigen/src/misc/lapack.h +0 -152
  427. package/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.h +0 -332
  428. package/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.h +0 -552
  429. package/eigen/Eigen/src/plugins/BlockMethods.h +0 -1058
  430. package/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.h +0 -115
  431. package/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.h +0 -163
  432. package/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.h +0 -152
  433. package/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.h +0 -85
  434. package/lib/eigen.d.ts +0 -2
  435. package/lib/eigen.js +0 -15
@@ -10,488 +10,839 @@
10
10
 
11
11
  #ifndef EIGEN_MACROS_H
12
12
  #define EIGEN_MACROS_H
13
+ // IWYU pragma: private
14
+ #include "../InternalHeaderCheck.h"
13
15
 
14
- #define EIGEN_WORLD_VERSION 3
15
- #define EIGEN_MAJOR_VERSION 3
16
- #define EIGEN_MINOR_VERSION 9
16
+ //------------------------------------------------------------------------------------------
17
+ // Eigen version and basic defaults
18
+ //------------------------------------------------------------------------------------------
19
+
20
+ #define EIGEN_VERSION_AT_LEAST(x, y, z) \
21
+ (EIGEN_MAJOR_VERSION > x || \
22
+ (EIGEN_MAJOR_VERSION >= x && (EIGEN_MINOR_VERSION > y || (EIGEN_MINOR_VERSION >= y && EIGEN_PATCH_VERSION >= z))))
23
+
24
+ #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
25
+ #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor
26
+ #else
27
+ #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::ColMajor
28
+ #endif
29
+
30
+ #ifndef EIGEN_DEFAULT_DENSE_INDEX_TYPE
31
+ #define EIGEN_DEFAULT_DENSE_INDEX_TYPE std::ptrdiff_t
32
+ #endif
17
33
 
18
- #define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
19
- (EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
20
- EIGEN_MINOR_VERSION>=z))))
34
+ // Upperbound on the C++ version to use.
35
+ // Expected values are 03, 11, 14, 17, etc.
36
+ // By default, let's use an arbitrarily large C++ version.
37
+ #ifndef EIGEN_MAX_CPP_VER
38
+ #define EIGEN_MAX_CPP_VER 99
39
+ #endif
21
40
 
41
+ /** Allows to disable some optimizations which might affect the accuracy of the result.
42
+ * Such optimization are enabled by default, and set EIGEN_FAST_MATH to 0 to disable them.
43
+ * They currently include:
44
+ * - single precision ArrayBase::sin() and ArrayBase::cos() for SSE and AVX vectorization.
45
+ */
46
+ #ifndef EIGEN_FAST_MATH
47
+ #define EIGEN_FAST_MATH 1
48
+ #endif
49
+
50
+ #ifndef EIGEN_STACK_ALLOCATION_LIMIT
51
+ // 131072 == 128 KB
52
+ #define EIGEN_STACK_ALLOCATION_LIMIT 131072
53
+ #endif
54
+
55
+ /* Specify whether to use std::fma for scalar multiply-add instructions.
56
+ *
57
+ * On machines that have FMA as a single instruction, this will generally
58
+ * improve precision without significant performance implications.
59
+ *
60
+ * Without a single instruction, performance has been found to be reduced 2-3x
61
+ * on Intel CPUs, and up to 30x for WASM.
62
+ *
63
+ * If unspecified, defaults to using FMA if hardware support is available.
64
+ * The default should be used in most cases to ensure consistency between
65
+ * vectorized and non-vectorized paths.
66
+ */
67
+ #ifndef EIGEN_SCALAR_MADD_USE_FMA
68
+ #ifdef EIGEN_VECTORIZE_FMA
69
+ #define EIGEN_SCALAR_MADD_USE_FMA 1
70
+ #else
71
+ #define EIGEN_SCALAR_MADD_USE_FMA 0
72
+ #endif
73
+ #endif
74
+
75
+ //------------------------------------------------------------------------------------------
22
76
  // Compiler identification, EIGEN_COMP_*
77
+ //------------------------------------------------------------------------------------------
23
78
 
24
- /// \internal EIGEN_COMP_GNUC set to 1 for all compilers compatible with GCC
79
+ /// \internal EIGEN_COMP_GNUC set to version (e.g., 951 for GCC 9.5.1) for all compilers compatible with GCC
25
80
  #ifdef __GNUC__
26
- #define EIGEN_COMP_GNUC 1
81
+ #define EIGEN_COMP_GNUC (__GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__)
27
82
  #else
28
- #define EIGEN_COMP_GNUC 0
83
+ #define EIGEN_COMP_GNUC 0
29
84
  #endif
30
85
 
31
- /// \internal EIGEN_COMP_CLANG set to major+minor version (e.g., 307 for clang 3.7) if the compiler is clang
86
+ /// \internal EIGEN_COMP_CLANG set to version (e.g., 372 for clang 3.7.2) if the compiler is clang
32
87
  #if defined(__clang__)
33
- #define EIGEN_COMP_CLANG (__clang_major__*100+__clang_minor__)
88
+ #define EIGEN_COMP_CLANG (__clang_major__ * 100 + __clang_minor__ * 10 + __clang_patchlevel__)
34
89
  #else
35
- #define EIGEN_COMP_CLANG 0
90
+ #define EIGEN_COMP_CLANG 0
36
91
  #endif
37
92
 
93
+ /// \internal EIGEN_COMP_CLANGAPPLE set to the version number (e.g. 9000000 for AppleClang 9.0) if the compiler is
94
+ /// AppleClang
95
+ #if defined(__clang__) && defined(__apple_build_version__)
96
+ #define EIGEN_COMP_CLANGAPPLE __apple_build_version__
97
+ #else
98
+ #define EIGEN_COMP_CLANGAPPLE 0
99
+ #endif
100
+
101
+ /// \internal EIGEN_COMP_CASTXML set to 1 if being preprocessed by CastXML
102
+ #if defined(__castxml__)
103
+ #define EIGEN_COMP_CASTXML 1
104
+ #else
105
+ #define EIGEN_COMP_CASTXML 0
106
+ #endif
38
107
 
39
108
  /// \internal EIGEN_COMP_LLVM set to 1 if the compiler backend is llvm
40
109
  #if defined(__llvm__)
41
- #define EIGEN_COMP_LLVM 1
110
+ #define EIGEN_COMP_LLVM 1
42
111
  #else
43
- #define EIGEN_COMP_LLVM 0
112
+ #define EIGEN_COMP_LLVM 0
44
113
  #endif
45
114
 
46
- /// \internal EIGEN_COMP_ICC set to __INTEL_COMPILER if the compiler is Intel compiler, 0 otherwise
115
+ /// \internal EIGEN_COMP_ICC set to __INTEL_COMPILER if the compiler is Intel icc compiler, 0 otherwise
47
116
  #if defined(__INTEL_COMPILER)
48
- #define EIGEN_COMP_ICC __INTEL_COMPILER
117
+ #define EIGEN_COMP_ICC __INTEL_COMPILER
49
118
  #else
50
- #define EIGEN_COMP_ICC 0
119
+ #define EIGEN_COMP_ICC 0
120
+ #endif
121
+
122
+ /// \internal EIGEN_COMP_CLANGICC set to __INTEL_CLANG_COMPILER if the compiler is Intel icx compiler, 0 otherwise
123
+ #if defined(__INTEL_CLANG_COMPILER)
124
+ #define EIGEN_COMP_CLANGICC __INTEL_CLANG_COMPILER
125
+ #else
126
+ #define EIGEN_COMP_CLANGICC 0
51
127
  #endif
52
128
 
53
129
  /// \internal EIGEN_COMP_MINGW set to 1 if the compiler is mingw
54
130
  #if defined(__MINGW32__)
55
- #define EIGEN_COMP_MINGW 1
131
+ #define EIGEN_COMP_MINGW 1
56
132
  #else
57
- #define EIGEN_COMP_MINGW 0
133
+ #define EIGEN_COMP_MINGW 0
58
134
  #endif
59
135
 
60
136
  /// \internal EIGEN_COMP_SUNCC set to 1 if the compiler is Solaris Studio
61
137
  #if defined(__SUNPRO_CC)
62
- #define EIGEN_COMP_SUNCC 1
138
+ #define EIGEN_COMP_SUNCC 1
63
139
  #else
64
- #define EIGEN_COMP_SUNCC 0
140
+ #define EIGEN_COMP_SUNCC 0
65
141
  #endif
66
142
 
67
143
  /// \internal EIGEN_COMP_MSVC set to _MSC_VER if the compiler is Microsoft Visual C++, 0 otherwise.
68
144
  #if defined(_MSC_VER)
69
- #define EIGEN_COMP_MSVC _MSC_VER
145
+ #define EIGEN_COMP_MSVC _MSC_VER
146
+ #else
147
+ #define EIGEN_COMP_MSVC 0
148
+ #endif
149
+
150
+ #if defined(__NVCC__)
151
+ #if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9)
152
+ #define EIGEN_COMP_NVCC ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100))
153
+ #elif defined(__CUDACC_VER__)
154
+ #define EIGEN_COMP_NVCC __CUDACC_VER__
70
155
  #else
71
- #define EIGEN_COMP_MSVC 0
156
+ #error "NVCC did not define compiler version."
157
+ #endif
158
+ #else
159
+ #define EIGEN_COMP_NVCC 0
72
160
  #endif
73
161
 
74
162
  // For the record, here is a table summarizing the possible values for EIGEN_COMP_MSVC:
75
- // name ver MSC_VER
76
- // 2008 9 1500
77
- // 2010 10 1600
78
- // 2012 11 1700
79
- // 2013 12 1800
80
- // 2015 14 1900
81
- // "15" 15 1900
82
-
83
- /// \internal EIGEN_COMP_MSVC_STRICT set to 1 if the compiler is really Microsoft Visual C++ and not ,e.g., ICC or clang-cl
163
+ // name ver MSC_VER
164
+ // 2015 14 1900
165
+ // "15" 15 1900
166
+ // 2017-14.1 15.0 1910
167
+ // 2017-14.11 15.3 1911
168
+ // 2017-14.12 15.5 1912
169
+ // 2017-14.13 15.6 1913
170
+ // 2017-14.14 15.7 1914
171
+ // 2017 15.8 1915
172
+ // 2017 15.9 1916
173
+ // 2019 RTW 16.0 1920
174
+
175
+ /// \internal EIGEN_COMP_MSVC_LANG set to _MSVC_LANG if the compiler is Microsoft Visual C++, 0 otherwise.
176
+ #if defined(_MSVC_LANG)
177
+ #define EIGEN_COMP_MSVC_LANG _MSVC_LANG
178
+ #else
179
+ #define EIGEN_COMP_MSVC_LANG 0
180
+ #endif
181
+
182
+ // For the record, here is a table summarizing the possible values for EIGEN_COMP_MSVC_LANG:
183
+ // MSVC option Standard MSVC_LANG
184
+ // /std:c++14 (default as of VS 2019) C++14 201402L
185
+ // /std:c++17 C++17 201703L
186
+ // /std:c++latest >C++17 >201703L
187
+
188
+ /// \internal EIGEN_COMP_MSVC_STRICT set to 1 if the compiler is really Microsoft Visual C++ and not ,e.g., ICC or
189
+ /// clang-cl
84
190
  #if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC || EIGEN_COMP_LLVM || EIGEN_COMP_CLANG)
85
- #define EIGEN_COMP_MSVC_STRICT _MSC_VER
191
+ #define EIGEN_COMP_MSVC_STRICT _MSC_VER
86
192
  #else
87
- #define EIGEN_COMP_MSVC_STRICT 0
193
+ #define EIGEN_COMP_MSVC_STRICT 0
88
194
  #endif
89
195
 
90
- /// \internal EIGEN_COMP_IBM set to 1 if the compiler is IBM XL C++
91
- #if defined(__IBMCPP__) || defined(__xlc__)
92
- #define EIGEN_COMP_IBM 1
196
+ /// \internal EIGEN_COMP_IBM set to xlc version if the compiler is IBM XL C++
197
+ // XLC version
198
+ // 3.1 0x0301
199
+ // 4.5 0x0405
200
+ // 5.0 0x0500
201
+ // 12.1 0x0C01
202
+ #if defined(__IBMCPP__) || defined(__xlc__) || defined(__ibmxl__)
203
+ #define EIGEN_COMP_IBM __xlC__
93
204
  #else
94
- #define EIGEN_COMP_IBM 0
205
+ #define EIGEN_COMP_IBM 0
95
206
  #endif
96
207
 
97
- /// \internal EIGEN_COMP_PGI set to 1 if the compiler is Portland Group Compiler
208
+ /// \internal EIGEN_COMP_PGI set to PGI version if the compiler is Portland Group Compiler
98
209
  #if defined(__PGI)
99
- #define EIGEN_COMP_PGI 1
210
+ #define EIGEN_COMP_PGI (__PGIC__ * 100 + __PGIC_MINOR__)
211
+ #else
212
+ #define EIGEN_COMP_PGI 0
213
+ #endif
214
+
215
+ /// \internal EIGEN_COMP_NVHPC set to NVHPC version if the compiler is nvc++
216
+ #if defined(__NVCOMPILER)
217
+ #define EIGEN_COMP_NVHPC (__NVCOMPILER_MAJOR__ * 100 + __NVCOMPILER_MINOR__)
100
218
  #else
101
- #define EIGEN_COMP_PGI 0
219
+ #define EIGEN_COMP_NVHPC 0
102
220
  #endif
103
221
 
104
222
  /// \internal EIGEN_COMP_ARM set to 1 if the compiler is ARM Compiler
105
223
  #if defined(__CC_ARM) || defined(__ARMCC_VERSION)
106
- #define EIGEN_COMP_ARM 1
224
+ #define EIGEN_COMP_ARM 1
107
225
  #else
108
- #define EIGEN_COMP_ARM 0
226
+ #define EIGEN_COMP_ARM 0
109
227
  #endif
110
228
 
111
- /// \internal EIGEN_COMP_ARM set to 1 if the compiler is ARM Compiler
229
+ /// \internal EIGEN_COMP_EMSCRIPTEN set to 1 if the compiler is Emscripten Compiler
112
230
  #if defined(__EMSCRIPTEN__)
113
- #define EIGEN_COMP_EMSCRIPTEN 1
231
+ #define EIGEN_COMP_EMSCRIPTEN 1
114
232
  #else
115
- #define EIGEN_COMP_EMSCRIPTEN 0
233
+ #define EIGEN_COMP_EMSCRIPTEN 0
116
234
  #endif
117
235
 
236
+ /// \internal EIGEN_COMP_FCC set to FCC version if the compiler is Fujitsu Compiler (traditional mode)
237
+ /// \note The Fujitsu C/C++ compiler uses the traditional mode based
238
+ /// on EDG g++ 6.1 by default or if invoked with the -Nnoclang flag
239
+ #if defined(__FUJITSU)
240
+ #define EIGEN_COMP_FCC (__FCC_major__ * 100 + __FCC_minor__ * 10 + __FCC_patchlevel__)
241
+ #else
242
+ #define EIGEN_COMP_FCC 0
243
+ #endif
118
244
 
119
- /// \internal EIGEN_GNUC_STRICT set to 1 if the compiler is really GCC and not a compatible compiler (e.g., ICC, clang, mingw, etc.)
120
- #if EIGEN_COMP_GNUC && !(EIGEN_COMP_CLANG || EIGEN_COMP_ICC || EIGEN_COMP_MINGW || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM || EIGEN_COMP_EMSCRIPTEN)
121
- #define EIGEN_COMP_GNUC_STRICT 1
245
+ /// \internal EIGEN_COMP_CLANGFCC set to FCC version if the compiler is Fujitsu Compiler (Clang mode)
246
+ /// \note The Fujitsu C/C++ compiler uses the non-traditional mode
247
+ /// based on Clang 7.1.0 if invoked with the -Nclang flag
248
+ #if defined(__CLANG_FUJITSU)
249
+ #define EIGEN_COMP_CLANGFCC (__FCC_major__ * 100 + __FCC_minor__ * 10 + __FCC_patchlevel__)
122
250
  #else
123
- #define EIGEN_COMP_GNUC_STRICT 0
251
+ #define EIGEN_COMP_CLANGFCC 0
124
252
  #endif
125
253
 
254
+ /// \internal EIGEN_COMP_CPE set to CPE version if the compiler is HPE Cray Compiler (GCC based)
255
+ /// \note This is the SVE-enabled C/C++ compiler from the HPE Cray
256
+ /// Programming Environment (CPE) based on Cray GCC 8.1
257
+ #if defined(_CRAYC) && !defined(__clang__)
258
+ #define EIGEN_COMP_CPE (_RELEASE_MAJOR * 100 + _RELEASE_MINOR * 10 + _RELEASE_PATCHLEVEL)
259
+ #else
260
+ #define EIGEN_COMP_CPE 0
261
+ #endif
126
262
 
127
- #if EIGEN_COMP_GNUC
128
- #define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__==x && __GNUC_MINOR__>=y) || __GNUC__>x)
129
- #define EIGEN_GNUC_AT_MOST(x,y) ((__GNUC__==x && __GNUC_MINOR__<=y) || __GNUC__<x)
130
- #define EIGEN_GNUC_AT(x,y) ( __GNUC__==x && __GNUC_MINOR__==y )
263
+ /// \internal EIGEN_COMP_CLANGCPE set to CPE version if the compiler is HPE Cray Compiler (Clang based)
264
+ /// \note This is the C/C++ compiler from the HPE Cray Programming
265
+ /// Environment (CPE) based on Cray Clang 11.0 without SVE-support
266
+ #if defined(_CRAYC) && defined(__clang__)
267
+ #define EIGEN_COMP_CLANGCPE (_RELEASE_MAJOR * 100 + _RELEASE_MINOR * 10 + _RELEASE_PATCHLEVEL)
268
+ #else
269
+ #define EIGEN_COMP_CLANGCPE 0
270
+ #endif
271
+
272
+ /// \internal EIGEN_COMP_LCC set to 1 if the compiler is MCST-LCC (MCST eLbrus Compiler Collection)
273
+ #if defined(__LCC__) && defined(__MCST__)
274
+ #define EIGEN_COMP_LCC (__LCC__ * 100 + __LCC_MINOR__)
131
275
  #else
132
- #define EIGEN_GNUC_AT_LEAST(x,y) 0
133
- #define EIGEN_GNUC_AT_MOST(x,y) 0
134
- #define EIGEN_GNUC_AT(x,y) 0
276
+ #define EIGEN_COMP_LCC 0
135
277
  #endif
136
278
 
137
- // FIXME: could probably be removed as we do not support gcc 3.x anymore
138
- #if EIGEN_COMP_GNUC && (__GNUC__ <= 3)
139
- #define EIGEN_GCC3_OR_OLDER 1
279
+ /// \internal EIGEN_COMP_GNUC_STRICT set to 1 if the compiler is really GCC and not a compatible compiler (e.g., ICC,
280
+ /// clang, mingw, etc.)
281
+ #if EIGEN_COMP_GNUC && \
282
+ !(EIGEN_COMP_CLANG || EIGEN_COMP_ICC || EIGEN_COMP_CLANGICC || EIGEN_COMP_MINGW || EIGEN_COMP_PGI || \
283
+ EIGEN_COMP_IBM || EIGEN_COMP_ARM || EIGEN_COMP_EMSCRIPTEN || EIGEN_COMP_FCC || EIGEN_COMP_CLANGFCC || \
284
+ EIGEN_COMP_CPE || EIGEN_COMP_CLANGCPE || EIGEN_COMP_LCC)
285
+ #define EIGEN_COMP_GNUC_STRICT 1
140
286
  #else
141
- #define EIGEN_GCC3_OR_OLDER 0
287
+ #define EIGEN_COMP_GNUC_STRICT 0
142
288
  #endif
143
289
 
290
+ // GCC, and compilers that pretend to be it, have different version schemes, so this only makes sense to use with the
291
+ // real GCC.
292
+ #if EIGEN_COMP_GNUC_STRICT
293
+ #define EIGEN_GNUC_STRICT_AT_LEAST(x, y, z) \
294
+ ((__GNUC__ > x) || (__GNUC__ == x && __GNUC_MINOR__ > y) || \
295
+ (__GNUC__ == x && __GNUC_MINOR__ == y && __GNUC_PATCHLEVEL__ >= z))
296
+ #define EIGEN_GNUC_STRICT_LESS_THAN(x, y, z) \
297
+ ((__GNUC__ < x) || (__GNUC__ == x && __GNUC_MINOR__ < y) || \
298
+ (__GNUC__ == x && __GNUC_MINOR__ == y && __GNUC_PATCHLEVEL__ < z))
299
+ #else
300
+ #define EIGEN_GNUC_STRICT_AT_LEAST(x, y, z) 0
301
+ #define EIGEN_GNUC_STRICT_LESS_THAN(x, y, z) 0
302
+ #endif
144
303
 
304
+ /// \internal EIGEN_COMP_CLANG_STRICT set to 1 if the compiler is really Clang and not a compatible compiler (e.g.,
305
+ /// AppleClang, etc.)
306
+ #if EIGEN_COMP_CLANG && !(EIGEN_COMP_CLANGAPPLE || EIGEN_COMP_CLANGICC || EIGEN_COMP_CLANGFCC || EIGEN_COMP_CLANGCPE)
307
+ #define EIGEN_COMP_CLANG_STRICT 1
308
+ #else
309
+ #define EIGEN_COMP_CLANG_STRICT 0
310
+ #endif
311
+
312
+ // Clang, and compilers forked from it, have different version schemes, so this only makes sense to use with the real
313
+ // Clang.
314
+ #if EIGEN_COMP_CLANG_STRICT
315
+ #define EIGEN_CLANG_STRICT_AT_LEAST(x, y, z) \
316
+ ((__clang_major__ > x) || (__clang_major__ == x && __clang_minor__ > y) || \
317
+ (__clang_major__ == x && __clang_minor__ == y && __clang_patchlevel__ >= z))
318
+ #define EIGEN_CLANG_STRICT_LESS_THAN(x, y, z) \
319
+ ((__clang_major__ < x) || (__clang_major__ == x && __clang_minor__ < y) || \
320
+ (__clang_major__ == x && __clang_minor__ == y && __clang_patchlevel__ < z))
321
+ #else
322
+ #define EIGEN_CLANG_STRICT_AT_LEAST(x, y, z) 0
323
+ #define EIGEN_CLANG_STRICT_LESS_THAN(x, y, z) 0
324
+ #endif
325
+
326
+ //------------------------------------------------------------------------------------------
145
327
  // Architecture identification, EIGEN_ARCH_*
328
+ //------------------------------------------------------------------------------------------
146
329
 
147
- #if defined(__x86_64__) || defined(_M_X64) || defined(__amd64)
148
- #define EIGEN_ARCH_x86_64 1
330
+ #if defined(__x86_64__) || (defined(_M_X64) && !defined(_M_ARM64EC)) || defined(__amd64)
331
+ #define EIGEN_ARCH_x86_64 1
149
332
  #else
150
- #define EIGEN_ARCH_x86_64 0
333
+ #define EIGEN_ARCH_x86_64 0
151
334
  #endif
152
335
 
153
336
  #if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__i386)
154
- #define EIGEN_ARCH_i386 1
337
+ #define EIGEN_ARCH_i386 1
155
338
  #else
156
- #define EIGEN_ARCH_i386 0
339
+ #define EIGEN_ARCH_i386 0
157
340
  #endif
158
341
 
159
342
  #if EIGEN_ARCH_x86_64 || EIGEN_ARCH_i386
160
- #define EIGEN_ARCH_i386_OR_x86_64 1
343
+ #define EIGEN_ARCH_i386_OR_x86_64 1
161
344
  #else
162
- #define EIGEN_ARCH_i386_OR_x86_64 0
345
+ #define EIGEN_ARCH_i386_OR_x86_64 0
163
346
  #endif
164
347
 
165
348
  /// \internal EIGEN_ARCH_ARM set to 1 if the architecture is ARM
166
349
  #if defined(__arm__)
167
- #define EIGEN_ARCH_ARM 1
350
+ #define EIGEN_ARCH_ARM 1
168
351
  #else
169
- #define EIGEN_ARCH_ARM 0
352
+ #define EIGEN_ARCH_ARM 0
170
353
  #endif
171
354
 
172
355
  /// \internal EIGEN_ARCH_ARM64 set to 1 if the architecture is ARM64
173
- #if defined(__aarch64__)
174
- #define EIGEN_ARCH_ARM64 1
356
+ #if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
357
+ #define EIGEN_ARCH_ARM64 1
175
358
  #else
176
- #define EIGEN_ARCH_ARM64 0
359
+ #define EIGEN_ARCH_ARM64 0
177
360
  #endif
178
361
 
362
+ /// \internal EIGEN_ARCH_ARM_OR_ARM64 set to 1 if the architecture is ARM or ARM64
179
363
  #if EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64
180
- #define EIGEN_ARCH_ARM_OR_ARM64 1
364
+ #define EIGEN_ARCH_ARM_OR_ARM64 1
365
+ #else
366
+ #define EIGEN_ARCH_ARM_OR_ARM64 0
367
+ #endif
368
+
369
+ /// \internal EIGEN_ARCH_ARMV8 set to 1 if the architecture is armv8 or greater.
370
+ #if EIGEN_ARCH_ARM_OR_ARM64 && defined(__ARM_ARCH) && __ARM_ARCH >= 8
371
+ #define EIGEN_ARCH_ARMV8 1
181
372
  #else
182
- #define EIGEN_ARCH_ARM_OR_ARM64 0
373
+ #define EIGEN_ARCH_ARMV8 0
374
+ #endif
375
+
376
+ /// \internal EIGEN_HAS_ARM64_FP16 set to 1 if the architecture provides an IEEE
377
+ /// compliant Arm fp16 type
378
+ #if EIGEN_ARCH_ARM_OR_ARM64
379
+ #ifndef EIGEN_HAS_ARM64_FP16
380
+ #if defined(__ARM_FP16_FORMAT_IEEE)
381
+ #define EIGEN_HAS_ARM64_FP16 1
382
+ #else
383
+ #define EIGEN_HAS_ARM64_FP16 0
384
+ #endif
385
+ #endif
183
386
  #endif
184
387
 
185
388
  /// \internal EIGEN_ARCH_MIPS set to 1 if the architecture is MIPS
186
389
  #if defined(__mips__) || defined(__mips)
187
- #define EIGEN_ARCH_MIPS 1
390
+ #define EIGEN_ARCH_MIPS 1
188
391
  #else
189
- #define EIGEN_ARCH_MIPS 0
392
+ #define EIGEN_ARCH_MIPS 0
393
+ #endif
394
+
395
+ /// \internal EIGEN_ARCH_LOONGARCH64 set to 1 if the architecture is LOONGARCH64
396
+ #if defined(__loongarch64)
397
+ #define EIGEN_ARCH_LOONGARCH64 1
398
+ #else
399
+ #define EIGEN_ARCH_LOONGARCH64 0
190
400
  #endif
191
401
 
192
402
  /// \internal EIGEN_ARCH_SPARC set to 1 if the architecture is SPARC
193
403
  #if defined(__sparc__) || defined(__sparc)
194
- #define EIGEN_ARCH_SPARC 1
404
+ #define EIGEN_ARCH_SPARC 1
195
405
  #else
196
- #define EIGEN_ARCH_SPARC 0
406
+ #define EIGEN_ARCH_SPARC 0
197
407
  #endif
198
408
 
199
409
  /// \internal EIGEN_ARCH_IA64 set to 1 if the architecture is Intel Itanium
200
410
  #if defined(__ia64__)
201
- #define EIGEN_ARCH_IA64 1
411
+ #define EIGEN_ARCH_IA64 1
202
412
  #else
203
- #define EIGEN_ARCH_IA64 0
413
+ #define EIGEN_ARCH_IA64 0
204
414
  #endif
205
415
 
206
416
  /// \internal EIGEN_ARCH_PPC set to 1 if the architecture is PowerPC
207
- #if defined(__powerpc__) || defined(__ppc__) || defined(_M_PPC)
208
- #define EIGEN_ARCH_PPC 1
417
+ #if defined(__powerpc__) || defined(__ppc__) || defined(_M_PPC) || defined(__POWERPC__)
418
+ #define EIGEN_ARCH_PPC 1
209
419
  #else
210
- #define EIGEN_ARCH_PPC 0
420
+ #define EIGEN_ARCH_PPC 0
211
421
  #endif
212
422
 
213
-
214
-
423
+ //------------------------------------------------------------------------------------------
215
424
  // Operating system identification, EIGEN_OS_*
425
+ //------------------------------------------------------------------------------------------
216
426
 
217
427
  /// \internal EIGEN_OS_UNIX set to 1 if the OS is a unix variant
218
428
  #if defined(__unix__) || defined(__unix)
219
- #define EIGEN_OS_UNIX 1
429
+ #define EIGEN_OS_UNIX 1
220
430
  #else
221
- #define EIGEN_OS_UNIX 0
431
+ #define EIGEN_OS_UNIX 0
222
432
  #endif
223
433
 
224
434
  /// \internal EIGEN_OS_LINUX set to 1 if the OS is based on Linux kernel
225
435
  #if defined(__linux__)
226
- #define EIGEN_OS_LINUX 1
436
+ #define EIGEN_OS_LINUX 1
227
437
  #else
228
- #define EIGEN_OS_LINUX 0
438
+ #define EIGEN_OS_LINUX 0
229
439
  #endif
230
440
 
231
441
  /// \internal EIGEN_OS_ANDROID set to 1 if the OS is Android
232
442
  // note: ANDROID is defined when using ndk_build, __ANDROID__ is defined when using a standalone toolchain.
233
443
  #if defined(__ANDROID__) || defined(ANDROID)
234
- #define EIGEN_OS_ANDROID 1
444
+ #define EIGEN_OS_ANDROID 1
445
+
446
+ // Since NDK r16, `__NDK_MAJOR__` and `__NDK_MINOR__` are defined in
447
+ // <android/ndk-version.h>. For NDK < r16, users should define these macros,
448
+ // e.g. `-D__NDK_MAJOR__=11 -D__NKD_MINOR__=0` for NDK r11.
449
+ #if defined __has_include
450
+ #if __has_include(<android/ndk-version.h>)
451
+ #include <android/ndk-version.h>
452
+ #endif
453
+ #endif
454
+
235
455
  #else
236
- #define EIGEN_OS_ANDROID 0
456
+ #define EIGEN_OS_ANDROID 0
237
457
  #endif
238
458
 
239
459
  /// \internal EIGEN_OS_GNULINUX set to 1 if the OS is GNU Linux and not Linux-based OS (e.g., not android)
240
460
  #if defined(__gnu_linux__) && !(EIGEN_OS_ANDROID)
241
- #define EIGEN_OS_GNULINUX 1
461
+ #define EIGEN_OS_GNULINUX 1
242
462
  #else
243
- #define EIGEN_OS_GNULINUX 0
463
+ #define EIGEN_OS_GNULINUX 0
244
464
  #endif
245
465
 
246
466
  /// \internal EIGEN_OS_BSD set to 1 if the OS is a BSD variant
247
467
  #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
248
- #define EIGEN_OS_BSD 1
468
+ #define EIGEN_OS_BSD 1
249
469
  #else
250
- #define EIGEN_OS_BSD 0
470
+ #define EIGEN_OS_BSD 0
251
471
  #endif
252
472
 
253
473
  /// \internal EIGEN_OS_MAC set to 1 if the OS is MacOS
254
474
  #if defined(__APPLE__)
255
- #define EIGEN_OS_MAC 1
475
+ #define EIGEN_OS_MAC 1
256
476
  #else
257
- #define EIGEN_OS_MAC 0
477
+ #define EIGEN_OS_MAC 0
258
478
  #endif
259
479
 
260
480
  /// \internal EIGEN_OS_QNX set to 1 if the OS is QNX
261
481
  #if defined(__QNX__)
262
- #define EIGEN_OS_QNX 1
482
+ #define EIGEN_OS_QNX 1
263
483
  #else
264
- #define EIGEN_OS_QNX 0
484
+ #define EIGEN_OS_QNX 0
265
485
  #endif
266
486
 
267
487
  /// \internal EIGEN_OS_WIN set to 1 if the OS is Windows based
268
488
  #if defined(_WIN32)
269
- #define EIGEN_OS_WIN 1
489
+ #define EIGEN_OS_WIN 1
270
490
  #else
271
- #define EIGEN_OS_WIN 0
491
+ #define EIGEN_OS_WIN 0
272
492
  #endif
273
493
 
274
494
  /// \internal EIGEN_OS_WIN64 set to 1 if the OS is Windows 64bits
275
495
  #if defined(_WIN64)
276
- #define EIGEN_OS_WIN64 1
496
+ #define EIGEN_OS_WIN64 1
277
497
  #else
278
- #define EIGEN_OS_WIN64 0
498
+ #define EIGEN_OS_WIN64 0
279
499
  #endif
280
500
 
281
501
  /// \internal EIGEN_OS_WINCE set to 1 if the OS is Windows CE
282
502
  #if defined(_WIN32_WCE)
283
- #define EIGEN_OS_WINCE 1
503
+ #define EIGEN_OS_WINCE 1
284
504
  #else
285
- #define EIGEN_OS_WINCE 0
505
+ #define EIGEN_OS_WINCE 0
286
506
  #endif
287
507
 
288
508
  /// \internal EIGEN_OS_CYGWIN set to 1 if the OS is Windows/Cygwin
289
509
  #if defined(__CYGWIN__)
290
- #define EIGEN_OS_CYGWIN 1
510
+ #define EIGEN_OS_CYGWIN 1
291
511
  #else
292
- #define EIGEN_OS_CYGWIN 0
512
+ #define EIGEN_OS_CYGWIN 0
293
513
  #endif
294
514
 
295
515
  /// \internal EIGEN_OS_WIN_STRICT set to 1 if the OS is really Windows and not some variants
296
- #if EIGEN_OS_WIN && !( EIGEN_OS_WINCE || EIGEN_OS_CYGWIN )
297
- #define EIGEN_OS_WIN_STRICT 1
516
+ #if EIGEN_OS_WIN && !(EIGEN_OS_WINCE || EIGEN_OS_CYGWIN)
517
+ #define EIGEN_OS_WIN_STRICT 1
298
518
  #else
299
- #define EIGEN_OS_WIN_STRICT 0
519
+ #define EIGEN_OS_WIN_STRICT 0
300
520
  #endif
301
521
 
302
- /// \internal EIGEN_OS_SUN set to 1 if the OS is SUN
522
+ /// \internal EIGEN_OS_SUN set to __SUNPRO_C if the OS is SUN
523
+ // compiler solaris __SUNPRO_C
524
+ // version studio
525
+ // 5.7 10 0x570
526
+ // 5.8 11 0x580
527
+ // 5.9 12 0x590
528
+ // 5.10 12.1 0x5100
529
+ // 5.11 12.2 0x5110
530
+ // 5.12 12.3 0x5120
303
531
  #if (defined(sun) || defined(__sun)) && !(defined(__SVR4) || defined(__svr4__))
304
- #define EIGEN_OS_SUN 1
532
+ #define EIGEN_OS_SUN __SUNPRO_C
305
533
  #else
306
- #define EIGEN_OS_SUN 0
534
+ #define EIGEN_OS_SUN 0
307
535
  #endif
308
536
 
309
537
  /// \internal EIGEN_OS_SOLARIS set to 1 if the OS is Solaris
310
538
  #if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
311
- #define EIGEN_OS_SOLARIS 1
539
+ #define EIGEN_OS_SOLARIS 1
312
540
  #else
313
- #define EIGEN_OS_SOLARIS 0
541
+ #define EIGEN_OS_SOLARIS 0
314
542
  #endif
315
543
 
544
+ //------------------------------------------------------------------------------------------
545
+ // Detect GPU compilers and architectures
546
+ //------------------------------------------------------------------------------------------
316
547
 
548
+ // NVCC is not supported as the target platform for HIPCC
549
+ // Note that this also makes EIGEN_CUDACC and EIGEN_HIPCC mutually exclusive
550
+ #if defined(__NVCC__) && defined(__HIPCC__)
551
+ #error "NVCC as the target platform for HIPCC is currently not supported."
552
+ #endif
317
553
 
318
- #if EIGEN_GNUC_AT_MOST(4,3) && !EIGEN_COMP_CLANG
319
- // see bug 89
320
- #define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 0
321
- #else
322
- #define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 1
554
+ #if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA) && !defined(__SYCL_DEVICE_ONLY__)
555
+ // Means the compiler is either nvcc or clang with CUDA enabled
556
+ #define EIGEN_CUDACC __CUDACC__
323
557
  #endif
324
558
 
325
- // This macro can be used to prevent from macro expansion, e.g.:
326
- // std::max EIGEN_NOT_A_MACRO(a,b)
327
- #define EIGEN_NOT_A_MACRO
559
+ #if defined(__CUDA_ARCH__) && !defined(EIGEN_NO_CUDA) && !defined(__SYCL_DEVICE_ONLY__)
560
+ // Means we are generating code for the device
561
+ #define EIGEN_CUDA_ARCH __CUDA_ARCH__
562
+ #endif
328
563
 
329
- #ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
330
- #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::RowMajor
564
+ #if defined(EIGEN_CUDACC)
565
+ #include <cuda.h>
566
+ #define EIGEN_CUDA_SDK_VER (CUDA_VERSION * 10)
331
567
  #else
332
- #define EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION Eigen::ColMajor
568
+ #define EIGEN_CUDA_SDK_VER 0
333
569
  #endif
334
570
 
335
- #ifndef EIGEN_DEFAULT_DENSE_INDEX_TYPE
336
- #define EIGEN_DEFAULT_DENSE_INDEX_TYPE std::ptrdiff_t
571
+ #if defined(__HIPCC__) && !defined(EIGEN_NO_HIP) && !defined(__SYCL_DEVICE_ONLY__)
572
+ // Means the compiler is HIPCC (analogous to EIGEN_CUDACC, but for HIP)
573
+ #define EIGEN_HIPCC __HIPCC__
574
+
575
+ // We need to include hip_runtime.h here because it pulls in
576
+ // ++ hip_common.h which contains the define for __HIP_DEVICE_COMPILE__
577
+ // ++ host_defines.h which contains the defines for the __host__ and __device__ macros
578
+ #include <hip/hip_runtime.h>
579
+
580
+ #if defined(__HIP_DEVICE_COMPILE__) && !defined(__SYCL_DEVICE_ONLY__)
581
+ // analogous to EIGEN_CUDA_ARCH, but for HIP
582
+ #define EIGEN_HIP_DEVICE_COMPILE __HIP_DEVICE_COMPILE__
337
583
  #endif
338
584
 
339
- // Cross compiler wrapper around LLVM's __has_builtin
340
- #ifdef __has_builtin
341
- # define EIGEN_HAS_BUILTIN(x) __has_builtin(x)
342
- #else
343
- # define EIGEN_HAS_BUILTIN(x) 0
585
+ // For HIP (ROCm 3.5 and higher), we need to explicitly set the launch_bounds attribute
586
+ // value to 1024. The compiler assigns a default value of 256 when the attribute is not
587
+ // specified. This results in failures on the HIP platform, for cases when a GPU kernel
588
+ // without an explicit launch_bounds attribute is called with a threads_per_block value
589
+ // greater than 256.
590
+ //
591
+ // This is a regression in functioanlity and is expected to be fixed within the next
592
+ // couple of ROCm releases (compiler will go back to using 1024 value as the default)
593
+ //
594
+ // In the meantime, we will use a "only enabled for HIP" macro to set the launch_bounds
595
+ // attribute.
596
+
597
+ #define EIGEN_HIP_LAUNCH_BOUNDS_1024 __launch_bounds__(1024)
598
+
344
599
  #endif
345
600
 
346
- // A Clang feature extension to determine compiler features.
347
- // We use it to determine 'cxx_rvalue_references'
348
- #ifndef __has_feature
349
- # define __has_feature(x) 0
601
+ #if !defined(EIGEN_HIP_LAUNCH_BOUNDS_1024)
602
+ #define EIGEN_HIP_LAUNCH_BOUNDS_1024
603
+ #endif // !defined(EIGEN_HIP_LAUNCH_BOUNDS_1024)
604
+
605
+ // Unify CUDA/HIPCC
606
+
607
+ #if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
608
+ //
609
+ // If either EIGEN_CUDACC or EIGEN_HIPCC is defined, then define EIGEN_GPUCC
610
+ //
611
+ #define EIGEN_GPUCC
612
+ //
613
+ // EIGEN_HIPCC implies the HIP compiler and is used to tweak Eigen code for use in HIP kernels
614
+ // EIGEN_CUDACC implies the CUDA compiler and is used to tweak Eigen code for use in CUDA kernels
615
+ //
616
+ // In most cases the same tweaks are required to the Eigen code to enable in both the HIP and CUDA kernels.
617
+ // For those cases, the corresponding code should be guarded with
618
+ // #if defined(EIGEN_GPUCC)
619
+ // instead of
620
+ // #if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
621
+ //
622
+ // For cases where the tweak is specific to HIP, the code should be guarded with
623
+ // #if defined(EIGEN_HIPCC)
624
+ //
625
+ // For cases where the tweak is specific to CUDA, the code should be guarded with
626
+ // #if defined(EIGEN_CUDACC)
627
+ //
350
628
  #endif
351
629
 
352
- // Upperbound on the C++ version to use.
353
- // Expected values are 03, 11, 14, 17, etc.
354
- // By default, let's use an arbitrarily large C++ version.
355
- #ifndef EIGEN_MAX_CPP_VER
356
- #define EIGEN_MAX_CPP_VER 99
630
+ #if defined(EIGEN_CUDA_ARCH) || defined(EIGEN_HIP_DEVICE_COMPILE)
631
+ //
632
+ // If either EIGEN_CUDA_ARCH or EIGEN_HIP_DEVICE_COMPILE is defined, then define EIGEN_GPU_COMPILE_PHASE
633
+ //
634
+ #define EIGEN_GPU_COMPILE_PHASE
635
+ //
636
+ // GPU compilers (HIPCC, NVCC) typically do two passes over the source code,
637
+ // + one to compile the source for the "host" (ie CPU)
638
+ // + another to compile the source for the "device" (ie. GPU)
639
+ //
640
+ // Code that needs to enabled only during the either the "host" or "device" compilation phase
641
+ // needs to be guarded with a macro that indicates the current compilation phase
642
+ //
643
+ // EIGEN_HIP_DEVICE_COMPILE implies the device compilation phase in HIP
644
+ // EIGEN_CUDA_ARCH implies the device compilation phase in CUDA
645
+ //
646
+ // In most cases, the "host" / "device" specific code is the same for both HIP and CUDA
647
+ // For those cases, the code should be guarded with
648
+ // #if defined(EIGEN_GPU_COMPILE_PHASE)
649
+ // instead of
650
+ // #if defined(EIGEN_CUDA_ARCH) || defined(EIGEN_HIP_DEVICE_COMPILE)
651
+ //
652
+ // For cases where the tweak is specific to HIP, the code should be guarded with
653
+ // #if defined(EIGEN_HIP_DEVICE_COMPILE)
654
+ //
655
+ // For cases where the tweak is specific to CUDA, the code should be guarded with
656
+ // #if defined(EIGEN_CUDA_ARCH)
657
+ //
357
658
  #endif
358
659
 
359
- #if EIGEN_MAX_CPP_VER>=11 && (defined(__cplusplus) && (__cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900)
360
- #define EIGEN_HAS_CXX11 1
660
+ /// \internal EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC set to 1 if the architecture
661
+ /// supports Neon vector intrinsics for fp16.
662
+ #if EIGEN_ARCH_ARM_OR_ARM64
663
+ #ifndef EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC
664
+ // Clang only supports FP16 on aarch64, and not all intrinsics are available
665
+ // on A32 anyways even in GCC (e.g. vdiv_f16, vsqrt_f16).
666
+ #if EIGEN_ARCH_ARM64 && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE)
667
+ #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 1
361
668
  #else
362
- #define EIGEN_HAS_CXX11 0
669
+ #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 0
670
+ #endif
671
+ #endif
363
672
  #endif
364
673
 
674
+ /// \internal EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC set to 1 if the architecture
675
+ /// supports Neon scalar intrinsics for fp16.
676
+ #if EIGEN_ARCH_ARM_OR_ARM64
677
+ #ifndef EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC
678
+ // Clang only supports FP16 on aarch64, and not all intrinsics are available
679
+ // on A32 anyways, even in GCC (e.g. vceqh_f16).
680
+ #if EIGEN_ARCH_ARM64 && defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE)
681
+ #define EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC 1
682
+ #endif
683
+ #endif
684
+ #endif
685
+
686
+ #if defined(EIGEN_USE_SYCL) && defined(__SYCL_DEVICE_ONLY__)
687
+ // EIGEN_USE_SYCL is a user-defined macro while __SYCL_DEVICE_ONLY__ is a compiler-defined macro.
688
+ // In most cases we want to check if both macros are defined which can be done using the define below.
689
+ #define SYCL_DEVICE_ONLY
690
+ #endif
365
691
 
366
- // Do we support r-value references?
367
- #ifndef EIGEN_HAS_RVALUE_REFERENCES
368
- #if EIGEN_MAX_CPP_VER>=11 && \
369
- (__has_feature(cxx_rvalue_references) || \
370
- (defined(__cplusplus) && __cplusplus >= 201103L) || \
371
- (EIGEN_COMP_MSVC >= 1600))
372
- #define EIGEN_HAS_RVALUE_REFERENCES 1
692
+ //------------------------------------------------------------------------------------------
693
+ // Detect Compiler/Architecture/OS specific features
694
+ //------------------------------------------------------------------------------------------
695
+
696
+ // Cross compiler wrapper around LLVM's __has_builtin
697
+ #ifdef __has_builtin
698
+ #define EIGEN_HAS_BUILTIN(x) __has_builtin(x)
373
699
  #else
374
- #define EIGEN_HAS_RVALUE_REFERENCES 0
700
+ #define EIGEN_HAS_BUILTIN(x) 0
375
701
  #endif
702
+
703
+ // A Clang feature extension to determine compiler features.
704
+ // We use it to determine 'cxx_rvalue_references'
705
+ #ifndef __has_feature
706
+ #define __has_feature(x) 0
707
+ #endif
708
+
709
+ // The macro EIGEN_CPLUSPLUS is a replacement for __cplusplus/_MSVC_LANG that
710
+ // works for both platforms, indicating the C++ standard version number.
711
+ //
712
+ // With MSVC, without defining /Zc:__cplusplus, the __cplusplus macro will
713
+ // report 199711L regardless of the language standard specified via /std.
714
+ // We need to rely on _MSVC_LANG instead, which is only available after
715
+ // VS2015.3.
716
+ #if EIGEN_COMP_MSVC_LANG > 0
717
+ #define EIGEN_CPLUSPLUS EIGEN_COMP_MSVC_LANG
718
+ #elif EIGEN_COMP_MSVC >= 1900
719
+ #define EIGEN_CPLUSPLUS 201103L
720
+ #elif defined(__cplusplus)
721
+ #define EIGEN_CPLUSPLUS __cplusplus
722
+ #else
723
+ #define EIGEN_CPLUSPLUS 0
724
+ #endif
725
+
726
+ // The macro EIGEN_COMP_CXXVER defines the c++ version expected by the compiler.
727
+ // For instance, if compiling with gcc and -std=c++17, then EIGEN_COMP_CXXVER
728
+ // is defined to 17.
729
+ #if EIGEN_CPLUSPLUS >= 202002L
730
+ #define EIGEN_COMP_CXXVER 20
731
+ #elif EIGEN_CPLUSPLUS >= 201703L
732
+ #define EIGEN_COMP_CXXVER 17
733
+ #elif EIGEN_CPLUSPLUS >= 201402L
734
+ #define EIGEN_COMP_CXXVER 14
735
+ #elif EIGEN_CPLUSPLUS >= 201103L
736
+ #define EIGEN_COMP_CXXVER 11
737
+ #else
738
+ #define EIGEN_COMP_CXXVER 03
739
+ #endif
740
+
741
+ // The macros EIGEN_HAS_CXX?? defines a rough estimate of available c++ features
742
+ // but in practice we should not rely on them but rather on the availability of
743
+ // individual features as defined later.
744
+ // This is why there is no EIGEN_HAS_CXX17.
745
+ #if EIGEN_MAX_CPP_VER < 14 || EIGEN_COMP_CXXVER < 14 || (EIGEN_COMP_MSVC && EIGEN_COMP_MSVC < 1900) || \
746
+ (EIGEN_COMP_ICC && EIGEN_COMP_ICC < 1500) || (EIGEN_COMP_NVCC && EIGEN_COMP_NVCC < 80000) || \
747
+ (EIGEN_COMP_CLANG_STRICT && EIGEN_COMP_CLANG < 390) || \
748
+ (EIGEN_COMP_CLANGAPPLE && EIGEN_COMP_CLANGAPPLE < 9000000) || (EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC < 510)
749
+ #error Eigen requires at least c++14 support.
376
750
  #endif
377
751
 
378
752
  // Does the compiler support C99?
753
+ // Need to include <cmath> to make sure _GLIBCXX_USE_C99 gets defined
754
+ #include <cmath>
379
755
  #ifndef EIGEN_HAS_C99_MATH
380
- #if EIGEN_MAX_CPP_VER>=11 && \
381
- ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \
382
- || (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \
383
- || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER)) \
384
- || (EIGEN_COMP_MSVC >= 1900) )
385
- #define EIGEN_HAS_C99_MATH 1
756
+ #if ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) || \
757
+ (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER)) || \
758
+ (EIGEN_COMP_MSVC) || defined(SYCL_DEVICE_ONLY))
759
+ #define EIGEN_HAS_C99_MATH 1
386
760
  #else
387
- #define EIGEN_HAS_C99_MATH 0
761
+ #define EIGEN_HAS_C99_MATH 0
388
762
  #endif
389
763
  #endif
390
764
 
391
- // Does the compiler support result_of?
392
- #ifndef EIGEN_HAS_STD_RESULT_OF
393
- #if EIGEN_MAX_CPP_VER>=11 && ((__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L)))
394
- #define EIGEN_HAS_STD_RESULT_OF 1
765
+ // Does the compiler support std::hash?
766
+ #ifndef EIGEN_HAS_STD_HASH
767
+ // The std::hash struct is defined in C++11 but is not labelled as a __device__
768
+ // function and is not constexpr, so cannot be used on device.
769
+ #if !defined(EIGEN_GPU_COMPILE_PHASE)
770
+ #define EIGEN_HAS_STD_HASH 1
395
771
  #else
396
- #define EIGEN_HAS_STD_RESULT_OF 0
397
- #endif
772
+ #define EIGEN_HAS_STD_HASH 0
398
773
  #endif
774
+ #endif // EIGEN_HAS_STD_HASH
399
775
 
400
- // Does the compiler support type_traits?
401
- // - full support of type traits was added only to GCC 5.1.0.
402
- // - 20150626 corresponds to the last release of 4.x libstdc++
403
- #ifndef EIGEN_HAS_TYPE_TRAITS
404
- #if EIGEN_MAX_CPP_VER>=11 && (EIGEN_HAS_CXX11 || EIGEN_COMP_MSVC >= 1700) \
405
- && ((!EIGEN_COMP_GNUC_STRICT) || EIGEN_GNUC_AT_LEAST(5, 1)) \
406
- && ((!defined(__GLIBCXX__)) || __GLIBCXX__ > 20150626)
407
- #define EIGEN_HAS_TYPE_TRAITS 1
408
- #define EIGEN_INCLUDE_TYPE_TRAITS
776
+ #ifndef EIGEN_HAS_STD_INVOKE_RESULT
777
+ #if EIGEN_MAX_CPP_VER >= 17 && EIGEN_COMP_CXXVER >= 17
778
+ #define EIGEN_HAS_STD_INVOKE_RESULT 1
409
779
  #else
410
- #define EIGEN_HAS_TYPE_TRAITS 0
780
+ #define EIGEN_HAS_STD_INVOKE_RESULT 0
411
781
  #endif
412
782
  #endif
413
783
 
414
- // Does the compiler support variadic templates?
415
- #ifndef EIGEN_HAS_VARIADIC_TEMPLATES
416
- #if EIGEN_MAX_CPP_VER>=11 && (__cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900) \
417
- && (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (EIGEN_CUDACC_VER >= 80000) )
418
- // ^^ Disable the use of variadic templates when compiling with versions of nvcc older than 8.0 on ARM devices:
419
- // this prevents nvcc from crashing when compiling Eigen on Tegra X1
420
- #define EIGEN_HAS_VARIADIC_TEMPLATES 1
784
+ #define EIGEN_CONSTEXPR constexpr
785
+
786
+ // NOTE: the required Apple's clang version is very conservative
787
+ // and it could be that XCode 9 works just fine.
788
+ // NOTE: the MSVC version is based on https://en.cppreference.com/w/cpp/compiler_support
789
+ // and not tested.
790
+ // NOTE: Intel C++ Compiler Classic (icc) Version 19.0 and later supports dynamic allocation
791
+ // for over-aligned data, but not in a manner that is compatible with Eigen.
792
+ // See https://gitlab.com/libeigen/eigen/-/issues/2575
793
+ #ifndef EIGEN_HAS_CXX17_OVERALIGN
794
+ #if EIGEN_MAX_CPP_VER >= 17 && EIGEN_COMP_CXXVER >= 17 && \
795
+ ((EIGEN_COMP_MSVC >= 1912) || (EIGEN_GNUC_STRICT_AT_LEAST(7, 0, 0)) || (EIGEN_CLANG_STRICT_AT_LEAST(5, 0, 0)) || \
796
+ (EIGEN_COMP_CLANGAPPLE && EIGEN_COMP_CLANGAPPLE >= 10000000)) && \
797
+ !EIGEN_COMP_ICC
798
+ #define EIGEN_HAS_CXX17_OVERALIGN 1
421
799
  #else
422
- #define EIGEN_HAS_VARIADIC_TEMPLATES 0
800
+ #define EIGEN_HAS_CXX17_OVERALIGN 0
423
801
  #endif
424
802
  #endif
425
803
 
426
- // Does the compiler fully support const expressions? (as in c++14)
427
- #ifndef EIGEN_HAS_CONSTEXPR
428
-
429
- #ifdef __CUDACC__
430
- // Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above
431
- #if EIGEN_MAX_CPP_VER>=14 && (__cplusplus > 199711L && (EIGEN_COMP_CLANG || EIGEN_CUDACC_VER >= 70500))
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
804
+ #if defined(EIGEN_CUDACC)
805
+ // While available already with c++11, this is useful mostly starting with c++14 and relaxed constexpr rules
806
+ #if defined(__NVCC__)
807
+ // nvcc considers constexpr functions as __host__ __device__ with the option --expt-relaxed-constexpr
808
+ #ifdef __CUDACC_RELAXED_CONSTEXPR__
809
+ #define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
437
810
  #endif
438
-
439
- #ifndef EIGEN_HAS_CONSTEXPR
440
- #define EIGEN_HAS_CONSTEXPR 0
811
+ #elif defined(__clang__) && defined(__CUDA__) && __has_feature(cxx_relaxed_constexpr)
812
+ // clang++ always considers constexpr functions as implicitly __host__ __device__
813
+ #define EIGEN_CONSTEXPR_ARE_DEVICE_FUNC
441
814
  #endif
442
-
443
815
  #endif
444
816
 
445
- // Does the compiler support C++11 math?
446
- // Let's be conservative and enable the default C++11 implementation only if we are sure it exists
447
- #ifndef EIGEN_HAS_CXX11_MATH
448
- #if EIGEN_MAX_CPP_VER>=11 && ((__cplusplus > 201103L) || (__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \
449
- && (EIGEN_ARCH_i386_OR_x86_64) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC))
450
- #define EIGEN_HAS_CXX11_MATH 1
451
- #else
452
- #define EIGEN_HAS_CXX11_MATH 0
453
- #endif
817
+ // Does the compiler support the __int128 and __uint128_t extensions for 128-bit
818
+ // integer arithmetic?
819
+ //
820
+ // Clang and GCC define __SIZEOF_INT128__ when these extensions are supported,
821
+ // but we avoid using them in certain cases:
822
+ //
823
+ // * Building using Clang for Windows, where the Clang runtime library has
824
+ // 128-bit support only on LP64 architectures, but Windows is LLP64.
825
+ #ifndef EIGEN_HAS_BUILTIN_INT128
826
+ #if defined(__SIZEOF_INT128__) && !(EIGEN_OS_WIN && EIGEN_COMP_CLANG)
827
+ #define EIGEN_HAS_BUILTIN_INT128 1
828
+ #else
829
+ #define EIGEN_HAS_BUILTIN_INT128 0
454
830
  #endif
455
-
456
- // Does the compiler support proper C++11 containers?
457
- #ifndef EIGEN_HAS_CXX11_CONTAINERS
458
- #if EIGEN_MAX_CPP_VER>=11 && \
459
- ((__cplusplus > 201103L) \
460
- || ((__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_ICC>=1400)) \
461
- || EIGEN_COMP_MSVC >= 1900)
462
- #define EIGEN_HAS_CXX11_CONTAINERS 1
463
- #else
464
- #define EIGEN_HAS_CXX11_CONTAINERS 0
465
- #endif
466
831
  #endif
467
832
 
468
- // Does the compiler support C++11 noexcept?
469
- #ifndef EIGEN_HAS_CXX11_NOEXCEPT
470
- #if EIGEN_MAX_CPP_VER>=11 && \
471
- (__has_feature(cxx_noexcept) \
472
- || (__cplusplus > 201103L) \
473
- || ((__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_ICC>=1400)) \
474
- || EIGEN_COMP_MSVC >= 1900)
475
- #define EIGEN_HAS_CXX11_NOEXCEPT 1
476
- #else
477
- #define EIGEN_HAS_CXX11_NOEXCEPT 0
478
- #endif
479
- #endif
833
+ //------------------------------------------------------------------------------------------
834
+ // Preprocessor programming helpers
835
+ //------------------------------------------------------------------------------------------
480
836
 
481
- /** Allows to disable some optimizations which might affect the accuracy of the result.
482
- * Such optimization are enabled by default, and set EIGEN_FAST_MATH to 0 to disable them.
483
- * They currently include:
484
- * - single precision ArrayBase::sin() and ArrayBase::cos() for SSE and AVX vectorization.
485
- */
486
- #ifndef EIGEN_FAST_MATH
487
- #define EIGEN_FAST_MATH 1
488
- #endif
837
+ // This macro can be used to prevent from macro expansion, e.g.:
838
+ // std::max EIGEN_NOT_A_MACRO(a,b)
839
+ #define EIGEN_NOT_A_MACRO
489
840
 
490
841
  #define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl;
491
842
 
492
843
  // concatenate two tokens
493
- #define EIGEN_CAT2(a,b) a ## b
494
- #define EIGEN_CAT(a,b) EIGEN_CAT2(a,b)
844
+ #define EIGEN_CAT2(a, b) a##b
845
+ #define EIGEN_CAT(a, b) EIGEN_CAT2(a, b)
495
846
 
496
847
  #define EIGEN_COMMA ,
497
848
 
@@ -503,22 +854,18 @@
503
854
  // but it still doesn't use GCC's always_inline. This is useful in (common) situations where MSVC needs forceinline
504
855
  // but GCC is still doing fine with just inline.
505
856
  #ifndef EIGEN_STRONG_INLINE
506
- #if EIGEN_COMP_MSVC || EIGEN_COMP_ICC
857
+ #if (EIGEN_COMP_MSVC || EIGEN_COMP_ICC) && !defined(EIGEN_GPUCC)
507
858
  #define EIGEN_STRONG_INLINE __forceinline
508
859
  #else
509
860
  #define EIGEN_STRONG_INLINE inline
510
861
  #endif
511
862
  #endif
512
863
 
513
- // EIGEN_ALWAYS_INLINE is the stronget, it has the effect of making the function inline and adding every possible
864
+ // EIGEN_ALWAYS_INLINE is the strongest, it has the effect of making the function inline and adding every possible
514
865
  // attribute to maximize inlining. This should only be used when really necessary: in particular,
515
866
  // it uses __attribute__((always_inline)) on GCC, which most of the time is useless and can severely harm compile times.
516
867
  // FIXME with the always_inline attribute,
517
- // gcc 3.4.x and 4.1 reports the following compilation error:
518
- // Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const'
519
- // : function body not available
520
- // See also bug 1367
521
- #if EIGEN_GNUC_AT_LEAST(4,2)
868
+ #if EIGEN_COMP_GNUC && !defined(SYCL_DEVICE_ONLY)
522
869
  #define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline
523
870
  #else
524
871
  #define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE
@@ -538,55 +885,50 @@
538
885
  #define EIGEN_PERMISSIVE_EXPR
539
886
  #endif
540
887
 
888
+ // GPU stuff
889
+
890
+ // Disable some features when compiling with GPU compilers (SYCL/HIPCC)
891
+ #if defined(SYCL_DEVICE_ONLY) || defined(EIGEN_HIP_DEVICE_COMPILE)
892
+ // Do not try asserts on device code
893
+ #ifndef EIGEN_NO_DEBUG
894
+ #define EIGEN_NO_DEBUG
895
+ #endif
896
+
897
+ #ifdef EIGEN_INTERNAL_DEBUGGING
898
+ #undef EIGEN_INTERNAL_DEBUGGING
899
+ #endif
900
+ #endif
901
+
902
+ // No exceptions on device.
903
+ #if defined(SYCL_DEVICE_ONLY) || defined(EIGEN_GPU_COMPILE_PHASE)
904
+ #ifdef EIGEN_EXCEPTIONS
905
+ #undef EIGEN_EXCEPTIONS
906
+ #endif
907
+ #endif
908
+
909
+ #if defined(SYCL_DEVICE_ONLY)
910
+ #ifndef EIGEN_DONT_VECTORIZE
911
+ #define EIGEN_DONT_VECTORIZE
912
+ #endif
913
+ #define EIGEN_DEVICE_FUNC __attribute__((flatten)) __attribute__((always_inline))
914
+ // All functions callable from CUDA/HIP code must be qualified with __device__
915
+ #elif defined(EIGEN_GPUCC)
916
+ #define EIGEN_DEVICE_FUNC __host__ __device__
917
+ #else
918
+ #define EIGEN_DEVICE_FUNC
919
+ #endif
920
+
541
921
  // this macro allows to get rid of linking errors about multiply defined functions.
542
922
  // - static is not very good because it prevents definitions from different object files to be merged.
543
923
  // So static causes the resulting linked executable to be bloated with multiple copies of the same function.
544
924
  // - 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
925
+ #define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC
926
+ #define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_DEVICE_FUNC inline
547
927
 
548
928
  #ifdef NDEBUG
549
- # ifndef EIGEN_NO_DEBUG
550
- # define EIGEN_NO_DEBUG
551
- # endif
552
- #endif
553
-
554
- // eigen_plain_assert is where we implement the workaround for the assert() bug in GCC <= 4.3, see bug 89
555
- #ifdef EIGEN_NO_DEBUG
556
- #define eigen_plain_assert(x)
557
- #else
558
- #if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO
559
- namespace Eigen {
560
- namespace internal {
561
- inline bool copy_bool(bool b) { return b; }
562
- }
563
- }
564
- #define eigen_plain_assert(x) assert(x)
565
- #else
566
- // work around bug 89
567
- #include <cstdlib> // for abort
568
- #include <iostream> // for std::cerr
569
-
570
- namespace Eigen {
571
- namespace internal {
572
- // trivial function copying a bool. Must be EIGEN_DONT_INLINE, so we implement it after including Eigen headers.
573
- // see bug 89.
574
- namespace {
575
- EIGEN_DONT_INLINE bool copy_bool(bool b) { return b; }
576
- }
577
- inline void assert_fail(const char *condition, const char *function, const char *file, int line)
578
- {
579
- std::cerr << "assertion failed: " << condition << " in function " << function << " at " << file << ":" << line << std::endl;
580
- abort();
581
- }
582
- }
583
- }
584
- #define eigen_plain_assert(x) \
585
- do { \
586
- if(!Eigen::internal::copy_bool(x)) \
587
- Eigen::internal::assert_fail(EIGEN_MAKESTRING(x), __PRETTY_FUNCTION__, __FILE__, __LINE__); \
588
- } while(false)
589
- #endif
929
+ #ifndef EIGEN_NO_DEBUG
930
+ #define EIGEN_NO_DEBUG
931
+ #endif
590
932
  #endif
591
933
 
592
934
  // eigen_assert can be overridden
@@ -597,25 +939,37 @@
597
939
  #ifdef EIGEN_INTERNAL_DEBUGGING
598
940
  #define eigen_internal_assert(x) eigen_assert(x)
599
941
  #else
600
- #define eigen_internal_assert(x)
942
+ #define eigen_internal_assert(x) ((void)0)
601
943
  #endif
602
944
 
603
- #ifdef EIGEN_NO_DEBUG
945
+ #if defined(EIGEN_NO_DEBUG) || (defined(EIGEN_GPU_COMPILE_PHASE) && defined(EIGEN_NO_DEBUG_GPU))
604
946
  #define EIGEN_ONLY_USED_FOR_DEBUG(x) EIGEN_UNUSED_VARIABLE(x)
605
947
  #else
606
948
  #define EIGEN_ONLY_USED_FOR_DEBUG(x)
607
949
  #endif
608
950
 
609
951
  #ifndef EIGEN_NO_DEPRECATED_WARNING
610
- #if EIGEN_COMP_GNUC
611
- #define EIGEN_DEPRECATED __attribute__((deprecated))
612
- #elif EIGEN_COMP_MSVC
613
- #define EIGEN_DEPRECATED __declspec(deprecated)
614
- #else
615
- #define EIGEN_DEPRECATED
616
- #endif
952
+ #if EIGEN_COMP_GNUC
953
+ #define EIGEN_DEPRECATED __attribute__((deprecated))
954
+ #elif EIGEN_COMP_MSVC
955
+ #define EIGEN_DEPRECATED __declspec(deprecated)
617
956
  #else
618
- #define EIGEN_DEPRECATED
957
+ #define EIGEN_DEPRECATED
958
+ #endif
959
+ #else
960
+ #define EIGEN_DEPRECATED
961
+ #endif
962
+
963
+ #ifndef EIGEN_NO_DEPRECATED_WARNING
964
+ #if EIGEN_COMP_GNUC
965
+ #define EIGEN_DEPRECATED_WITH_REASON(message) __attribute__((deprecated(message)))
966
+ #elif EIGEN_COMP_MSVC
967
+ #define EIGEN_DEPRECATED_WITH_REASON(message) __declspec(deprecated(message))
968
+ #else
969
+ #define EIGEN_DEPRECATED_WITH_REASON(message)
970
+ #endif
971
+ #else
972
+ #define EIGEN_DEPRECATED_WITH_REASON(message)
619
973
  #endif
620
974
 
621
975
  #if EIGEN_COMP_GNUC
@@ -624,196 +978,132 @@
624
978
  #define EIGEN_UNUSED
625
979
  #endif
626
980
 
981
+ #if EIGEN_COMP_GNUC
982
+ #define EIGEN_PRAGMA(tokens) _Pragma(#tokens)
983
+ #define EIGEN_DIAGNOSTICS(tokens) EIGEN_PRAGMA(GCC diagnostic tokens)
984
+ #define EIGEN_DIAGNOSTICS_OFF(msc, gcc) EIGEN_DIAGNOSTICS(gcc)
985
+ #elif EIGEN_COMP_MSVC
986
+ #define EIGEN_PRAGMA(tokens) __pragma(tokens)
987
+ #define EIGEN_DIAGNOSTICS(tokens) EIGEN_PRAGMA(warning(tokens))
988
+ #define EIGEN_DIAGNOSTICS_OFF(msc, gcc) EIGEN_DIAGNOSTICS(msc)
989
+ #else
990
+ #define EIGEN_PRAGMA(tokens)
991
+ #define EIGEN_DIAGNOSTICS(tokens)
992
+ #define EIGEN_DIAGNOSTICS_OFF(msc, gcc)
993
+ #endif
994
+
995
+ #define EIGEN_DISABLE_DEPRECATED_WARNING EIGEN_DIAGNOSTICS_OFF(disable : 4996, ignored "-Wdeprecated-declarations")
996
+
627
997
  // Suppresses 'unused variable' warnings.
628
998
  namespace Eigen {
629
- namespace internal {
630
- template<typename T> EIGEN_DEVICE_FUNC void ignore_unused_variable(const T&) {}
631
- }
632
- }
999
+ namespace internal {
1000
+ template <typename T>
1001
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void ignore_unused_variable(const T&) {}
1002
+ } // namespace internal
1003
+ } // namespace Eigen
633
1004
  #define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var);
634
1005
 
635
1006
  #if !defined(EIGEN_ASM_COMMENT)
636
- #if EIGEN_COMP_GNUC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64)
637
- #define EIGEN_ASM_COMMENT(X) __asm__("#" X)
638
- #else
639
- #define EIGEN_ASM_COMMENT(X)
640
- #endif
1007
+ #if EIGEN_COMP_GNUC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM_OR_ARM64)
1008
+ #define EIGEN_ASM_COMMENT(X) __asm__("#" X)
1009
+ #else
1010
+ #define EIGEN_ASM_COMMENT(X)
1011
+ #endif
641
1012
  #endif
642
1013
 
643
-
644
- //------------------------------------------------------------------------------------------
645
- // Static and dynamic alignment control
1014
+ // Acts as a barrier preventing operations involving `X` from crossing. This
1015
+ // occurs, for example, in the fast rounding trick where a magic constant is
1016
+ // added then subtracted, which is otherwise compiled away with -ffast-math.
646
1017
  //
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.
1018
+ // See bug 1674
1019
+ #if defined(EIGEN_GPU_COMPILE_PHASE)
1020
+ #define EIGEN_OPTIMIZATION_BARRIER(X)
1021
+ #endif
1022
+
1023
+ #if !defined(EIGEN_OPTIMIZATION_BARRIER)
1024
+ // Implement the barrier on GNUC compilers or clang-cl.
1025
+ #if EIGEN_COMP_GNUC || (defined(__clang__) && defined(_MSC_VER))
1026
+ // According to https://gcc.gnu.org/onlinedocs/gcc/Constraints.html:
1027
+ // X: Any operand whatsoever.
1028
+ // r: A register operand is allowed provided that it is in a general
1029
+ // register.
1030
+ // g: Any register, memory or immediate integer operand is allowed, except
1031
+ // for registers that are not general registers.
1032
+ // w: (AArch32/AArch64) Floating point register, Advanced SIMD vector
1033
+ // register or SVE vector register.
1034
+ // x: (SSE) Any SSE register.
1035
+ // (AArch64) Like w, but restricted to registers 0 to 15 inclusive.
1036
+ // v: (PowerPC) An Altivec vector register.
1037
+ // wa:(PowerPC) A VSX register.
651
1038
  //
652
- // This section also defines macros EIGEN_ALIGN_TO_BOUNDARY(N) and the shortcuts EIGEN_ALIGN{8,16,32,_MAX}
653
- // to be used to declare statically aligned buffers.
654
- //------------------------------------------------------------------------------------------
655
-
656
-
657
- /* EIGEN_ALIGN_TO_BOUNDARY(n) forces data to be n-byte aligned. This is used to satisfy SIMD requirements.
658
- * However, we do that EVEN if vectorization (EIGEN_VECTORIZE) is disabled,
659
- * so that vectorization doesn't affect binary compatibility.
660
- *
661
- * If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link
662
- * vectorized and non-vectorized code.
663
- */
664
- #if (defined __CUDACC__)
665
- #define EIGEN_ALIGN_TO_BOUNDARY(n) __align__(n)
666
- #elif EIGEN_COMP_GNUC || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM
667
- #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
668
- #elif EIGEN_COMP_MSVC
669
- #define EIGEN_ALIGN_TO_BOUNDARY(n) __declspec(align(n))
670
- #elif EIGEN_COMP_SUNCC
671
- // FIXME not sure about this one:
672
- #define EIGEN_ALIGN_TO_BOUNDARY(n) __attribute__((aligned(n)))
1039
+ // "X" (uppercase) should work for all cases, though this seems to fail for
1040
+ // some versions of GCC for arm/aarch64 with
1041
+ // "error: inconsistent operand constraints in an 'asm'"
1042
+ // Clang x86_64/arm/aarch64 seems to require "g" to support both scalars and
1043
+ // vectors, otherwise
1044
+ // "error: non-trivial scalar-to-vector conversion, possible invalid
1045
+ // constraint for vector type"
1046
+ //
1047
+ // GCC for ppc64le generates an internal compiler error with x/X/g.
1048
+ // GCC for AVX generates an internal compiler error with X.
1049
+ //
1050
+ // Tested on icc/gcc/clang for sse, avx, avx2, avx512dq
1051
+ // gcc for arm, aarch64,
1052
+ // gcc for ppc64le,
1053
+ // both vectors and scalars.
1054
+ //
1055
+ // Note that this is restricted to plain types - this will not work
1056
+ // directly for std::complex<T>, Eigen::half, Eigen::bfloat16. For these,
1057
+ // you will need to apply to the underlying POD type.
1058
+ #if EIGEN_ARCH_PPC && EIGEN_COMP_GNUC_STRICT
1059
+ // This seems to be broken on clang. Packet4f is loaded into a single
1060
+ // register rather than a vector, zeroing out some entries. Integer
1061
+ // types also generate a compile error.
1062
+ #if EIGEN_OS_MAC
1063
+ // General, Altivec for Apple (VSX were added in ISA v2.06):
1064
+ #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+r,v"(X));
673
1065
  #else
674
- #error Please tell me what is the equivalent of __attribute__((aligned(n))) for your compiler
1066
+ // General, Altivec, VSX otherwise:
1067
+ #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+r,v,wa"(X));
675
1068
  #endif
676
-
677
- // If the user explicitly disable vectorization, then we also disable alignment
678
- #if defined(EIGEN_DONT_VECTORIZE)
679
- #define EIGEN_IDEAL_MAX_ALIGN_BYTES 0
680
- #elif defined(EIGEN_VECTORIZE_AVX512)
681
- // 64 bytes static alignmeent is preferred only if really required
682
- #define EIGEN_IDEAL_MAX_ALIGN_BYTES 64
683
- #elif defined(__AVX__)
684
- // 32 bytes static alignmeent is preferred only if really required
685
- #define EIGEN_IDEAL_MAX_ALIGN_BYTES 32
1069
+ #elif EIGEN_ARCH_ARM_OR_ARM64
1070
+ #ifdef __ARM_FP
1071
+ // General, VFP or NEON.
1072
+ // Clang doesn't like "r",
1073
+ // error: non-trivial scalar-to-vector conversion, possible invalid
1074
+ // constraint for vector typ
1075
+ #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+g,w"(X));
686
1076
  #else
687
- #define EIGEN_IDEAL_MAX_ALIGN_BYTES 16
688
- #endif
689
-
690
-
691
- // EIGEN_MIN_ALIGN_BYTES defines the minimal value for which the notion of explicit alignment makes sense
692
- #define EIGEN_MIN_ALIGN_BYTES 16
693
-
694
- // Defined the boundary (in bytes) on which the data needs to be aligned. Note
695
- // that unless EIGEN_ALIGN is defined and not equal to 0, the data may not be
696
- // aligned at all regardless of the value of this #define.
697
-
698
- #if (defined(EIGEN_DONT_ALIGN_STATICALLY) || defined(EIGEN_DONT_ALIGN)) && defined(EIGEN_MAX_STATIC_ALIGN_BYTES) && EIGEN_MAX_STATIC_ALIGN_BYTES>0
699
- #error EIGEN_MAX_STATIC_ALIGN_BYTES and EIGEN_DONT_ALIGN[_STATICALLY] are both defined with EIGEN_MAX_STATIC_ALIGN_BYTES!=0. Use EIGEN_MAX_STATIC_ALIGN_BYTES=0 as a synonym of EIGEN_DONT_ALIGN_STATICALLY.
700
- #endif
701
-
702
- // EIGEN_DONT_ALIGN_STATICALLY and EIGEN_DONT_ALIGN are deprectated
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
744
- #else
745
- #define EIGEN_MAX_STATIC_ALIGN_BYTES 0
746
- #endif
747
-
748
- #endif
749
-
750
- // If EIGEN_MAX_ALIGN_BYTES is defined, then it is considered as an upper bound for EIGEN_MAX_ALIGN_BYTES
751
- #if defined(EIGEN_MAX_ALIGN_BYTES) && EIGEN_MAX_ALIGN_BYTES<EIGEN_MAX_STATIC_ALIGN_BYTES
752
- #undef EIGEN_MAX_STATIC_ALIGN_BYTES
753
- #define EIGEN_MAX_STATIC_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES
1077
+ // Arm without VFP or NEON.
1078
+ // "w" constraint will not compile.
1079
+ #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+g"(X));
754
1080
  #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)
1081
+ #elif EIGEN_ARCH_i386_OR_x86_64
1082
+ // General, SSE.
1083
+ #define EIGEN_OPTIMIZATION_BARRIER(X) __asm__("" : "+g,x"(X));
773
1084
  #else
774
- #define EIGEN_ALIGN_MAX
1085
+ // Not implemented for other architectures.
1086
+ #define EIGEN_OPTIMIZATION_BARRIER(X)
775
1087
  #endif
776
-
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.
1088
+ #else
1089
+ // Not implemented for other compilers.
1090
+ #define EIGEN_OPTIMIZATION_BARRIER(X)
782
1091
  #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
1092
  #endif
792
1093
 
793
- #if EIGEN_IDEAL_MAX_ALIGN_BYTES > EIGEN_MAX_ALIGN_BYTES
794
- #define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_IDEAL_MAX_ALIGN_BYTES
1094
+ #if EIGEN_COMP_MSVC
1095
+ // NOTE MSVC often gives C4127 warnings with compiletime if statements. See bug 1362.
1096
+ // This workaround is ugly, but it does the job.
1097
+ #define EIGEN_CONST_CONDITIONAL(cond) (void)0, cond
795
1098
  #else
796
- #define EIGEN_DEFAULT_ALIGN_BYTES EIGEN_MAX_ALIGN_BYTES
1099
+ #define EIGEN_CONST_CONDITIONAL(cond) cond
797
1100
  #endif
798
1101
 
799
-
800
- #ifndef EIGEN_UNALIGNED_VECTORIZE
801
- #define EIGEN_UNALIGNED_VECTORIZE 1
802
- #endif
803
-
804
- //----------------------------------------------------------------------
805
-
806
-
807
1102
  #ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD
808
- #define EIGEN_RESTRICT
1103
+ #define EIGEN_RESTRICT
809
1104
  #endif
810
1105
  #ifndef EIGEN_RESTRICT
811
- #define EIGEN_RESTRICT __restrict
812
- #endif
813
-
814
- #ifndef EIGEN_STACK_ALLOCATION_LIMIT
815
- // 131072 == 128 KB
816
- #define EIGEN_STACK_ALLOCATION_LIMIT 131072
1106
+ #define EIGEN_RESTRICT __restrict
817
1107
  #endif
818
1108
 
819
1109
  #ifndef EIGEN_DEFAULT_IO_FORMAT
@@ -829,48 +1119,52 @@ namespace Eigen {
829
1119
  // just an empty macro !
830
1120
  #define EIGEN_EMPTY
831
1121
 
832
- #if EIGEN_COMP_MSVC_STRICT && (EIGEN_COMP_MSVC < 1900 || EIGEN_CUDACC_VER>0)
833
- // for older MSVC versions, as well as 1900 && CUDA 8, using the base operator is sufficient (cf Bugs 1000, 1324)
834
- #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
835
- using Base::operator =;
836
- #elif EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653)
837
- #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
838
- using Base::operator =; \
839
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { Base::operator=(other); return *this; } \
840
- template <typename OtherDerived> \
841
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other) { Base::operator=(other.derived()); return *this; }
1122
+ // When compiling CUDA/HIP device code with NVCC or HIPCC
1123
+ // pull in math functions from the global namespace.
1124
+ // In host mode, and when device code is compiled with clang,
1125
+ // use the std versions.
1126
+ #if (defined(EIGEN_CUDA_ARCH) && defined(__NVCC__)) || defined(EIGEN_HIP_DEVICE_COMPILE)
1127
+ #define EIGEN_USING_STD(FUNC) using ::FUNC;
1128
+ #else
1129
+ #define EIGEN_USING_STD(FUNC) using std::FUNC;
1130
+ #endif
1131
+
1132
+ #if EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653)
1133
+ #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
1134
+ using Base::operator=; \
1135
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { \
1136
+ Base::operator=(other); \
1137
+ return *this; \
1138
+ } \
1139
+ template <typename OtherDerived> \
1140
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other) { \
1141
+ Base::operator=(other.derived()); \
1142
+ return *this; \
1143
+ }
842
1144
  #else
843
- #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
844
- using Base::operator =; \
845
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) \
846
- { \
847
- Base::operator=(other); \
848
- return *this; \
849
- }
1145
+ #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
1146
+ using Base::operator=; \
1147
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { \
1148
+ Base::operator=(other); \
1149
+ return *this; \
1150
+ }
850
1151
  #endif
851
1152
 
852
-
853
1153
  /**
854
1154
  * \internal
855
1155
  * \brief Macro to explicitly define the default copy constructor.
856
1156
  * This is necessary, because the implicit definition is deprecated if the copy-assignment is overridden.
857
1157
  */
858
- #if EIGEN_HAS_CXX11
859
1158
  #define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) EIGEN_DEVICE_FUNC CLASS(const CLASS&) = default;
860
- #else
861
- #define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
862
- #endif
863
-
864
-
865
1159
 
866
1160
  /** \internal
867
1161
  * \brief Macro to manually inherit assignment operators.
868
- * This is necessary, because the implicitly defined assignment operator gets deleted when a custom operator= is defined.
869
- * With C++11 or later this also default-implements the copy-constructor
1162
+ * This is necessary, because the implicitly defined assignment operator gets deleted when a custom operator= is
1163
+ * defined. With C++11 or later this also default-implements the copy-constructor
870
1164
  */
871
- #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
872
- EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
873
- EIGEN_DEFAULT_COPY_CONSTRUCTOR(Derived)
1165
+ #define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
1166
+ EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
1167
+ EIGEN_DEFAULT_COPY_CONSTRUCTOR(Derived)
874
1168
 
875
1169
  /** \internal
876
1170
  * \brief Macro to manually define default constructors and destructors.
@@ -879,175 +1173,174 @@ namespace Eigen {
879
1173
  *
880
1174
  * Hiding the default destructor lead to problems in C++03 mode together with boost::multiprecision
881
1175
  */
882
- #if EIGEN_HAS_CXX11
883
- #define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
884
- EIGEN_DEVICE_FUNC Derived() = default; \
885
- EIGEN_DEVICE_FUNC ~Derived() = default;
886
- #else
887
- #define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
888
- EIGEN_DEVICE_FUNC Derived() {}; \
889
- /* EIGEN_DEVICE_FUNC ~Derived() {}; */
890
- #endif
891
-
892
-
893
-
894
-
1176
+ #define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
1177
+ EIGEN_DEVICE_FUNC Derived() = default; \
1178
+ EIGEN_DEVICE_FUNC ~Derived() = default;
895
1179
 
896
1180
  /**
897
- * Just a side note. Commenting within defines works only by documenting
898
- * behind the object (via '!<'). Comments cannot be multi-line and thus
899
- * we have these extra long lines. What is confusing doxygen over here is
900
- * that we use '\' and basically have a bunch of typedefs with their
901
- * documentation in a single line.
902
- **/
903
-
904
- #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
905
- typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; /*!< \brief Numeric type, e.g. float, double, int or std::complex<float>. */ \
906
- typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; /*!< \brief The underlying numeric type for composed scalar types. \details In cases where Scalar is e.g. std::complex<T>, T were corresponding to RealScalar. */ \
907
- typedef typename Base::CoeffReturnType CoeffReturnType; /*!< \brief The return type for coefficient access. \details Depending on whether the object allows direct coefficient access (e.g. for a MatrixXd), this type is either 'const Scalar&' or simply 'Scalar' for objects that do not allow direct coefficient access. */ \
908
- typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \
909
- typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
910
- typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \
911
- enum { RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \
912
- ColsAtCompileTime = Eigen::internal::traits<Derived>::ColsAtCompileTime, \
913
- Flags = Eigen::internal::traits<Derived>::Flags, \
914
- SizeAtCompileTime = Base::SizeAtCompileTime, \
915
- MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \
916
- IsVectorAtCompileTime = Base::IsVectorAtCompileTime }; \
917
- using Base::derived; \
1181
+ * Just a side note. Commenting within defines works only by documenting
1182
+ * behind the object (via '!<'). Comments cannot be multi-line and thus
1183
+ * we have these extra long lines. What is confusing doxygen over here is
1184
+ * that we use '\' and basically have a bunch of typedefs with their
1185
+ * documentation in a single line.
1186
+ **/
1187
+
1188
+ #define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
1189
+ typedef typename Eigen::internal::traits<Derived>::Scalar \
1190
+ Scalar; /*!< \brief Numeric type, e.g. float, double, int or std::complex<float>. */ \
1191
+ typedef typename Eigen::NumTraits<Scalar>::Real \
1192
+ RealScalar; /*!< \brief The underlying numeric type for composed scalar types. \details In cases where Scalar is \
1193
+ e.g. std::complex<T>, T were corresponding to RealScalar. */ \
1194
+ typedef typename Base::CoeffReturnType \
1195
+ CoeffReturnType; /*!< \brief The return type for coefficient access. \details Depending on whether the object \
1196
+ allows direct coefficient access (e.g. for a MatrixXd), this type is either 'const Scalar&' \
1197
+ or simply 'Scalar' for objects that do not allow direct coefficient access. */ \
1198
+ typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \
1199
+ typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
1200
+ typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \
1201
+ enum CompileTimeTraits { \
1202
+ RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \
1203
+ ColsAtCompileTime = Eigen::internal::traits<Derived>::ColsAtCompileTime, \
1204
+ Flags = Eigen::internal::traits<Derived>::Flags, \
1205
+ SizeAtCompileTime = Base::SizeAtCompileTime, \
1206
+ MaxSizeAtCompileTime = Base::MaxSizeAtCompileTime, \
1207
+ IsVectorAtCompileTime = Base::IsVectorAtCompileTime \
1208
+ }; \
1209
+ using Base::derived; \
918
1210
  using Base::const_cast_derived;
919
1211
 
920
-
921
1212
  // FIXME Maybe the EIGEN_DENSE_PUBLIC_INTERFACE could be removed as importing PacketScalar is rarely needed
922
1213
  #define EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \
923
- EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
1214
+ EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) \
924
1215
  typedef typename Base::PacketScalar PacketScalar;
925
1216
 
1217
+ #if EIGEN_HAS_BUILTIN(__builtin_expect) || EIGEN_COMP_GNUC
1218
+ #define EIGEN_PREDICT_FALSE(x) (__builtin_expect(x, false))
1219
+ #define EIGEN_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
1220
+ #else
1221
+ #define EIGEN_PREDICT_FALSE(x) (x)
1222
+ #define EIGEN_PREDICT_TRUE(x) (x)
1223
+ #endif
926
1224
 
927
- #define EIGEN_PLAIN_ENUM_MIN(a,b) (((int)a <= (int)b) ? (int)a : (int)b)
928
- #define EIGEN_PLAIN_ENUM_MAX(a,b) (((int)a >= (int)b) ? (int)a : (int)b)
1225
+ // the expression type of a standard coefficient wise binary operation
1226
+ #define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS, RHS, OPNAME) \
1227
+ CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_, OPNAME), _op) < typename internal::traits<LHS>::Scalar, \
1228
+ typename internal::traits<RHS>::Scalar>, \
1229
+ const LHS, const RHS >
1230
+
1231
+ #define EIGEN_MAKE_CWISE_BINARY_OP(METHOD, OPNAME) \
1232
+ template <typename OtherDerived> \
1233
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE( \
1234
+ Derived, OtherDerived, OPNAME)(METHOD)(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const { \
1235
+ return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, OPNAME)(derived(), other.derived()); \
1236
+ }
929
1237
 
930
- // EIGEN_SIZE_MIN_PREFER_DYNAMIC gives the min between compile-time sizes. 0 has absolute priority, followed by 1,
931
- // followed by Dynamic, followed by other finite values. The reason for giving Dynamic the priority over
932
- // finite values is that min(3, Dynamic) should be Dynamic, since that could be anything between 0 and 3.
933
- #define EIGEN_SIZE_MIN_PREFER_DYNAMIC(a,b) (((int)a == 0 || (int)b == 0) ? 0 \
934
- : ((int)a == 1 || (int)b == 1) ? 1 \
935
- : ((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \
936
- : ((int)a <= (int)b) ? (int)a : (int)b)
1238
+ #define EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME, TYPEA, TYPEB) \
1239
+ (Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits< \
1240
+ TYPEA, TYPEB, EIGEN_CAT(EIGEN_CAT(Eigen::internal::scalar_, OPNAME), _op) < TYPEA, TYPEB> > > ::value)
1241
+
1242
+ #define EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(EXPR, SCALAR, OPNAME) \
1243
+ CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_, OPNAME), _op) < typename internal::traits<EXPR>::Scalar, \
1244
+ SCALAR>, \
1245
+ const EXPR, const typename internal::plain_constant_type<EXPR, SCALAR>::type >
1246
+
1247
+ #define EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(SCALAR, EXPR, OPNAME) \
1248
+ CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_, OPNAME), _op) < SCALAR, \
1249
+ typename internal::traits<EXPR>::Scalar>, \
1250
+ const typename internal::plain_constant_type<EXPR, SCALAR>::type, const EXPR >
1251
+
1252
+ #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD, OPNAME) \
1253
+ template <typename T> \
1254
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE( \
1255
+ Derived, \
1256
+ typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED( \
1257
+ OPNAME, Scalar, T)>::type, \
1258
+ OPNAME)(METHOD)(const T& scalar) const { \
1259
+ typedef typename internal::promote_scalar_arg<Scalar, T, EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME, Scalar, T)>::type \
1260
+ PromotedT; \
1261
+ return EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived, PromotedT, OPNAME)( \
1262
+ derived(), typename internal::plain_constant_type<Derived, PromotedT>::type( \
1263
+ derived().rows(), derived().cols(), internal::scalar_constant_op<PromotedT>(scalar))); \
1264
+ }
937
1265
 
938
- // EIGEN_SIZE_MIN_PREFER_FIXED is a variant of EIGEN_SIZE_MIN_PREFER_DYNAMIC comparing MaxSizes. The difference is that finite values
939
- // now have priority over Dynamic, so that min(3, Dynamic) gives 3. Indeed, whatever the actual value is
940
- // (between 0 and 3), it is not more than 3.
941
- #define EIGEN_SIZE_MIN_PREFER_FIXED(a,b) (((int)a == 0 || (int)b == 0) ? 0 \
942
- : ((int)a == 1 || (int)b == 1) ? 1 \
943
- : ((int)a == Dynamic && (int)b == Dynamic) ? Dynamic \
944
- : ((int)a == Dynamic) ? (int)b \
945
- : ((int)b == Dynamic) ? (int)a \
946
- : ((int)a <= (int)b) ? (int)a : (int)b)
1266
+ #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD, OPNAME) \
1267
+ template <typename T> \
1268
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE( \
1269
+ typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA EIGEN_SCALAR_BINARY_SUPPORTED( \
1270
+ OPNAME, T, Scalar)>::type, \
1271
+ Derived, OPNAME)(METHOD)(const T& scalar, const StorageBaseType& matrix) { \
1272
+ typedef typename internal::promote_scalar_arg<Scalar, T, EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME, T, Scalar)>::type \
1273
+ PromotedT; \
1274
+ return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(PromotedT, Derived, OPNAME)( \
1275
+ typename internal::plain_constant_type<Derived, PromotedT>::type( \
1276
+ matrix.derived().rows(), matrix.derived().cols(), internal::scalar_constant_op<PromotedT>(scalar)), \
1277
+ matrix.derived()); \
1278
+ }
1279
+
1280
+ #define EIGEN_MAKE_SCALAR_BINARY_OP(METHOD, OPNAME) \
1281
+ EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD, OPNAME) \
1282
+ EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD, OPNAME)
947
1283
 
948
- // see EIGEN_SIZE_MIN_PREFER_DYNAMIC. No need for a separate variant for MaxSizes here.
949
- #define EIGEN_SIZE_MAX(a,b) (((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \
950
- : ((int)a >= (int)b) ? (int)a : (int)b)
1284
+ #if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(EIGEN_CUDA_ARCH) && !defined(EIGEN_EXCEPTIONS) && \
1285
+ !defined(EIGEN_USE_SYCL) && !defined(EIGEN_HIP_DEVICE_COMPILE)
1286
+ #define EIGEN_EXCEPTIONS
1287
+ #endif
951
1288
 
952
- #define EIGEN_LOGICAL_XOR(a,b) (((a) || (b)) && !((a) && (b)))
1289
+ #ifdef EIGEN_EXCEPTIONS
1290
+ #define EIGEN_THROW_X(X) throw X
1291
+ #define EIGEN_THROW throw
1292
+ #define EIGEN_TRY try
1293
+ #define EIGEN_CATCH(X) catch (X)
1294
+ #else
1295
+ #if defined(EIGEN_CUDA_ARCH)
1296
+ #define EIGEN_THROW_X(X) asm("trap;")
1297
+ #define EIGEN_THROW asm("trap;")
1298
+ #elif defined(EIGEN_HIP_DEVICE_COMPILE)
1299
+ #define EIGEN_THROW_X(X) asm("s_trap 0")
1300
+ #define EIGEN_THROW asm("s_trap 0")
1301
+ #else
1302
+ #define EIGEN_THROW_X(X) std::abort()
1303
+ #define EIGEN_THROW std::abort()
1304
+ #endif
1305
+ #define EIGEN_TRY if (true)
1306
+ #define EIGEN_CATCH(X) else
1307
+ #endif
953
1308
 
954
- #define EIGEN_IMPLIES(a,b) (!(a) || (b))
1309
+ // The all function is used to enable a variadic version of eigen_assert which can take a parameter pack as its input.
1310
+ namespace Eigen {
1311
+ namespace internal {
955
1312
 
956
- // the expression type of a standard coefficient wise binary operation
957
- #define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS,RHS,OPNAME) \
958
- CwiseBinaryOp< \
959
- EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)< \
960
- typename internal::traits<LHS>::Scalar, \
961
- typename internal::traits<RHS>::Scalar \
962
- >, \
963
- const LHS, \
964
- const RHS \
965
- >
966
-
967
- #define EIGEN_MAKE_CWISE_BINARY_OP(METHOD,OPNAME) \
968
- template<typename OtherDerived> \
969
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME) \
970
- (METHOD)(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \
971
- { \
972
- return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived,OtherDerived,OPNAME)(derived(), other.derived()); \
973
- }
1313
+ EIGEN_DEVICE_FUNC inline bool all() { return true; }
974
1314
 
975
- #define EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,TYPEA,TYPEB) \
976
- (Eigen::internal::has_ReturnType<Eigen::ScalarBinaryOpTraits<TYPEA,TYPEB,EIGEN_CAT(EIGEN_CAT(Eigen::internal::scalar_,OPNAME),_op)<TYPEA,TYPEB> > >::value)
1315
+ template <typename T, typename... Ts>
1316
+ EIGEN_DEVICE_FUNC bool all(T t, Ts... ts) {
1317
+ return t && all(ts...);
1318
+ }
977
1319
 
978
- #define EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(EXPR,SCALAR,OPNAME) \
979
- CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<typename internal::traits<EXPR>::Scalar,SCALAR>, const EXPR, \
980
- const typename internal::plain_constant_type<EXPR,SCALAR>::type>
1320
+ } // namespace internal
1321
+ } // namespace Eigen
981
1322
 
982
- #define EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(SCALAR,EXPR,OPNAME) \
983
- CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<SCALAR,typename internal::traits<EXPR>::Scalar>, \
984
- const typename internal::plain_constant_type<EXPR,SCALAR>::type, const EXPR>
1323
+ // provide override and final specifiers if they are available:
1324
+ #define EIGEN_OVERRIDE override
1325
+ #define EIGEN_FINAL final
985
1326
 
986
- // Workaround for MSVC 2010 (see ML thread "patch with compile for for MSVC 2010")
987
- #if EIGEN_COMP_MSVC_STRICT<=1600
988
- #define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) typename internal::enable_if<true,X>::type
1327
+ // Wrapping #pragma unroll in a macro since it is required for SYCL
1328
+ #if defined(SYCL_DEVICE_ONLY)
1329
+ #if defined(_MSC_VER)
1330
+ #define EIGEN_UNROLL_LOOP __pragma(unroll)
989
1331
  #else
990
- #define EIGEN_MSVC10_WORKAROUND_BINARYOP_RETURN_TYPE(X) X
1332
+ #define EIGEN_UNROLL_LOOP _Pragma("unroll")
1333
+ #endif
1334
+ #else
1335
+ #define EIGEN_UNROLL_LOOP
991
1336
  #endif
992
1337
 
993
- #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME) \
994
- template <typename T> EIGEN_DEVICE_FUNC inline \
995
- 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
- (METHOD)(const T& scalar) const { \
997
- typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,Scalar,T)>::type PromotedT; \
998
- return EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,PromotedT,OPNAME)(derived(), \
999
- typename internal::plain_constant_type<Derived,PromotedT>::type(derived().rows(), derived().cols(), internal::scalar_constant_op<PromotedT>(scalar))); \
1000
- }
1001
-
1002
- #define EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \
1003
- template <typename T> EIGEN_DEVICE_FUNC inline friend \
1004
- 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
- (METHOD)(const T& scalar, const StorageBaseType& matrix) { \
1006
- typedef typename internal::promote_scalar_arg<Scalar,T,EIGEN_SCALAR_BINARY_SUPPORTED(OPNAME,T,Scalar)>::type PromotedT; \
1007
- return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(PromotedT,Derived,OPNAME)( \
1008
- typename internal::plain_constant_type<Derived,PromotedT>::type(matrix.derived().rows(), matrix.derived().cols(), internal::scalar_constant_op<PromotedT>(scalar)), matrix.derived()); \
1009
- }
1010
-
1011
- #define EIGEN_MAKE_SCALAR_BINARY_OP(METHOD,OPNAME) \
1012
- EIGEN_MAKE_SCALAR_BINARY_OP_ONTHELEFT(METHOD,OPNAME) \
1013
- EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(METHOD,OPNAME)
1014
-
1338
+ // Notice: Use this macro with caution. The code in the if body should still
1339
+ // compile with C++14.
1340
+ #if defined(EIGEN_HAS_CXX17_IFCONSTEXPR)
1341
+ #define EIGEN_IF_CONSTEXPR(X) if constexpr (X)
1342
+ #else
1343
+ #define EIGEN_IF_CONSTEXPR(X) if (X)
1344
+ #endif
1015
1345
 
1016
- #ifdef EIGEN_EXCEPTIONS
1017
- # define EIGEN_THROW_X(X) throw X
1018
- # define EIGEN_THROW throw
1019
- # define EIGEN_TRY try
1020
- # define EIGEN_CATCH(X) catch (X)
1021
- #else
1022
- # ifdef __CUDA_ARCH__
1023
- # define EIGEN_THROW_X(X) asm("trap;")
1024
- # define EIGEN_THROW asm("trap;")
1025
- # else
1026
- # define EIGEN_THROW_X(X) std::abort()
1027
- # define EIGEN_THROW std::abort()
1028
- # endif
1029
- # define EIGEN_TRY if (true)
1030
- # define EIGEN_CATCH(X) else
1031
- #endif
1032
-
1033
-
1034
- #if EIGEN_HAS_CXX11_NOEXCEPT
1035
- # define EIGEN_INCLUDE_TYPE_TRAITS
1036
- # define EIGEN_NOEXCEPT noexcept
1037
- # define EIGEN_NOEXCEPT_IF(x) noexcept(x)
1038
- # define EIGEN_NO_THROW noexcept(true)
1039
- # define EIGEN_EXCEPTION_SPEC(X) noexcept(false)
1040
- #else
1041
- # define EIGEN_NOEXCEPT
1042
- # define EIGEN_NOEXCEPT_IF(x)
1043
- # define EIGEN_NO_THROW throw()
1044
- # if EIGEN_COMP_MSVC
1045
- // MSVC does not support exception specifications (warning C4290),
1046
- // and they are deprecated in c++11 anyway.
1047
- # define EIGEN_EXCEPTION_SPEC(X) throw()
1048
- # else
1049
- # define EIGEN_EXCEPTION_SPEC(X) throw(X)
1050
- # endif
1051
- #endif
1052
-
1053
- #endif // EIGEN_MACROS_H
1346
+ #endif // EIGEN_MACROS_H