From d6689a15d75e0af62a5f0f6112f6b75c50947eea Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Fri, 15 Nov 2024 21:11:01 -0800 Subject: [PATCH] Replace instances of EIGEN_CONSTEXPR macro --- Eigen/src/Cholesky/LDLT.h | 4 +- Eigen/src/Cholesky/LLT.h | 4 +- Eigen/src/Core/Array.h | 4 +- Eigen/src/Core/ArrayWrapper.h | 24 ++-- Eigen/src/Core/AssignEvaluator.h | 81 +++++++------ Eigen/src/Core/BandMatrix.h | 16 +-- Eigen/src/Core/Block.h | 15 ++- Eigen/src/Core/CoreEvaluators.h | 14 +-- Eigen/src/Core/CwiseBinaryOp.h | 4 +- Eigen/src/Core/CwiseNullaryOp.h | 4 +- Eigen/src/Core/CwiseUnaryOp.h | 4 +- Eigen/src/Core/CwiseUnaryView.h | 8 +- Eigen/src/Core/DenseBase.h | 4 +- Eigen/src/Core/DenseCoeffsBase.h | 57 +++++----- Eigen/src/Core/DeviceWrapper.h | 12 +- Eigen/src/Core/Diagonal.h | 14 +-- Eigen/src/Core/DiagonalMatrix.h | 4 +- Eigen/src/Core/EigenBase.h | 6 +- Eigen/src/Core/ForceAlignedAccess.h | 12 +- Eigen/src/Core/GenericPacketMath.h | 22 ++-- Eigen/src/Core/IndexedView.h | 4 +- Eigen/src/Core/Inverse.h | 4 +- Eigen/src/Core/Map.h | 4 +- Eigen/src/Core/MapBase.h | 4 +- Eigen/src/Core/MathFunctions.h | 10 +- Eigen/src/Core/Matrix.h | 4 +- Eigen/src/Core/NestByValue.h | 4 +- Eigen/src/Core/NumTraits.h | 78 ++++++------- Eigen/src/Core/PlainObjectBase.h | 10 +- Eigen/src/Core/Product.h | 4 +- Eigen/src/Core/RandomImpl.h | 4 +- Eigen/src/Core/Ref.h | 10 +- Eigen/src/Core/Replicate.h | 4 +- Eigen/src/Core/Reshaped.h | 4 +- Eigen/src/Core/ReturnByValue.h | 8 +- Eigen/src/Core/Reverse.h | 4 +- Eigen/src/Core/Select.h | 4 +- Eigen/src/Core/SelfAdjointView.h | 8 +- Eigen/src/Core/SkewSymmetricMatrix3.h | 6 +- Eigen/src/Core/Solve.h | 4 +- Eigen/src/Core/SolveTriangular.h | 4 +- Eigen/src/Core/Stride.h | 4 +- Eigen/src/Core/Transpose.h | 4 +- Eigen/src/Core/Transpositions.h | 6 +- Eigen/src/Core/TriangularMatrix.h | 12 +- Eigen/src/Core/VectorwiseOp.h | 4 +- Eigen/src/Core/Visitor.h | 12 +- .../arch/Default/GenericPacketMathFunctions.h | 10 +- Eigen/src/Core/arch/GPU/Tuple.h | 43 ++++--- Eigen/src/Core/util/EmulateArray.h | 6 +- Eigen/src/Core/util/Meta.h | 30 ++--- Eigen/src/Core/util/ReshapedHelper.h | 2 +- Eigen/src/Core/util/XprHelper.h | 14 +-- Eigen/src/Eigenvalues/Tridiagonalization.h | 4 +- Eigen/src/Geometry/Homogeneous.h | 12 +- Eigen/src/Geometry/Quaternion.h | 16 +-- Eigen/src/Geometry/Transform.h | 4 +- Eigen/src/Geometry/Translation.h | 12 +- Eigen/src/Householder/HouseholderSequence.h | 4 +- .../BasicPreconditioners.h | 4 +- .../IncompleteCholesky.h | 4 +- .../IterativeLinearSolvers/IncompleteLUT.h | 6 +- .../IterativeSolverBase.h | 4 +- .../IterativeLinearSolvers/SolveWithGuess.h | 4 +- Eigen/src/KLUSupport/KLUSupport.h | 4 +- Eigen/src/LU/FullPivLU.h | 4 +- Eigen/src/LU/PartialPivLU.h | 4 +- Eigen/src/misc/lapacke_helpers.h | 2 +- Eigen/src/plugins/BlockMethods.inc | 2 +- .../CXX11/src/Tensor/TensorContractionSycl.h | 107 +++++++++--------- .../Eigen/CXX11/src/Tensor/TensorIndexList.h | 26 ++--- .../Eigen/CXX11/src/Tensor/TensorMeta.h | 19 ++-- .../CXX11/src/Tensor/TensorReductionSycl.h | 22 ++-- .../Eigen/CXX11/src/Tensor/TensorScan.h | 2 +- .../Eigen/CXX11/src/Tensor/TensorScanSycl.h | 6 +- .../src/TensorSymmetry/DynamicSymmetry.h | 2 +- .../CXX11/src/TensorSymmetry/StaticSymmetry.h | 20 ++-- .../Eigen/CXX11/src/util/CXX11Workarounds.h | 6 +- 78 files changed, 445 insertions(+), 501 deletions(-) diff --git a/Eigen/src/Cholesky/LDLT.h b/Eigen/src/Cholesky/LDLT.h index 5d52ab20f..f2d479d3c 100644 --- a/Eigen/src/Cholesky/LDLT.h +++ b/Eigen/src/Cholesky/LDLT.h @@ -230,8 +230,8 @@ class LDLT : public SolverBase > { */ const LDLT& adjoint() const { return *this; } - EIGEN_DEVICE_FUNC inline EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } - EIGEN_DEVICE_FUNC inline EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } /** \brief Reports whether previous computation was successful. * diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h index 01b44769a..5d3e994e5 100644 --- a/Eigen/src/Cholesky/LLT.h +++ b/Eigen/src/Cholesky/LLT.h @@ -184,8 +184,8 @@ class LLT : public SolverBase > { */ const LLT& adjoint() const EIGEN_NOEXCEPT { return *this; } - inline EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } - inline EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } template LLT& rankUpdate(const VectorType& vec, const RealScalar& sigma = 1); diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index 3376dfcbb..44510c039 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -253,8 +253,8 @@ class Array : public PlainObjectBaseinnerSize(); } + EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return 1; } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); } #ifdef EIGEN_ARRAY_PLUGIN #include EIGEN_ARRAY_PLUGIN diff --git a/Eigen/src/Core/ArrayWrapper.h b/Eigen/src/Core/ArrayWrapper.h index b636d88ad..ecd23e984 100644 --- a/Eigen/src/Core/ArrayWrapper.h +++ b/Eigen/src/Core/ArrayWrapper.h @@ -56,14 +56,10 @@ class ArrayWrapper : public ArrayBase > { EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { - return m_expression.outerStride(); - } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { - return m_expression.innerStride(); - } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); } EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return m_expression.data(); } EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_expression.data(); } @@ -135,14 +131,10 @@ class MatrixWrapper : public MatrixBase > { EIGEN_DEVICE_FUNC explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { - return m_expression.outerStride(); - } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { - return m_expression.innerStride(); - } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_expression.innerStride(); } EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return m_expression.data(); } EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_expression.data(); } diff --git a/Eigen/src/Core/AssignEvaluator.h b/Eigen/src/Core/AssignEvaluator.h index b4e8794a4..60cb769f3 100644 --- a/Eigen/src/Core/AssignEvaluator.h +++ b/Eigen/src/Core/AssignEvaluator.h @@ -200,7 +200,7 @@ struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling { template struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {} + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {} }; template @@ -254,7 +254,7 @@ struct copy_using_evaluator_innervec_CompleteUnrolling { template struct copy_using_evaluator_innervec_CompleteUnrolling { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {} + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {} }; template @@ -334,7 +334,7 @@ template struct dense_assignment_loop_impl { static constexpr int SizeAtCompileTime = Kernel::AssignmentTraits::SizeAtCompileTime; - EIGEN_DEVICE_FUNC static void EIGEN_STRONG_INLINE EIGEN_CONSTEXPR run(Kernel& /*kernel*/) { + EIGEN_DEVICE_FUNC static void EIGEN_STRONG_INLINE constexpr run(Kernel& /*kernel*/) { EIGEN_STATIC_ASSERT(SizeAtCompileTime == 0, EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT) } }; @@ -385,25 +385,23 @@ template - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& /*kernel*/, Index /*start*/, - Index /*end*/) {} + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& /*kernel*/, Index /*start*/, Index /*end*/) {} template - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& /*kernel*/, Index /*outer*/, - Index /*innerStart*/, Index /*innerEnd*/) {} + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& /*kernel*/, Index /*outer*/, + Index /*innerStart*/, Index /*innerEnd*/) {} }; template struct unaligned_dense_assignment_loop { template - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Index start, Index end) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Index start, Index end) { Index count = end - start; eigen_assert(count <= unpacket_traits::size); if (count > 0) kernel.template assignPacketSegment(start, 0, count); } template - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Index outer, Index start, - Index end) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Index outer, Index start, Index end) { Index count = end - start; eigen_assert(count <= unpacket_traits::size); if (count > 0) @@ -415,12 +413,12 @@ template struct unaligned_dense_assignment_loop { template - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Index start, Index end) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Index start, Index end) { for (Index index = start; index < end; ++index) kernel.assignCoeff(index); } template - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Index outer, Index innerStart, - Index innerEnd) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Index outer, Index innerStart, + Index innerEnd) { for (Index inner = innerStart; inner < innerEnd; ++inner) kernel.assignCoeffByOuterInner(outer, inner); } }; @@ -440,7 +438,7 @@ struct copy_using_evaluator_linearvec_CompleteUnrolling { template struct copy_using_evaluator_linearvec_CompleteUnrolling { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {} + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {} }; template @@ -460,12 +458,12 @@ struct copy_using_evaluator_linearvec_segment struct copy_using_evaluator_linearvec_segment { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {} + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {} }; template struct copy_using_evaluator_linearvec_segment { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel&) {} + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel&) {} }; template @@ -486,7 +484,7 @@ struct dense_assignment_loop_impl; using tail_loop = unaligned_dense_assignment_loop; - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) { const Index size = kernel.size(); const Index alignedStart = DstIsAligned ? 0 : first_aligned(kernel.dstDataPtr(), size); const Index alignedEnd = alignedStart + numext::round_down(size - alignedStart, PacketSize); @@ -508,7 +506,7 @@ struct dense_assignment_loop_impl::run(kernel); copy_using_evaluator_linearvec_segment::run(kernel); } @@ -525,7 +523,7 @@ struct dense_assignment_loop_impl static constexpr int SrcAlignment = Kernel::AssignmentTraits::JointAlignment; static constexpr int DstAlignment = Kernel::AssignmentTraits::DstAlignment; - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) { const Index innerSize = kernel.innerSize(); const Index outerSize = kernel.outerSize(); for (Index outer = 0; outer < outerSize; ++outer) @@ -563,7 +561,7 @@ struct dense_assignment_loop_impl struct dense_assignment_loop_impl { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) { const Index size = kernel.size(); for (Index i = 0; i < size; ++i) kernel.assignCoeff(i); } @@ -571,7 +569,7 @@ struct dense_assignment_loop_impl { template struct dense_assignment_loop_impl { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) { copy_using_evaluator_LinearTraversal_CompleteUnrolling::run( kernel); } @@ -598,7 +596,7 @@ struct dense_assignment_loop_impl using head_loop = unaligned_dense_assignment_loop; using tail_loop = unaligned_dense_assignment_loop; - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) { const Scalar* dst_ptr = kernel.dstDataPtr(); const Index innerSize = kernel.innerSize(); const Index outerSize = kernel.outerSize(); @@ -634,7 +632,7 @@ struct dense_assignment_loop_impl; - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel) { + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel) { for (Index outer = 0; outer < kernel.outerSize(); ++outer) { packet_loop::run(kernel, outer); packet_segment_loop::run(kernel, outer); @@ -676,12 +674,12 @@ class generic_dense_assignment_kernel { #endif } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_dstExpr.size(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const EIGEN_NOEXCEPT { return m_dstExpr.innerSize(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerSize() const EIGEN_NOEXCEPT { return m_dstExpr.outerSize(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_dstExpr.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_dstExpr.cols(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT { return m_dstExpr.outerStride(); } + EIGEN_DEVICE_FUNC constexpr Index size() const EIGEN_NOEXCEPT { return m_dstExpr.size(); } + EIGEN_DEVICE_FUNC constexpr Index innerSize() const EIGEN_NOEXCEPT { return m_dstExpr.innerSize(); } + EIGEN_DEVICE_FUNC constexpr Index outerSize() const EIGEN_NOEXCEPT { return m_dstExpr.outerSize(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_dstExpr.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_dstExpr.cols(); } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_dstExpr.outerStride(); } EIGEN_DEVICE_FUNC DstEvaluatorType& dstEvaluator() EIGEN_NOEXCEPT { return m_dst; } EIGEN_DEVICE_FUNC const SrcEvaluatorType& srcEvaluator() const EIGEN_NOEXCEPT { return m_src; } @@ -811,9 +809,8 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize_if_allowed(DstXprTyp } template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_dense_assignment_loop(DstXprType& dst, - const SrcXprType& src, - const Functor& func) { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src, + const Functor& func) { typedef evaluator DstEvaluatorType; typedef evaluator SrcEvaluatorType; @@ -882,7 +879,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(const Dst& dst, const // Deal with "assume-aliasing" template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment( +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment( Dst& dst, const Src& src, const Func& func, std::enable_if_t::value, void*> = 0) { typename plain_matrix_type::type tmp(src); call_assignment_no_alias(dst, tmp, func); @@ -897,14 +894,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment( // by-pass "assume-aliasing" // When there is no aliasing, we require that 'dst' has been properly resized template class StorageBase, typename Src, typename Func> -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment(NoAlias& dst, - const Src& src, const Func& func) { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment(NoAlias& dst, const Src& src, + const Func& func) { call_assignment_no_alias(dst.expression(), src, func); } template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(Dst& dst, const Src& src, - const Func& func) { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(Dst& dst, const Src& src, + const Func& func) { enum { NeedToTranspose = ((int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) || (int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1)) && @@ -943,14 +940,13 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_restricted_packet_assignment_no_ } template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(Dst& dst, const Src& src) { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(Dst& dst, const Src& src) { call_assignment_no_alias(dst, src, internal::assign_op()); } template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias_no_transpose(Dst& dst, - const Src& src, - const Func& func) { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src, + const Func& func) { // TODO check whether this is the right place to perform these checks: EIGEN_STATIC_ASSERT_LVALUE(Dst) EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst, Src) @@ -959,8 +955,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_al Assignment::run(dst, src, func); } template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias_no_transpose(Dst& dst, - const Src& src) { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src) { call_assignment_no_alias_no_transpose(dst, src, internal::assign_op()); } diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h index ca991cad2..57b032295 100644 --- a/Eigen/src/Core/BandMatrix.h +++ b/Eigen/src/Core/BandMatrix.h @@ -200,16 +200,16 @@ class BandMatrix : public BandMatrixBase * Adding an offset to nullptr is undefined behavior, so we must avoid it. */ template - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE static Scalar* add_to_nullable_pointer(Scalar* base, - Index offset) { + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE static Scalar* add_to_nullable_pointer(Scalar* base, Index offset) { return base != nullptr ? base + offset : nullptr; } @@ -386,20 +385,20 @@ class BlockImpl_dense EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType& nestedExpression() { return m_xpr; } /** \sa MapBase::innerStride() */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index innerStride() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index innerStride() const EIGEN_NOEXCEPT { return internal::traits::HasSameStorageOrderAsXprType ? m_xpr.innerStride() : m_xpr.outerStride(); } /** \sa MapBase::outerStride() */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index outerStride() const EIGEN_NOEXCEPT { return internal::traits::HasSameStorageOrderAsXprType ? m_xpr.outerStride() : m_xpr.innerStride(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startRow() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr StorageIndex startRow() const EIGEN_NOEXCEPT { return m_startRow.value(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startCol() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr StorageIndex startCol() const EIGEN_NOEXCEPT { return m_startCol.value(); } diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index e4a74d7f0..6e42ba6c8 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h @@ -149,7 +149,7 @@ class plainobjectbase_evaluator_data { #endif eigen_internal_assert(outerStride == OuterStride); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT { return OuterStride; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index outerStride() const EIGEN_NOEXCEPT { return OuterStride; } const Scalar* data; }; @@ -1296,10 +1296,10 @@ struct mapbase_evaluator : evaluator_base { } protected: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rowStride() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowStride() const EIGEN_NOEXCEPT { return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index colStride() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colStride() const EIGEN_NOEXCEPT { return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value(); } @@ -1985,10 +1985,10 @@ struct evaluator> : evaluator_base m_index; private: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rowOffset() const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowOffset() const { return m_index.value() > 0 ? 0 : -m_index.value(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index colOffset() const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colOffset() const { return m_index.value() > 0 ? m_index.value() : 0; } }; @@ -2017,9 +2017,9 @@ class EvalToTemp : public dense_xpr_base>::type { const ArgType& arg() const { return m_arg; } - EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_arg.rows(); } + constexpr Index rows() const EIGEN_NOEXCEPT { return m_arg.rows(); } - EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_arg.cols(); } + constexpr Index cols() const EIGEN_NOEXCEPT { return m_arg.cols(); } private: const ArgType& m_arg; diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index aa79b6081..eadd05e73 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -108,12 +108,12 @@ class CwiseBinaryOp : public CwiseBinaryOpImpl>::RowsAtCompileTime == Dynamic ? m_rhs.rows() : m_lhs.rows(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT { // return the fixed size type if available to enable compile time optimizations return internal::traits>::ColsAtCompileTime == Dynamic ? m_rhs.cols() : m_lhs.cols(); diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h index 9c305c642..13a542a02 100644 --- a/Eigen/src/Core/CwiseNullaryOp.h +++ b/Eigen/src/Core/CwiseNullaryOp.h @@ -76,8 +76,8 @@ class CwiseNullaryOp : public internal::dense_xpr_base EIGEN_DEVICE_FUNC inline const Scalar* data() const { return &(this->coeffRef(0)); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const { + EIGEN_DEVICE_FUNC constexpr Index innerStride() const { return StrideType::InnerStrideAtCompileTime != 0 ? int(StrideType::InnerStrideAtCompileTime) : derived().nestedExpression().innerStride() * sizeof(typename traits::Scalar) / sizeof(Scalar); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const { + EIGEN_DEVICE_FUNC constexpr Index outerStride() const { return StrideType::OuterStrideAtCompileTime != 0 ? int(StrideType::OuterStrideAtCompileTime) : derived().nestedExpression().outerStride() * sizeof(typename traits::Scalar) / sizeof(Scalar); @@ -145,8 +145,8 @@ class CwiseUnaryView : public internal::CwiseUnaryViewImplrows() : this->cols(); } @@ -217,7 +217,7 @@ class DenseBase * \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a * column-major matrix, and the number of columns for a row-major matrix. */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const { + EIGEN_DEVICE_FUNC constexpr Index innerSize() const { return IsVectorAtCompileTime ? this->size() : int(IsRowMajor) ? this->cols() : this->rows(); } diff --git a/Eigen/src/Core/DenseCoeffsBase.h b/Eigen/src/Core/DenseCoeffsBase.h index 97f9b50f3..576a5c68b 100644 --- a/Eigen/src/Core/DenseCoeffsBase.h +++ b/Eigen/src/Core/DenseCoeffsBase.h @@ -89,13 +89,12 @@ class DenseCoeffsBase : public EigenBase { * * \sa operator()(Index,Index) const, coeffRef(Index,Index), coeff(Index) const */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeff(Index row, Index col) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeff(Index row, Index col) const { eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); return internal::evaluator(derived()).coeff(row, col); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeffByOuterInner(Index outer, - Index inner) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeffByOuterInner(Index outer, Index inner) const { return coeff(rowIndexByOuterInner(outer, inner), colIndexByOuterInner(outer, inner)); } @@ -103,7 +102,7 @@ class DenseCoeffsBase : public EigenBase { * * \sa operator()(Index,Index), operator[](Index) */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator()(Index row, Index col) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator()(Index row, Index col) const { eigen_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); return coeff(row, col); } @@ -123,7 +122,7 @@ class DenseCoeffsBase : public EigenBase { * \sa operator[](Index) const, coeffRef(Index), coeff(Index,Index) const */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType coeff(Index index) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeff(Index index) const { EIGEN_STATIC_ASSERT(internal::evaluator::Flags & LinearAccessBit, THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) eigen_internal_assert(index >= 0 && index < size()); @@ -138,7 +137,7 @@ class DenseCoeffsBase : public EigenBase { * z() const, w() const */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator[](Index index) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator[](Index index) const { EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime, THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD) eigen_assert(index >= 0 && index < size()); @@ -155,32 +154,32 @@ class DenseCoeffsBase : public EigenBase { * z() const, w() const */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType operator()(Index index) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator()(Index index) const { eigen_assert(index >= 0 && index < size()); return coeff(index); } /** equivalent to operator[](0). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType x() const { return (*this)[0]; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType x() const { return (*this)[0]; } /** equivalent to operator[](1). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType y() const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType y() const { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS); return (*this)[1]; } /** equivalent to operator[](2). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType z() const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType z() const { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS); return (*this)[2]; } /** equivalent to operator[](3). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR CoeffReturnType w() const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType w() const { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS); return (*this)[3]; } @@ -362,32 +361,32 @@ class DenseCoeffsBase : public DenseCoeffsBase= 0 && index < size()); return coeffRef(index); } /** equivalent to operator[](0). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& x() { return (*this)[0]; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& x() { return (*this)[0]; } /** equivalent to operator[](1). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& y() { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& y() { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS); return (*this)[1]; } /** equivalent to operator[](2). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& z() { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& z() { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS); return (*this)[2]; } /** equivalent to operator[](3). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Scalar& w() { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& w() { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS); return (*this)[3]; } @@ -421,33 +420,29 @@ class DenseCoeffsBase : public DenseCoeffsBase : public DenseCoeffsBase : public DenseCoeffsBase : public DenseCoeffsBase struct first_aligned_impl { - static EIGEN_CONSTEXPR inline Index run(const Derived&) EIGEN_NOEXCEPT { return 0; } + static constexpr Index run(const Derived&) EIGEN_NOEXCEPT { return 0; } }; template diff --git a/Eigen/src/Core/DeviceWrapper.h b/Eigen/src/Core/DeviceWrapper.h index 75fc8e71a..012dce10d 100644 --- a/Eigen/src/Core/DeviceWrapper.h +++ b/Eigen/src/Core/DeviceWrapper.h @@ -87,13 +87,13 @@ template struct dense_assignment_loop_with_device { using Base = dense_assignment_loop; - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel& kernel, Device&) { Base::run(kernel); } + static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Device&) { Base::run(kernel); } }; // entry point for a generic expression with device template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(DeviceWrapper dst, - const Src& src, const Func& func) { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(DeviceWrapper dst, + const Src& src, const Func& func) { enum { NeedToTranspose = ((int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) || (int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1)) && @@ -115,10 +115,8 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_al // copy and pasted from AssignEvaluator except forward device to kernel template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_dense_assignment_loop(DstXprType& dst, - const SrcXprType& src, - const Functor& func, - Device& device) { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src, + const Functor& func, Device& device) { using DstEvaluatorType = evaluator; using SrcEvaluatorType = evaluator; diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index 8d27857e0..8dd6f95d2 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -83,13 +83,11 @@ class Diagonal : public internal::dense_xpr_base(m_matrix.rows(), m_matrix.cols() - m_index.value()); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return 1; } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return 1; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { - return m_matrix.outerStride() + 1; - } + EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_matrix.outerStride() + 1; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return 0; } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return 0; } typedef std::conditional_t::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue; @@ -134,13 +132,13 @@ class Diagonal : public internal::dense_xpr_base 0 ? m_index.value() : -m_index.value(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rowOffset() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowOffset() const EIGEN_NOEXCEPT { return m_index.value() > 0 ? 0 : -m_index.value(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index colOffset() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colOffset() const EIGEN_NOEXCEPT { return m_index.value() > 0 ? m_index.value() : 0; } // trigger a compile-time error if someone try to call packet diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index 4115b64fe..52630d929 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -76,9 +76,9 @@ class DiagonalBase : public EigenBase { } /** \returns the number of rows. */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const { return diagonal().size(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return diagonal().size(); } /** \returns the number of columns. */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const { return diagonal().size(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return diagonal().size(); } /** \returns the diagonal matrix product of \c *this by the dense matrix, \a matrix */ template diff --git a/Eigen/src/Core/EigenBase.h b/Eigen/src/Core/EigenBase.h index 894bfc13b..9fe8d72f0 100644 --- a/Eigen/src/Core/EigenBase.h +++ b/Eigen/src/Core/EigenBase.h @@ -56,12 +56,12 @@ struct EigenBase { EIGEN_DEVICE_FUNC inline const Derived& const_derived() const { return *static_cast(this); } /** \returns the number of rows. \sa cols(), RowsAtCompileTime */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return derived().rows(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return derived().rows(); } /** \returns the number of columns. \sa rows(), ColsAtCompileTime*/ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return derived().cols(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return derived().cols(); } /** \returns the number of coefficients, which is rows()*cols(). * \sa rows(), cols(), SizeAtCompileTime. */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index size() const EIGEN_NOEXCEPT { return rows() * cols(); } + EIGEN_DEVICE_FUNC constexpr Index size() const EIGEN_NOEXCEPT { return rows() * cols(); } /** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */ template diff --git a/Eigen/src/Core/ForceAlignedAccess.h b/Eigen/src/Core/ForceAlignedAccess.h index a91b0da6a..4085b5fcc 100644 --- a/Eigen/src/Core/ForceAlignedAccess.h +++ b/Eigen/src/Core/ForceAlignedAccess.h @@ -41,14 +41,10 @@ class ForceAlignedAccess : public internal::dense_xpr_base struct bit_and { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a & b; } + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a & b; } }; template struct bit_or { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a | b; } + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a | b; } }; template struct bit_xor { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a ^ b; } + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a ^ b; } }; template struct bit_not { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a) const { return ~a; } + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE T operator()(const T& a) const { return ~a; } }; template <> struct bit_and { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { - return a && b; - } + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { return a && b; } }; template <> struct bit_or { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { - return a || b; - } + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { return a || b; } }; template <> struct bit_xor { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { - return a != b; - } + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const { return a != b; } }; template <> struct bit_not { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a) const { return !a; } + EIGEN_DEVICE_FUNC constexpr EIGEN_ALWAYS_INLINE bool operator()(const bool& a) const { return !a; } }; // Use operators &, |, ^, ~. diff --git a/Eigen/src/Core/IndexedView.h b/Eigen/src/Core/IndexedView.h index 454e560e4..5d4799324 100644 --- a/Eigen/src/Core/IndexedView.h +++ b/Eigen/src/Core/IndexedView.h @@ -225,14 +225,14 @@ class IndexedViewImpl return this->nestedExpression().data() + row_offset + col_offset; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { if (traits::InnerStrideAtCompileTime != Dynamic) { return traits::InnerStrideAtCompileTime; } return innerIncrement() * this->nestedExpression().innerStride(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { if (traits::OuterStrideAtCompileTime != Dynamic) { return traits::OuterStrideAtCompileTime; } diff --git a/Eigen/src/Core/Inverse.h b/Eigen/src/Core/Inverse.h index 013ad0a94..d64abd957 100644 --- a/Eigen/src/Core/Inverse.h +++ b/Eigen/src/Core/Inverse.h @@ -51,8 +51,8 @@ class Inverse : public InverseImpl:: explicit EIGEN_DEVICE_FUNC Inverse(const XprType& xpr) : m_xpr(xpr) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_xpr.cols(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_xpr.rows(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_xpr.cols(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_xpr.rows(); } EIGEN_DEVICE_FUNC const XprTypeNestedCleaned& nestedExpression() const { return m_xpr; } diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index df7b7ca77..c740da726 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -102,11 +102,11 @@ class Map : public MapBase > { typedef PointerType PointerArgType; EIGEN_DEVICE_FUNC inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const { + EIGEN_DEVICE_FUNC constexpr Index innerStride() const { return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const { + EIGEN_DEVICE_FUNC constexpr Index outerStride() const { return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer() : internal::traits::OuterStrideAtCompileTime != Dynamic ? Index(internal::traits::OuterStrideAtCompileTime) diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index 1e83fdf70..e54aa3634 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -84,9 +84,9 @@ class MapBase : public internal::dense_xpr_base struct imag_ref_default_impl { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Scalar run(Scalar&) { return Scalar(0); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline const Scalar run(const Scalar&) { return Scalar(0); } + EIGEN_DEVICE_FUNC constexpr static Scalar run(Scalar&) { return Scalar(0); } + EIGEN_DEVICE_FUNC constexpr static const Scalar run(const Scalar&) { return Scalar(0); } }; template @@ -1297,7 +1297,7 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE double trunc(const double& x) { // Integer division with rounding up. // T is assumed to be an integer type with a>=0, and b>0 template -EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T div_ceil(T a, T b) { +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE constexpr T div_ceil(T a, T b) { using UnsignedT = typename internal::make_unsigned::type; EIGEN_STATIC_ASSERT((NumTraits::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES) // Note: explicitly declaring a and b as non-negative values allows the compiler to use better optimizations @@ -1310,7 +1310,7 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T div_ceil(T a, T b) { // Integer round down to nearest power of b // T is assumed to be an integer type with a>=0, and b>0 template -EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T round_down(T a, U b) { +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE constexpr T round_down(T a, U b) { using UnsignedT = typename internal::make_unsigned::type; using UnsignedU = typename internal::make_unsigned::type; EIGEN_STATIC_ASSERT((NumTraits::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES) @@ -1323,7 +1323,7 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T round_down(T a, U b) { /** Log base 2 for 32 bits positive integers. * Conveniently returns 0 for x==0. */ -EIGEN_CONSTEXPR inline int log2(int x) { +constexpr int log2(int x) { unsigned int v(x); constexpr int table[32] = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31}; diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 67590fbd7..b65e9150c 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -393,8 +393,8 @@ class Matrix : public PlainObjectBase EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const EigenBase& other) : Base(other.derived()) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { return 1; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); } + EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return 1; } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return this->innerSize(); } /////////// Geometry module /////////// diff --git a/Eigen/src/Core/NestByValue.h b/Eigen/src/Core/NestByValue.h index ec360ebde..6be4b15b7 100644 --- a/Eigen/src/Core/NestByValue.h +++ b/Eigen/src/Core/NestByValue.h @@ -45,8 +45,8 @@ class NestByValue : public internal::dense_xpr_base EIGEN_DEVICE_FUNC explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; } diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h index 1dc344877..5e4e5c2ff 100644 --- a/Eigen/src/Core/NumTraits.h +++ b/Eigen/src/Core/NumTraits.h @@ -22,13 +22,13 @@ namespace internal { template ::is_specialized, bool is_integer = NumTraits::IsInteger> struct default_digits_impl { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return std::numeric_limits::digits; } + EIGEN_DEVICE_FUNC constexpr static int run() { return std::numeric_limits::digits; } }; template struct default_digits_impl // Floating point { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { + EIGEN_DEVICE_FUNC constexpr static int run() { using std::ceil; using std::log2; typedef typename NumTraits::Real Real; @@ -39,7 +39,7 @@ struct default_digits_impl // Floating point template struct default_digits_impl // Integer { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return 0; } + EIGEN_DEVICE_FUNC constexpr static int run() { return 0; } }; // default implementation of digits10(), based on numeric_limits if specialized, @@ -47,13 +47,13 @@ struct default_digits_impl // Integer template ::is_specialized, bool is_integer = NumTraits::IsInteger> struct default_digits10_impl { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return std::numeric_limits::digits10; } + EIGEN_DEVICE_FUNC constexpr static int run() { return std::numeric_limits::digits10; } }; template struct default_digits10_impl // Floating point { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { + EIGEN_DEVICE_FUNC constexpr static int run() { using std::floor; using std::log10; typedef typename NumTraits::Real Real; @@ -64,7 +64,7 @@ struct default_digits10_impl // Floating point template struct default_digits10_impl // Integer { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return 0; } + EIGEN_DEVICE_FUNC constexpr static int run() { return 0; } }; // default implementation of max_digits10(), based on numeric_limits if specialized, @@ -72,13 +72,13 @@ struct default_digits10_impl // Integer template ::is_specialized, bool is_integer = NumTraits::IsInteger> struct default_max_digits10_impl { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return std::numeric_limits::max_digits10; } + EIGEN_DEVICE_FUNC constexpr static int run() { return std::numeric_limits::max_digits10; } }; template struct default_max_digits10_impl // Floating point { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { + EIGEN_DEVICE_FUNC constexpr static int run() { using std::ceil; using std::log10; typedef typename NumTraits::Real Real; @@ -89,7 +89,7 @@ struct default_max_digits10_impl // Floating point template struct default_max_digits10_impl // Integer { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static int run() { return 0; } + EIGEN_DEVICE_FUNC constexpr static int run() { return 0; } }; } // end namespace internal @@ -188,32 +188,30 @@ struct GenericNumTraits { typedef T Nested; typedef T Literal; - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Real epsilon() { return numext::numeric_limits::epsilon(); } + EIGEN_DEVICE_FUNC constexpr static Real epsilon() { return numext::numeric_limits::epsilon(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int digits10() { return internal::default_digits10_impl::run(); } + EIGEN_DEVICE_FUNC constexpr static int digits10() { return internal::default_digits10_impl::run(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int max_digits10() { - return internal::default_max_digits10_impl::run(); - } + EIGEN_DEVICE_FUNC constexpr static int max_digits10() { return internal::default_max_digits10_impl::run(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int digits() { return internal::default_digits_impl::run(); } + EIGEN_DEVICE_FUNC constexpr static int digits() { return internal::default_digits_impl::run(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int min_exponent() { return numext::numeric_limits::min_exponent; } + EIGEN_DEVICE_FUNC constexpr static int min_exponent() { return numext::numeric_limits::min_exponent; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int max_exponent() { return numext::numeric_limits::max_exponent; } + EIGEN_DEVICE_FUNC constexpr static int max_exponent() { return numext::numeric_limits::max_exponent; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Real dummy_precision() { + EIGEN_DEVICE_FUNC constexpr static Real dummy_precision() { // make sure to override this for floating-point types return Real(0); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline T highest() { return (numext::numeric_limits::max)(); } + EIGEN_DEVICE_FUNC constexpr static T highest() { return (numext::numeric_limits::max)(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline T lowest() { return (numext::numeric_limits::lowest)(); } + EIGEN_DEVICE_FUNC constexpr static T lowest() { return (numext::numeric_limits::lowest)(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline T infinity() { return numext::numeric_limits::infinity(); } + EIGEN_DEVICE_FUNC constexpr static T infinity() { return numext::numeric_limits::infinity(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline T quiet_NaN() { return numext::numeric_limits::quiet_NaN(); } + EIGEN_DEVICE_FUNC constexpr static T quiet_NaN() { return numext::numeric_limits::quiet_NaN(); } }; template @@ -221,25 +219,23 @@ struct NumTraits : GenericNumTraits {}; template <> struct NumTraits : GenericNumTraits { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline float dummy_precision() { return 1e-5f; } + EIGEN_DEVICE_FUNC constexpr static float dummy_precision() { return 1e-5f; } }; template <> struct NumTraits : GenericNumTraits { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline double dummy_precision() { return 1e-12; } + EIGEN_DEVICE_FUNC constexpr static double dummy_precision() { return 1e-12; } }; // GPU devices treat `long double` as `double`. #ifndef EIGEN_GPU_COMPILE_PHASE template <> struct NumTraits : GenericNumTraits { - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline long double dummy_precision() { - return static_cast(1e-15l); - } + EIGEN_DEVICE_FUNC constexpr static long double dummy_precision() { return static_cast(1e-15l); } #if defined(EIGEN_ARCH_PPC) && (__LDBL_MANT_DIG__ == 106) // PowerPC double double causes issues with some values - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline long double epsilon() { + EIGEN_DEVICE_FUNC constexpr static long double epsilon() { // 2^(-(__LDBL_MANT_DIG__)+1) return static_cast(2.4651903288156618919116517665087e-32l); } @@ -260,10 +256,10 @@ struct NumTraits > : GenericNumTraits > MulCost = 4 * NumTraits::MulCost + 2 * NumTraits::AddCost }; - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Real epsilon() { return NumTraits::epsilon(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline Real dummy_precision() { return NumTraits::dummy_precision(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int digits10() { return NumTraits::digits10(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline int max_digits10() { return NumTraits::max_digits10(); } + EIGEN_DEVICE_FUNC constexpr static Real epsilon() { return NumTraits::epsilon(); } + EIGEN_DEVICE_FUNC constexpr static Real dummy_precision() { return NumTraits::dummy_precision(); } + EIGEN_DEVICE_FUNC constexpr static int digits10() { return NumTraits::digits10(); } + EIGEN_DEVICE_FUNC constexpr static int max_digits10() { return NumTraits::max_digits10(); } }; template @@ -290,25 +286,19 @@ struct NumTraits > { : ArrayType::SizeAtCompileTime * int(NumTraits::MulCost) }; - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline RealScalar epsilon() { return NumTraits::epsilon(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static inline RealScalar dummy_precision() { - return NumTraits::dummy_precision(); - } + EIGEN_DEVICE_FUNC constexpr static RealScalar epsilon() { return NumTraits::epsilon(); } + EIGEN_DEVICE_FUNC constexpr static RealScalar dummy_precision() { return NumTraits::dummy_precision(); } - EIGEN_CONSTEXPR - static inline int digits10() { return NumTraits::digits10(); } - EIGEN_CONSTEXPR - static inline int max_digits10() { return NumTraits::max_digits10(); } + constexpr static int digits10() { return NumTraits::digits10(); } + constexpr static int max_digits10() { return NumTraits::max_digits10(); } }; template <> struct NumTraits : GenericNumTraits { enum { RequireInitialization = 1, ReadCost = HugeCost, AddCost = HugeCost, MulCost = HugeCost }; - EIGEN_CONSTEXPR - static inline int digits10() { return 0; } - EIGEN_CONSTEXPR - static inline int max_digits10() { return 0; } + constexpr static int digits10() { return 0; } + constexpr static int max_digits10() { return 0; } private: static inline std::string epsilon(); diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h index eca7e1fa1..989f7e065 100644 --- a/Eigen/src/Core/PlainObjectBase.h +++ b/Eigen/src/Core/PlainObjectBase.h @@ -162,8 +162,8 @@ class PlainObjectBase : public internal::dense_xpr_base::type { EIGEN_DEVICE_FUNC Base& base() { return *static_cast(this); } EIGEN_DEVICE_FUNC const Base& base() const { return *static_cast(this); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_storage.rows(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_storage.cols(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const EIGEN_NOEXCEPT { return m_storage.rows(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT { return m_storage.cols(); } /** This is an overloaded version of DenseCoeffsBase::coeff(Index,Index) const * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. @@ -298,7 +298,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type { * * \sa resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t) */ - EIGEN_DEVICE_FUNC inline constexpr void resize(Index size) { + EIGEN_DEVICE_FUNC constexpr void resize(Index size) { EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase) eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime == Dynamic || size <= MaxSizeAtCompileTime)) || SizeAtCompileTime == size) && @@ -323,7 +323,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type { * * \sa resize(Index,Index) */ - EIGEN_DEVICE_FUNC inline constexpr void resize(NoChange_t, Index cols) { resize(rows(), cols); } + EIGEN_DEVICE_FUNC constexpr void resize(NoChange_t, Index cols) { resize(rows(), cols); } /** Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special * value \c NoChange as in the example below. @@ -333,7 +333,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type { * * \sa resize(Index,Index) */ - EIGEN_DEVICE_FUNC inline constexpr void resize(Index rows, NoChange_t) { resize(rows, cols()); } + EIGEN_DEVICE_FUNC constexpr void resize(Index rows, NoChange_t) { resize(rows, cols()); } /** Resizes \c *this to have the same dimensions as \a other. * Takes care of doing all the checking that's needed. diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index 37683e3c2..c25b9bd83 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -224,8 +224,8 @@ class Product "if you wanted a coeff-wise or a dot product use the respective explicit functions"); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const LhsNestedCleaned& lhs() const { return m_lhs; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const RhsNestedCleaned& rhs() const { return m_rhs; } diff --git a/Eigen/src/Core/RandomImpl.h b/Eigen/src/Core/RandomImpl.h index 76e43f5dc..efba33680 100644 --- a/Eigen/src/Core/RandomImpl.h +++ b/Eigen/src/Core/RandomImpl.h @@ -122,7 +122,7 @@ template ::digits != (2 * std::numeric_limits::digits)))> struct random_longdouble_impl { static constexpr int Size = sizeof(long double); - static constexpr EIGEN_DEVICE_FUNC inline int mantissaBits() { return NumTraits::digits() - 1; } + static constexpr EIGEN_DEVICE_FUNC int mantissaBits() { return NumTraits::digits() - 1; } static EIGEN_DEVICE_FUNC inline long double run(int numRandomBits) { eigen_assert(numRandomBits >= 0 && numRandomBits <= mantissaBits()); EIGEN_USING_STD(memcpy); @@ -140,7 +140,7 @@ struct random_longdouble_impl { }; template <> struct random_longdouble_impl { - static constexpr EIGEN_DEVICE_FUNC inline int mantissaBits() { return NumTraits::digits() - 1; } + static constexpr EIGEN_DEVICE_FUNC int mantissaBits() { return NumTraits::digits() - 1; } static EIGEN_DEVICE_FUNC inline long double run(int numRandomBits) { return static_cast(random_float_impl::run(numRandomBits)); } diff --git a/Eigen/src/Core/Ref.h b/Eigen/src/Core/Ref.h index 129bc85f4..30ec277d0 100644 --- a/Eigen/src/Core/Ref.h +++ b/Eigen/src/Core/Ref.h @@ -73,11 +73,11 @@ class RefBase : public MapBase { typedef MapBase Base; EIGEN_DENSE_PUBLIC_INTERFACE(RefBase) - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const { + EIGEN_DEVICE_FUNC constexpr Index innerStride() const { return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const { + EIGEN_DEVICE_FUNC constexpr Index outerStride() const { return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer() : IsVectorAtCompileTime ? this->size() : int(Flags) & RowMajorBit ? this->cols() @@ -97,11 +97,11 @@ class RefBase : public MapBase { typedef Stride StrideBase; // Resolves inner stride if default 0. - static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index resolveInnerStride(Index inner) { return inner == 0 ? 1 : inner; } + static EIGEN_DEVICE_FUNC constexpr Index resolveInnerStride(Index inner) { return inner == 0 ? 1 : inner; } // Resolves outer stride if default 0. - static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index resolveOuterStride(Index inner, Index outer, Index rows, Index cols, - bool isVectorAtCompileTime, bool isRowMajor) { + static EIGEN_DEVICE_FUNC constexpr Index resolveOuterStride(Index inner, Index outer, Index rows, Index cols, + bool isVectorAtCompileTime, bool isRowMajor) { return outer == 0 ? isVectorAtCompileTime ? inner * rows * cols : isRowMajor ? inner * cols : inner * rows : outer; } diff --git a/Eigen/src/Core/Replicate.h b/Eigen/src/Core/Replicate.h index 11d7ad19e..341504522 100644 --- a/Eigen/src/Core/Replicate.h +++ b/Eigen/src/Core/Replicate.h @@ -85,8 +85,8 @@ class Replicate : public internal::dense_xpr_base : public MapBasecols() : this->rows()) * m_xpr.innerStride(); } diff --git a/Eigen/src/Core/ReturnByValue.h b/Eigen/src/Core/ReturnByValue.h index 3b5e470ce..6ce383215 100644 --- a/Eigen/src/Core/ReturnByValue.h +++ b/Eigen/src/Core/ReturnByValue.h @@ -58,12 +58,8 @@ class ReturnByValue : public internal::dense_xpr_base >:: EIGEN_DEVICE_FUNC inline void evalTo(Dest& dst) const { static_cast(this)->evalTo(dst); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { - return static_cast(this)->rows(); - } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { - return static_cast(this)->cols(); - } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return static_cast(this)->rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return static_cast(this)->cols(); } #ifndef EIGEN_PARSED_BY_DOXYGEN #define Unusable \ diff --git a/Eigen/src/Core/Reverse.h b/Eigen/src/Core/Reverse.h index eb06fff57..2f1d1f62e 100644 --- a/Eigen/src/Core/Reverse.h +++ b/Eigen/src/Core/Reverse.h @@ -87,8 +87,8 @@ class Reverse : public internal::dense_xpr_base > EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Reverse) - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } EIGEN_DEVICE_FUNC inline Index innerStride() const { return -m_matrix.innerStride(); } diff --git a/Eigen/src/Core/Select.h b/Eigen/src/Core/Select.h index 9f4612047..59adae74c 100644 --- a/Eigen/src/Core/Select.h +++ b/Eigen/src/Core/Select.h @@ -63,8 +63,8 @@ class Select : public internal::dense_xpr_base EIGEN_DEVICE_FUNC explicit inline SelfAdjointView(MatrixType& matrix) : m_matrix(matrix) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return m_matrix.outerStride(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { return m_matrix.innerStride(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return m_matrix.outerStride(); } + EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return m_matrix.innerStride(); } /** \sa MatrixBase::coeff() * \warning the coordinates must fit into the referenced triangular part diff --git a/Eigen/src/Core/SkewSymmetricMatrix3.h b/Eigen/src/Core/SkewSymmetricMatrix3.h index 1945fd306..3545afc76 100644 --- a/Eigen/src/Core/SkewSymmetricMatrix3.h +++ b/Eigen/src/Core/SkewSymmetricMatrix3.h @@ -66,7 +66,7 @@ class SkewSymmetricBase : public EigenBase { EIGEN_DEVICE_FUNC DenseMatrixType toDenseMatrix() const { return derived(); } /** Determinant vanishes */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar determinant() const { return 0; } + EIGEN_DEVICE_FUNC constexpr Scalar determinant() const { return 0; } /** A.transpose() = -A */ EIGEN_DEVICE_FUNC PlainObject transpose() const { return (-vector()).asSkewSymmetric(); } @@ -91,9 +91,9 @@ class SkewSymmetricBase : public EigenBase { EIGEN_DEVICE_FUNC inline SkewSymmetricVectorType& vector() { return derived().vector(); } /** \returns the number of rows. */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const { return 3; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return 3; } /** \returns the number of columns. */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const { return 3; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return 3; } /** \returns the matrix product of \c *this by the dense matrix, \a matrix */ template diff --git a/Eigen/src/Core/Solve.h b/Eigen/src/Core/Solve.h index dfea9c6fb..e6bc8421e 100644 --- a/Eigen/src/Core/Solve.h +++ b/Eigen/src/Core/Solve.h @@ -66,8 +66,8 @@ class Solve : public SolveImpl inline void evalTo(Dest& dst) const { diff --git a/Eigen/src/Core/Stride.h b/Eigen/src/Core/Stride.h index 14b025c46..692f0a1ca 100644 --- a/Eigen/src/Core/Stride.h +++ b/Eigen/src/Core/Stride.h @@ -78,9 +78,9 @@ class Stride { } /** \returns the outer stride */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outer() const { return m_outer.value(); } + EIGEN_DEVICE_FUNC constexpr Index outer() const { return m_outer.value(); } /** \returns the inner stride */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index inner() const { return m_inner.value(); } + EIGEN_DEVICE_FUNC constexpr Index inner() const { return m_inner.value(); } protected: internal::variable_if_dynamic m_outer; diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index 89e3d95fd..faa71a14a 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -65,8 +65,8 @@ class Transpose : public TransposeImpl& nestedExpression() const { diff --git a/Eigen/src/Core/Transpositions.h b/Eigen/src/Core/Transpositions.h index 6fbbbd81b..5624080ee 100644 --- a/Eigen/src/Core/Transpositions.h +++ b/Eigen/src/Core/Transpositions.h @@ -293,9 +293,9 @@ class Transpose > { public: explicit Transpose(const TranspositionType& t) : m_transpositions(t) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_transpositions.size(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_transpositions.size(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_transpositions.size(); } + EIGEN_DEVICE_FUNC constexpr Index size() const EIGEN_NOEXCEPT { return m_transpositions.size(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_transpositions.size(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_transpositions.size(); } /** \returns the \a matrix with the inverse transpositions applied to the columns. */ diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index 2b1683be9..5dcd7af79 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -58,10 +58,10 @@ class TriangularBase : public EigenBase { eigen_assert(!((int(Mode) & int(UnitDiag)) && (int(Mode) & int(ZeroDiag)))); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return derived().rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return derived().cols(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const EIGEN_NOEXCEPT { return derived().outerStride(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const EIGEN_NOEXCEPT { return derived().innerStride(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return derived().rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return derived().cols(); } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const EIGEN_NOEXCEPT { return derived().outerStride(); } + EIGEN_DEVICE_FUNC constexpr Index innerStride() const EIGEN_NOEXCEPT { return derived().innerStride(); } // dummy resize function EIGEN_DEVICE_FUNC void resize(Index rows, Index cols) { @@ -194,9 +194,9 @@ class TriangularView EIGEN_INHERIT_ASSIGNMENT_OPERATORS(TriangularView) /** \copydoc EigenBase::rows() */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } /** \copydoc EigenBase::cols() */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } /** \returns a const reference to the nested expression */ EIGEN_DEVICE_FUNC const NestedExpression& nestedExpression() const { return m_matrix; } diff --git a/Eigen/src/Core/VectorwiseOp.h b/Eigen/src/Core/VectorwiseOp.h index b861b233c..3c5c414c3 100644 --- a/Eigen/src/Core/VectorwiseOp.h +++ b/Eigen/src/Core/VectorwiseOp.h @@ -64,10 +64,10 @@ class PartialReduxExpr : public internal::dense_xpr_base struct short_circuit_eval_impl { // if short circuit evaluation is not used, do nothing - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Visitor&) { return false; } + static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Visitor&) { return false; } }; template struct short_circuit_eval_impl { // if short circuit evaluation is used, check the visitor - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Visitor& visitor) { - return visitor.done(); - } + static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool run(const Visitor& visitor) { return visitor.done(); } }; // unrolled inner-outer traversal @@ -296,9 +294,9 @@ class visitor_evaluator { EIGEN_DEVICE_FUNC explicit visitor_evaluator(const XprType& xpr) : m_evaluator(xpr), m_xpr(xpr) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_xpr.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_xpr.cols(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_xpr.size(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_xpr.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_xpr.cols(); } + EIGEN_DEVICE_FUNC constexpr Index size() const EIGEN_NOEXCEPT { return m_xpr.size(); } // outer-inner access EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const { return m_evaluator.coeff(row, col); diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index eaa20ac7c..56744aa93 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -187,7 +187,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Packet pfrexp_generic(const Packet& a, Pac static constexpr int TotalBits = sizeof(Scalar) * CHAR_BIT, MantissaBits = numext::numeric_limits::digits - 1, ExponentBits = TotalBits - MantissaBits - 1; - EIGEN_CONSTEXPR ScalarUI scalar_sign_mantissa_mask = + constexpr ScalarUI scalar_sign_mantissa_mask = ~(((ScalarUI(1) << ExponentBits) - ScalarUI(1)) << MantissaBits); // ~0x7f800000 const Packet sign_mantissa_mask = pset1frombits(static_cast(scalar_sign_mantissa_mask)); const Packet half = pset1(Scalar(0.5)); @@ -196,7 +196,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Packet pfrexp_generic(const Packet& a, Pac // To handle denormals, normalize by multiplying by 2^(int(MantissaBits)+1). const Packet is_denormal = pcmp_lt(pabs(a), normal_min); - EIGEN_CONSTEXPR ScalarUI scalar_normalization_offset = ScalarUI(MantissaBits + 1); // 24 + constexpr ScalarUI scalar_normalization_offset = ScalarUI(MantissaBits + 1); // 24 // The following cannot be constexpr because bfloat16(uint16_t) is not constexpr. const Scalar scalar_normalization_factor = Scalar(ScalarUI(1) << int(scalar_normalization_offset)); // 2^24 const Packet normalization_factor = pset1(scalar_normalization_factor); @@ -1822,7 +1822,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet twoprod_low(const Packet& x, const template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void veltkamp_splitting(const Packet& x, Packet& x_hi, Packet& x_lo) { typedef typename unpacket_traits::type Scalar; - EIGEN_CONSTEXPR int shift = (NumTraits::digits() + 1) / 2; + constexpr int shift = (NumTraits::digits() + 1) / 2; const Scalar shift_scale = Scalar(uint64_t(1) << shift); // Scalar constructor not necessarily constexpr. const Packet gamma = pmul(pset1(shift_scale + Scalar(1)), x); Packet rho = psub(x, gamma); @@ -2128,7 +2128,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet generic_pow_impl(const Packet& x, c Packet m_x = pfrexp(x, e_x); // Adjust m_x to lie in [1/sqrt(2):sqrt(2)] to minimize absolute error in log2(m_x). - EIGEN_CONSTEXPR Scalar sqrt_half = Scalar(0.70710678118654752440); + constexpr Scalar sqrt_half = Scalar(0.70710678118654752440); const Packet m_x_scale_mask = pcmp_lt(m_x, pset1(sqrt_half)); m_x = pselect(m_x_scale_mask, pmul(pset1(Scalar(2)), m_x), m_x); e_x = pselect(m_x_scale_mask, psub(e_x, pset1(Scalar(1))), e_x); @@ -2211,7 +2211,7 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet generic_pow(const Pac const Packet y_is_even = pcmp_eq(pround(y_div_2), y_div_2); const Packet y_is_odd_int = pandnot(y_is_int, y_is_even); // Smallest exponent for which (1 + epsilon) overflows to infinity. - EIGEN_CONSTEXPR Scalar huge_exponent = + constexpr Scalar huge_exponent = (NumTraits::max_exponent() * Scalar(EIGEN_LN2)) / NumTraits::epsilon(); const Packet y_abs_is_huge = pcmp_le(pset1(huge_exponent), y_abs); diff --git a/Eigen/src/Core/arch/GPU/Tuple.h b/Eigen/src/Core/arch/GPU/Tuple.h index 6bea9ac24..891fe4ebf 100644 --- a/Eigen/src/Core/arch/GPU/Tuple.h +++ b/Eigen/src/Core/arch/GPU/Tuple.h @@ -34,7 +34,7 @@ class TupleImpl { template ::value && reduce_all::value...>::value>> - EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC TupleImpl() : head_{}, tail_{} {} + constexpr EIGEN_DEVICE_FUNC TupleImpl() : head_{}, tail_{} {} // Element constructor. template { sizeof...(Us) == sizeof...(Ts) && ( // this does not look like a copy/move constructor. N > 1 || std::is_convertible::value)>> - EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC TupleImpl(U1&& arg1, Us&&... args) + constexpr EIGEN_DEVICE_FUNC TupleImpl(U1&& arg1, Us&&... args) : head_(std::forward(arg1)), tail_(std::forward(args)...) {} // The first stored value. @@ -102,11 +102,11 @@ struct tuple_get_impl { using TupleType = TupleImpl; using ReturnType = typename tuple_get_impl::ReturnType; - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ReturnType& run(TupleType& tuple) { + static constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE ReturnType& run(TupleType& tuple) { return tuple_get_impl::run(tuple.tail()); } - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const ReturnType& run(const TupleType& tuple) { + static constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const ReturnType& run(const TupleType& tuple) { return tuple_get_impl::run(tuple.tail()); } }; @@ -117,11 +117,9 @@ struct tuple_get_impl<0, T1, Ts...> { using TupleType = TupleImpl; using ReturnType = T1; - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T1& run(TupleType& tuple) { return tuple.head(); } + static constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T1& run(TupleType& tuple) { return tuple.head(); } - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const T1& run(const TupleType& tuple) { - return tuple.head(); - } + static constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const T1& run(const TupleType& tuple) { return tuple.head(); } }; // Concatenates N Tuples. @@ -139,11 +137,9 @@ struct tuple_cat_impl, TupleImpl, // Uses the index sequences to extract and merge elements from tuple1 and tuple2, // then recursively calls again. template - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1, - std::index_sequence, - Tuple2&& tuple2, - std::index_sequence, - MoreTuples&&... tuples) { + static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1, std::index_sequence, + Tuple2&& tuple2, std::index_sequence, + MoreTuples&&... tuples) { return tuple_cat_impl::run( MergedTupleType(tuple_get_impl::run(std::forward(tuple1))..., tuple_get_impl::run(std::forward(tuple2))...), @@ -152,8 +148,8 @@ struct tuple_cat_impl, TupleImpl, // Concatenates the first two tuples. template - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1, Tuple2&& tuple2, - MoreTuples&&... tuples) { + static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1, Tuple2&& tuple2, + MoreTuples&&... tuples) { return run(std::forward(tuple1), std::make_index_sequence{}, std::forward(tuple2), std::make_index_sequence{}, std::forward(tuples)...); } @@ -165,7 +161,7 @@ struct tuple_cat_impl<1, TupleImpl> { using ReturnType = TupleImpl; template - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1) { + static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1) { return tuple1; } }; @@ -174,7 +170,7 @@ struct tuple_cat_impl<1, TupleImpl> { template <> struct tuple_cat_impl<0> { using ReturnType = TupleImpl<0>; - static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run() { return ReturnType{}; } + static constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run() { return ReturnType{}; } }; // For use in make_tuple, unwraps a reference_wrapper. @@ -211,13 +207,13 @@ struct tuple_size> : std::integral_constan * \return a reference to the desired element. */ template -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename tuple_get_impl::ReturnType& get( +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename tuple_get_impl::ReturnType& get( const TupleImpl& tuple) { return tuple_get_impl::run(tuple); } template -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename tuple_get_impl::ReturnType& get( +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename tuple_get_impl::ReturnType& get( TupleImpl& tuple) { return tuple_get_impl::run(tuple); } @@ -229,7 +225,7 @@ EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename tuple_get_impl::type>::value...>::value>> -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename tuple_cat_impl::type...>::ReturnType tuple_cat(Tuples&&... tuples) { return tuple_cat_impl::type...>::run(std::forward(tuples)...); @@ -239,7 +235,7 @@ EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE * Tie arguments together into a tuple. */ template > -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType tie(Args&... args) EIGEN_NOEXCEPT { +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType tie(Args&... args) EIGEN_NOEXCEPT { return ReturnType{args...}; } @@ -247,7 +243,7 @@ EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType tie(Args&... ar * Create a tuple of l-values with the supplied arguments. */ template ::type...>> -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType make_tuple(Args&&... args) { +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType make_tuple(Args&&... args) { return ReturnType{std::forward(args)...}; } @@ -255,8 +251,7 @@ EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType make_tuple(Args * Forward a set of arguments as a tuple. */ template -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TupleImpl forward_as_tuple( - Args&&... args) { +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TupleImpl forward_as_tuple(Args&&... args) { return TupleImpl(std::forward(args)...); } diff --git a/Eigen/src/Core/util/EmulateArray.h b/Eigen/src/Core/util/EmulateArray.h index f2fd10bb1..6c4c22d41 100644 --- a/Eigen/src/Core/util/EmulateArray.h +++ b/Eigen/src/Core/util/EmulateArray.h @@ -248,15 +248,15 @@ namespace internal { #endif template -constexpr inline T& array_get(std::array& a) { +constexpr T& array_get(std::array& a) { return (T&)STD_GET_ARR_HACK; } template -constexpr inline T&& array_get(std::array&& a) { +constexpr T&& array_get(std::array&& a) { return (T&&)STD_GET_ARR_HACK; } template -constexpr inline T const& array_get(std::array const& a) { +constexpr T const& array_get(std::array const& a) { return (T const&)STD_GET_ARR_HACK; } diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 531746622..ddbc898e1 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -337,7 +337,7 @@ struct array_size> { #if EIGEN_COMP_CXXVER >= 20 && defined(__cpp_lib_ssize) && __cpp_lib_ssize >= 201902L template -EIGEN_CONSTEXPR auto index_list_size(T&& x) { +constexpr auto index_list_size(T&& x) { using std::ssize; return ssize(std::forward(x)); } @@ -345,13 +345,13 @@ EIGEN_CONSTEXPR auto index_list_size(T&& x) { #else template -EIGEN_CONSTEXPR auto index_list_size(const T& x) { +constexpr auto index_list_size(const T& x) { using R = std::common_type_t>; return static_cast(x.size()); } template -EIGEN_CONSTEXPR std::ptrdiff_t index_list_size(const T (&)[N]) { +constexpr std::ptrdiff_t index_list_size(const T (&)[N]) { return N; } #endif @@ -637,21 +637,21 @@ template constexpr bool is_int_or_enum_v = std::is_enum::value || std::is_integral::value; template -inline constexpr void plain_enum_asserts(A, B) { +constexpr void plain_enum_asserts(A, B) { static_assert(is_int_or_enum_v, "Argument a must be an integer or enum"); static_assert(is_int_or_enum_v, "Argument b must be an integer or enum"); } /// \internal Gets the minimum of two values which may be integers or enums template -inline constexpr int plain_enum_min(A a, B b) { +constexpr int plain_enum_min(A a, B b) { plain_enum_asserts(a, b); return ((int)a <= (int)b) ? (int)a : (int)b; } /// \internal Gets the maximum of two values which may be integers or enums template -inline constexpr int plain_enum_max(A a, B b) { +constexpr int plain_enum_max(A a, B b) { plain_enum_asserts(a, b); return ((int)a >= (int)b) ? (int)a : (int)b; } @@ -663,7 +663,7 @@ inline constexpr int plain_enum_max(A a, B b) { * finite values is that min(3, Dynamic) should be Dynamic, since that could be anything between 0 and 3. */ template -inline constexpr int min_size_prefer_dynamic(A a, B b) { +constexpr int min_size_prefer_dynamic(A a, B b) { plain_enum_asserts(a, b); if ((int)a == 0 || (int)b == 0) return 0; if ((int)a == 1 || (int)b == 1) return 1; @@ -678,7 +678,7 @@ inline constexpr int min_size_prefer_dynamic(A a, B b) { * 0 and 3), it is not more than 3. */ template -inline constexpr int min_size_prefer_fixed(A a, B b) { +constexpr int min_size_prefer_fixed(A a, B b) { plain_enum_asserts(a, b); if ((int)a == 0 || (int)b == 0) return 0; if ((int)a == 1 || (int)b == 1) return 1; @@ -690,7 +690,7 @@ inline constexpr int min_size_prefer_fixed(A a, B b) { /// \internal see `min_size_prefer_fixed`. No need for a separate variant for MaxSizes here. template -inline constexpr int max_size_prefer_dynamic(A a, B b) { +constexpr int max_size_prefer_dynamic(A a, B b) { plain_enum_asserts(a, b); if ((int)a == Dynamic || (int)b == Dynamic) return Dynamic; return plain_enum_max(a, b); @@ -710,38 +710,38 @@ inline constexpr bool enum_eq_not_dynamic(A a, B b) { } template -inline constexpr bool enum_lt_not_dynamic(A a, B b) { +constexpr bool enum_lt_not_dynamic(A a, B b) { plain_enum_asserts(a, b); if ((int)a == Dynamic || (int)b == Dynamic) return false; return (int)a < (int)b; } template -inline constexpr bool enum_le_not_dynamic(A a, B b) { +constexpr bool enum_le_not_dynamic(A a, B b) { plain_enum_asserts(a, b); if ((int)a == Dynamic || (int)b == Dynamic) return false; return (int)a <= (int)b; } template -inline constexpr bool enum_gt_not_dynamic(A a, B b) { +constexpr bool enum_gt_not_dynamic(A a, B b) { plain_enum_asserts(a, b); if ((int)a == Dynamic || (int)b == Dynamic) return false; return (int)a > (int)b; } template -inline constexpr bool enum_ge_not_dynamic(A a, B b) { +constexpr bool enum_ge_not_dynamic(A a, B b) { plain_enum_asserts(a, b); if ((int)a == Dynamic || (int)b == Dynamic) return false; return (int)a >= (int)b; } /// \internal Calculate logical XOR at compile time -inline constexpr bool logical_xor(bool a, bool b) { return a != b; } +constexpr bool logical_xor(bool a, bool b) { return a != b; } /// \internal Calculate logical IMPLIES at compile time -inline constexpr bool check_implication(bool a, bool b) { return !a || b; } +constexpr bool check_implication(bool a, bool b) { return !a || b; } /// \internal Provide fallback for std::is_constant_evaluated for pre-C++20. #if EIGEN_COMP_CXXVER >= 20 && defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L diff --git a/Eigen/src/Core/util/ReshapedHelper.h b/Eigen/src/Core/util/ReshapedHelper.h index e56940880..17479505b 100644 --- a/Eigen/src/Core/util/ReshapedHelper.h +++ b/Eigen/src/Core/util/ReshapedHelper.h @@ -40,7 +40,7 @@ struct get_compiletime_reshape_size { inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { return total / other; } -constexpr inline int get_compiletime_reshape_order(int flags, int order) { +constexpr int get_compiletime_reshape_order(int flags, int order) { return order == AutoOrder ? flags & RowMajorBit : order; } diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index a42bb0f73..3b758f0ef 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -158,8 +158,8 @@ class variable_if_dynamic { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); } - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value() { return T(Value); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR operator T() const { return T(Value); } + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr T value() { return T(Value); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr operator T() const { return T(Value); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T v) const { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); @@ -186,7 +186,7 @@ class variable_if_dynamicindex { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); } - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value() { return T(Value); } + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr T value() { return T(Value); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {} }; @@ -315,7 +315,7 @@ struct find_packet_by_size { }; #if EIGEN_MAX_STATIC_ALIGN_BYTES > 0 -constexpr inline int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) { +constexpr int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) { if ((ArrayBytes % AlignmentBytes) == 0) { return AlignmentBytes; } else if (EIGEN_MIN_ALIGN_BYTES < AlignmentBytes) { @@ -327,7 +327,7 @@ constexpr inline int compute_default_alignment_helper(int ArrayBytes, int Alignm #else // If static alignment is disabled, no need to bother. // This also avoids a division by zero -constexpr inline int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) { +constexpr int compute_default_alignment_helper(int ArrayBytes, int AlignmentBytes) { EIGEN_UNUSED_VARIABLE(ArrayBytes); EIGEN_UNUSED_VARIABLE(AlignmentBytes); return 0; @@ -362,7 +362,7 @@ class make_proper_matrix_type { typedef Matrix type; }; -constexpr inline unsigned compute_matrix_flags(int Options) { +constexpr unsigned compute_matrix_flags(int Options) { unsigned row_major_bit = Options & RowMajor ? RowMajorBit : 0; // FIXME currently we still have to handle DirectAccessBit at the expression level to handle DenseCoeffsBase<> // and then propagate this information to the evaluator's flags. @@ -370,7 +370,7 @@ constexpr inline unsigned compute_matrix_flags(int Options) { return DirectAccessBit | LvalueBit | NestByRefBit | row_major_bit; } -constexpr inline int size_at_compile_time(int rows, int cols) { +constexpr int size_at_compile_time(int rows, int cols) { if (rows == 0 || cols == 0) return 0; if (rows == Dynamic || cols == Dynamic) return Dynamic; return rows * cols; diff --git a/Eigen/src/Eigenvalues/Tridiagonalization.h b/Eigen/src/Eigenvalues/Tridiagonalization.h index b2f07bc6d..e0680e41d 100644 --- a/Eigen/src/Eigenvalues/Tridiagonalization.h +++ b/Eigen/src/Eigenvalues/Tridiagonalization.h @@ -515,8 +515,8 @@ struct TridiagonalizationMatrixTReturnType : public ReturnByValue() = m_matrix.template diagonal<-1>(); } - EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } - EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows(); } + constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } protected: typename MatrixType::Nested m_matrix; diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h index 64c1b651a..b0a755479 100644 --- a/Eigen/src/Geometry/Homogeneous.h +++ b/Eigen/src/Geometry/Homogeneous.h @@ -69,10 +69,10 @@ class Homogeneous : public MatrixBase >, int EIGEN_DEVICE_FUNC explicit inline Homogeneous(const MatrixType& matrix) : m_matrix(matrix) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_matrix.rows() + (int(Direction) == Vertical ? 1 : 0); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols() + (int(Direction) == Horizontal ? 1 : 0); } @@ -244,8 +244,8 @@ struct homogeneous_left_product_impl, Lhs> EIGEN_DEVICE_FUNC homogeneous_left_product_impl(const Lhs& lhs, const MatrixType& rhs) : m_lhs(take_matrix_for_product::run(lhs)), m_rhs(rhs) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); } template EIGEN_DEVICE_FUNC void evalTo(Dest& dst) const { @@ -275,8 +275,8 @@ struct homogeneous_right_product_impl, Rhs> typedef remove_all_t RhsNested; EIGEN_DEVICE_FUNC homogeneous_right_product_impl(const MatrixType& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) {} - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_lhs.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_rhs.cols(); } template EIGEN_DEVICE_FUNC void evalTo(Dest& dst) const { diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index 1d8ded9bd..822ab2786 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -57,22 +57,22 @@ class QuaternionBase : public RotationBase { typedef AngleAxis AngleAxisType; /** \returns the \c x coefficient */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline CoeffReturnType x() const { return this->derived().coeffs().coeff(0); } + EIGEN_DEVICE_FUNC constexpr CoeffReturnType x() const { return this->derived().coeffs().coeff(0); } /** \returns the \c y coefficient */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline CoeffReturnType y() const { return this->derived().coeffs().coeff(1); } + EIGEN_DEVICE_FUNC constexpr CoeffReturnType y() const { return this->derived().coeffs().coeff(1); } /** \returns the \c z coefficient */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline CoeffReturnType z() const { return this->derived().coeffs().coeff(2); } + EIGEN_DEVICE_FUNC constexpr CoeffReturnType z() const { return this->derived().coeffs().coeff(2); } /** \returns the \c w coefficient */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline CoeffReturnType w() const { return this->derived().coeffs().coeff(3); } + EIGEN_DEVICE_FUNC constexpr CoeffReturnType w() const { return this->derived().coeffs().coeff(3); } /** \returns a reference to the \c x coefficient (if Derived is a non-const lvalue) */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline NonConstCoeffReturnType x() { return this->derived().coeffs().x(); } + EIGEN_DEVICE_FUNC constexpr NonConstCoeffReturnType x() { return this->derived().coeffs().x(); } /** \returns a reference to the \c y coefficient (if Derived is a non-const lvalue) */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline NonConstCoeffReturnType y() { return this->derived().coeffs().y(); } + EIGEN_DEVICE_FUNC constexpr NonConstCoeffReturnType y() { return this->derived().coeffs().y(); } /** \returns a reference to the \c z coefficient (if Derived is a non-const lvalue) */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline NonConstCoeffReturnType z() { return this->derived().coeffs().z(); } + EIGEN_DEVICE_FUNC constexpr NonConstCoeffReturnType z() { return this->derived().coeffs().z(); } /** \returns a reference to the \c w coefficient (if Derived is a non-const lvalue) */ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline NonConstCoeffReturnType w() { return this->derived().coeffs().w(); } + EIGEN_DEVICE_FUNC constexpr NonConstCoeffReturnType w() { return this->derived().coeffs().w(); } /** \returns a read-only vector expression of the imaginary part (x,y,z) */ EIGEN_DEVICE_FUNC inline const VectorBlock vec() const { return coeffs().template head<3>(); } diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 6113e97fc..e45417ce5 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -353,10 +353,10 @@ class Transform { inline QTransform toQTransform(void) const; #endif - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return int(Mode) == int(Projective) ? m_matrix.cols() : (m_matrix.cols() - 1); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_matrix.cols(); } /** shortcut for m_matrix(row,col); * \sa MatrixBase::operator(Index,Index) const */ diff --git a/Eigen/src/Geometry/Translation.h b/Eigen/src/Geometry/Translation.h index 682c4c70d..d942ac893 100644 --- a/Eigen/src/Geometry/Translation.h +++ b/Eigen/src/Geometry/Translation.h @@ -69,18 +69,18 @@ class Translation { EIGEN_DEVICE_FUNC explicit inline Translation(const VectorType& vector) : m_coeffs(vector) {} /** \brief Returns the x-translation by value. **/ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar x() const { return m_coeffs.x(); } + EIGEN_DEVICE_FUNC constexpr Scalar x() const { return m_coeffs.x(); } /** \brief Returns the y-translation by value. **/ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar y() const { return m_coeffs.y(); } + EIGEN_DEVICE_FUNC constexpr Scalar y() const { return m_coeffs.y(); } /** \brief Returns the z-translation by value. **/ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar z() const { return m_coeffs.z(); } + EIGEN_DEVICE_FUNC constexpr Scalar z() const { return m_coeffs.z(); } /** \brief Returns the x-translation as a reference. **/ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar& x() { return m_coeffs.x(); } + EIGEN_DEVICE_FUNC constexpr Scalar& x() { return m_coeffs.x(); } /** \brief Returns the y-translation as a reference. **/ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar& y() { return m_coeffs.y(); } + EIGEN_DEVICE_FUNC constexpr Scalar& y() { return m_coeffs.y(); } /** \brief Returns the z-translation as a reference. **/ - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Scalar& z() { return m_coeffs.z(); } + EIGEN_DEVICE_FUNC constexpr Scalar& z() { return m_coeffs.z(); } EIGEN_DEVICE_FUNC const VectorType& vector() const { return m_coeffs; } EIGEN_DEVICE_FUNC VectorType& vector() { return m_coeffs; } diff --git a/Eigen/src/Householder/HouseholderSequence.h b/Eigen/src/Householder/HouseholderSequence.h index 440573f6e..4bf0b7b94 100644 --- a/Eigen/src/Householder/HouseholderSequence.h +++ b/Eigen/src/Householder/HouseholderSequence.h @@ -183,7 +183,7 @@ class HouseholderSequence : public EigenBase DiagonalPreconditioner& analyzePattern(const MatType&) { diff --git a/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h b/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h index ba379eca4..e82761767 100644 --- a/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +++ b/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h @@ -84,10 +84,10 @@ class IncompleteCholesky : public SparseSolverBase::factorize(const MatrixType_& amat) { } // end namespace Eigen -#endif // EIGEN_INCOMPLETE_LUT_H \ No newline at end of file +#endif // EIGEN_INCOMPLETE_LUT_H diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index cf85f2e3a..e5635d07e 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -218,10 +218,10 @@ class IterativeSolverBase : public SparseSolverBase { } /** \internal */ - EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return matrix().rows(); } + constexpr Index rows() const EIGEN_NOEXCEPT { return matrix().rows(); } /** \internal */ - EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return matrix().cols(); } + constexpr Index cols() const EIGEN_NOEXCEPT { return matrix().cols(); } /** \returns the tolerance threshold used by the stopping criteria. * \sa setTolerance() diff --git a/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h b/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h index 2b146b373..c762baa43 100644 --- a/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +++ b/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h @@ -50,8 +50,8 @@ class SolveWithGuess : public internal::generic_xpr_base > { if (m_numeric) klu_free_numeric(&m_numeric, &m_common); } - EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return mp_matrix.rows(); } - EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return mp_matrix.cols(); } + constexpr Index rows() const EIGEN_NOEXCEPT { return mp_matrix.rows(); } + constexpr Index cols() const EIGEN_NOEXCEPT { return mp_matrix.cols(); } /** \brief Reports whether previous computation was successful. * diff --git a/Eigen/src/LU/FullPivLU.h b/Eigen/src/LU/FullPivLU.h index 44027103f..275347964 100644 --- a/Eigen/src/LU/FullPivLU.h +++ b/Eigen/src/LU/FullPivLU.h @@ -391,8 +391,8 @@ class FullPivLU : public SolverBase > MatrixType reconstructedMatrix() const; - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); } - EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); } #ifndef EIGEN_PARSED_BY_DOXYGEN template diff --git a/Eigen/src/LU/PartialPivLU.h b/Eigen/src/LU/PartialPivLU.h index 1edd6b8d0..48c4bacf8 100644 --- a/Eigen/src/LU/PartialPivLU.h +++ b/Eigen/src/LU/PartialPivLU.h @@ -210,8 +210,8 @@ class PartialPivLU : public SolverBase diff --git a/Eigen/src/misc/lapacke_helpers.h b/Eigen/src/misc/lapacke_helpers.h index 5a2f38fc2..ff98639c0 100644 --- a/Eigen/src/misc/lapacke_helpers.h +++ b/Eigen/src/misc/lapacke_helpers.h @@ -75,7 +75,7 @@ EIGEN_ALWAYS_INLINE lapack_int to_lapack(Index index) { return convert_index -EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR lapack_int lapack_storage_of(const EigenBase &) { +EIGEN_ALWAYS_INLINE constexpr lapack_int lapack_storage_of(const EigenBase &) { return Derived::IsRowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; } diff --git a/Eigen/src/plugins/BlockMethods.inc b/Eigen/src/plugins/BlockMethods.inc index 46dc9ddd1..0782aa39a 100644 --- a/Eigen/src/plugins/BlockMethods.inc +++ b/Eigen/src/plugins/BlockMethods.inc @@ -1365,6 +1365,6 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::conditional_t -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index subVectors() const { +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index subVectors() const { return (Direction == Vertical) ? cols() : rows(); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h index 902aa961e..ea210a1f8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h @@ -45,19 +45,19 @@ namespace internal { template struct TVPanelSize { // LocalThreadSizeC: determines total number of thread per workgroup for the contracting dimension - static EIGEN_CONSTEXPR StorageIndex LocalThreadSizeC = EIGEN_SYCL_LOCAL_THREAD_DIM0; + static constexpr StorageIndex LocalThreadSizeC = EIGEN_SYCL_LOCAL_THREAD_DIM0; // LocalThreadSizeNC: determines total number of thread per workgroup for the non-contracting dimension - static EIGEN_CONSTEXPR StorageIndex LocalThreadSizeNC = EIGEN_SYCL_LOCAL_THREAD_DIM1; + static constxpr StorageIndex LocalThreadSizeNC = EIGEN_SYCL_LOCAL_THREAD_DIM1; // TileSizeDimNC: determines the tile size for the non-contracting dimension - static EIGEN_CONSTEXPR StorageIndex TileSizeDimNC = NCWindow / NCFactor; + static constexpr StorageIndex TileSizeDimNC = NCWindow / NCFactor; // TileSizeDimC: determines the tile size for the contracting dimension - static EIGEN_CONSTEXPR StorageIndex TileSizeDimC = CFactor * LocalThreadSizeNC * LocalThreadSizeC; + static constexpr StorageIndex TileSizeDimC = CFactor * LocalThreadSizeNC * LocalThreadSizeC; // WorkLoadPerThreadNC : determines workload per thread for loading the non-contracting dimension - static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadNC = TileSizeDimNC / LocalThreadSizeNC; + static constexpr StorageIndex WorkLoadPerThreadNC = TileSizeDimNC / LocalThreadSizeNC; // WorkLoadPerThreadC: determines workload per thread for loading the non-contracting dimension - static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadC = TileSizeDimC / LocalThreadSizeC; + static constexpr StorageIndex WorkLoadPerThreadC = TileSizeDimC / LocalThreadSizeC; // BC : determines if supporting bank conflict is required - static EIGEN_CONSTEXPR bool BC = false; + static constexpr bool BC = false; }; #endif @@ -81,40 +81,40 @@ struct TVPanelSize { template struct TTPanelSize { // TileSizeDimK: determines Tile size for dimension K. The packet size is assumed to be considered - static EIGEN_CONSTEXPR StorageIndex TileSizeDimK = TSDK; + static constexpr StorageIndex TileSizeDimK = TSDK; // WorkLoadPerThreadM : determines workload per thread for loading the M dimension This can be varied based on the // available register on a chosen device(can be controlled by EIGEN_SYCL_REG_M macro// #ifndef EIGEN_SYCL_REG_M - static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadM = REG_SIZE_M; + static constexpr StorageIndex WorkLoadPerThreadM = REG_SIZE_M; #else - static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadM = EIGEN_SYCL_REG_M; + static constexpr StorageIndex WorkLoadPerThreadM = EIGEN_SYCL_REG_M; #endif // WorkLoadPerThreadN : determines workload per thread for loading the N dimension This can be varied based on the // available register on a chosen device(can be controlled by EIGEN_SYCL_REG_N macro #ifndef EIGEN_SYCL_REG_N - static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadN = REG_SIZE_N; + static constexpr StorageIndex WorkLoadPerThreadN = REG_SIZE_N; #else - static EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadN = EIGEN_SYCL_REG_N; + static constexpr StorageIndex WorkLoadPerThreadN = EIGEN_SYCL_REG_N; #endif // LocalThreadSizeM: determines total number of thread per workgroup for the m dimension - static EIGEN_CONSTEXPR StorageIndex LocalThreadSizeM = EIGEN_SYCL_LOCAL_THREAD_DIM0; + static constexpr StorageIndex LocalThreadSizeM = EIGEN_SYCL_LOCAL_THREAD_DIM0; // LocalThreadSizeN: determines total number of thread per workgroup for the n dimension - static EIGEN_CONSTEXPR StorageIndex LocalThreadSizeN = EIGEN_SYCL_LOCAL_THREAD_DIM1; + static constexpr StorageIndex LocalThreadSizeN = EIGEN_SYCL_LOCAL_THREAD_DIM1; // TileSizeDimM: determines the tile size for the m dimension - static EIGEN_CONSTEXPR StorageIndex TileSizeDimM = LocalThreadSizeM * WorkLoadPerThreadM; + static constexpr StorageIndex TileSizeDimM = LocalThreadSizeM * WorkLoadPerThreadM; // TileSizeDimN: determines the tile size for the n dimension - static EIGEN_CONSTEXPR StorageIndex TileSizeDimN = LocalThreadSizeN * WorkLoadPerThreadN; + static constexpr StorageIndex TileSizeDimN = LocalThreadSizeN * WorkLoadPerThreadN; // LoadPerThreadLhs: determines workload per thread for loading Lhs Tensor. This must be divisible by packetsize - static EIGEN_CONSTEXPR StorageIndex LoadPerThreadLhs = + static constexpr StorageIndex LoadPerThreadLhs = ((TileSizeDimK * WorkLoadPerThreadM * WorkLoadPerThreadN) / (TileSizeDimN)); // LoadPerThreadRhs: determines workload per thread for loading Rhs Tensor. This must be divisible by packetsize - static EIGEN_CONSTEXPR StorageIndex LoadPerThreadRhs = + static constexpr StorageIndex LoadPerThreadRhs = ((TileSizeDimK * WorkLoadPerThreadM * WorkLoadPerThreadN) / (TileSizeDimM)); // BC : determines if supporting bank conflict is required - static EIGEN_CONSTEXPR bool BC = true; + static constexpr bool BC = true; // DoubleBuffer: determines if double buffering technique should be used (This can be disabled by // EIGEN_SYCL_DISABLE_DOUBLE_BUFFER macro when the device does not have sufficient local memory) - static EIGEN_CONSTEXPR bool DoubleBuffer = + static constexpr bool DoubleBuffer = #ifdef EIGEN_SYCL_DISABLE_DOUBLE_BUFFER false; #else @@ -220,7 +220,7 @@ static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t
write( PacketType &packet_data, DataScalar ptr) { - EIGEN_CONSTEXPR int PacketSize = Eigen::internal::unpacket_traits::size; + constexpr int PacketSize = Eigen::internal::unpacket_traits::size; EIGEN_UNROLL_LOOP for (int i = 0; i < PacketSize; i++) { *ptr = PacketWrapper::scalarize(i, packet_data); @@ -320,14 +320,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool check_boundary(bool cond) { */ template struct BlockProperties { - static EIGEN_CONSTEXPR bool packet_load = packet_load_; + static constexpr bool packet_load = packet_load_; typedef typename Eigen::internal::unpacket_traits::type OutScalar; - static EIGEN_CONSTEXPR bool is_rhs = is_rhs_; + static constexpr bool is_rhs = is_rhs_; typedef std::conditional_t OutType; - static EIGEN_CONSTEXPR int elements_per_access = Eigen::internal::unpacket_traits::size; - static EIGEN_CONSTEXPR bool is_coalesced_layout = !(is_transposed ^ is_rhs); - static EIGEN_CONSTEXPR int nc_stride = (is_coalesced_layout ? elements_per_access : 1); - static EIGEN_CONSTEXPR int c_stride = (is_coalesced_layout ? 1 : elements_per_access); + static constexpr int elements_per_access = Eigen::internal::unpacket_traits::size; + static constexpr bool is_coalesced_layout = !(is_transposed ^ is_rhs); + static constexpr int nc_stride = (is_coalesced_layout ? elements_per_access : 1); + static constexpr int c_stride = (is_coalesced_layout ? 1 : elements_per_access); }; /*! @@ -458,11 +458,11 @@ class TensorContractionKernel { public: typedef typename Eigen::TensorSycl::internal::Vectorise::PacketReturnType PacketReturnType; - static EIGEN_CONSTEXPR int PacketSize = + static constexpr int PacketSize = Eigen::TensorSycl::internal::Vectorise::PacketSize; - static EIGEN_CONSTEXPR bool is_lhs_transposed = + static constexpr bool is_lhs_transposed = !::Eigen::internal::TensorContractionInputMapperTrait::inner_dim_contiguous; - static EIGEN_CONSTEXPR bool is_rhs_transposed = + static constexpr bool is_rhs_transposed = !::Eigen::internal::TensorContractionInputMapperTrait::inner_dim_contiguous; typedef BlockProperties RHSBlockProperties; - static EIGEN_CONSTEXPR StorageIndex NStride = + static constexpr StorageIndex NStride = contraction_tp == contraction_type::local ? Properties::WorkLoadPerThreadN : RHSBlockProperties::nc_stride; typedef cl::sycl::accessor Scratch; typedef cl::sycl::multi_ptr local_ptr; typedef OutScalar * /*cl::sycl::multi_ptr*/ private_ptr; typedef std::conditional_t tile_ptr; - static EIGEN_CONSTEXPR StorageIndex LSDL = contraction_tp == contraction_type::local - ? Properties::TileSizeDimM + Properties::BC - : Properties::WorkLoadPerThreadM; - static EIGEN_CONSTEXPR StorageIndex LSDR = contraction_tp == contraction_type::local - ? Properties::TileSizeDimN + Properties::BC - : Properties::WorkLoadPerThreadN; - static EIGEN_CONSTEXPR StorageIndex LocalOffset = Properties::LocalThreadSizeM * Properties::LocalThreadSizeN; + static constexpr StorageIndex LSDL = contraction_tp == contraction_type::local + ? Properties::TileSizeDimM + Properties::BC + : Properties::WorkLoadPerThreadM; + static constexpr StorageIndex LSDR = contraction_tp == contraction_type::local + ? Properties::TileSizeDimN + Properties::BC + : Properties::WorkLoadPerThreadN; + static constexpr StorageIndex LocalOffset = Properties::LocalThreadSizeM * Properties::LocalThreadSizeN; /** * \brief MemHolder this is a place holder struct for creating memory hierarchy in SYCL. Inside SYCL kernel it is not @@ -638,7 +638,7 @@ class TensorContractionKernel { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void compute_block_per_tile(OutScalar *lhs_block_ptr, OutScalar *rhs_block_ptr, PacketReturnType *privateRes) const { StorageIndex idx = 0; - EIGEN_CONSTEXPR StorageIndex lhs_stride = + constexpr StorageIndex lhs_stride = contraction_tp == contraction_type::local ? (PacketSize * Properties::LocalThreadSizeM) : 1; EIGEN_UNROLL_LOOP for (StorageIndex wLPTN = 0; wLPTN < Properties::WorkLoadPerThreadN; wLPTN++) { @@ -668,8 +668,7 @@ class TensorContractionKernel { // when local memory is not used M and N are both accessed in a coalesced way. However, when local memory is // available the k*N is transposed in the local to N*K therefore, each blocks operates on blockId* // WorkLoadPerThreadN slice of N - EIGEN_CONSTEXPR StorageIndex GlobalNStride = - contraction_tp == contraction_type::local ? 1 : Properties::LocalThreadSizeN; + constexpr StorageIndex GlobalNStride = contraction_tp == contraction_type::local ? 1 : Properties::LocalThreadSizeN; EIGEN_UNROLL_LOOP for (StorageIndex wLPTN = 0; wLPTN < Properties::WorkLoadPerThreadN / PrivateNStride; wLPTN++) { // output leading dimension @@ -713,9 +712,9 @@ class TensorContractionKernel { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t extract_block( const Input &inpt, PrivateReg private_ptr, const std::pair &, const StorageIndex &ncOffset, const StorageIndex cOffset) const { - EIGEN_CONSTEXPR StorageIndex LocalThreadSizeNC = + constexpr StorageIndex LocalThreadSizeNC = InputBlockProperties::is_rhs ? Properties::LocalThreadSizeN : Properties::LocalThreadSizeM; - EIGEN_CONSTEXPR StorageIndex WorkLoadPerThreadNC = + constexpr StorageIndex WorkLoadPerThreadNC = InputBlockProperties::is_rhs ? Properties::WorkLoadPerThreadN : Properties::WorkLoadPerThreadM; const StorageIndex &NC = InputBlockProperties::is_rhs ? triple_dim.N : triple_dim.M; @@ -891,11 +890,11 @@ class TensorContractionKernel { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t extract_block( const Input &inpt, Local local_ptr, const std::pair &local_index, const StorageIndex &ncOffset, const StorageIndex cOffset) const { - EIGEN_CONSTEXPR StorageIndex TileSizeDimNC = + constexpr StorageIndex TileSizeDimNC = InputBlockProperties::is_rhs ? Properties::TileSizeDimN : Properties::TileSizeDimM; - EIGEN_CONSTEXPR StorageIndex LoadPerThread = + constexpr StorageIndex LoadPerThread = InputBlockProperties::is_rhs ? Properties::LoadPerThreadRhs : Properties::LoadPerThreadLhs; - EIGEN_CONSTEXPR StorageIndex LSD = InputBlockProperties::is_rhs ? LSDR : LSDL; + constexpr StorageIndex LSD = InputBlockProperties::is_rhs ? LSDR : LSDL; static_assert(((LocalOffset % (TileSizeDimNC / InputBlockProperties::nc_stride) == 0) && (LocalOffset % (Properties::TileSizeDimK / InputBlockProperties::c_stride) == 0)), " LocalOffset must be divisible by stride"); @@ -995,11 +994,11 @@ template ::PacketReturnType PacketReturnType; - static EIGEN_CONSTEXPR int PacketSize = + static constexpr int PacketSize = Eigen::TensorSycl::internal::Vectorise::PacketSize; typedef cl::sycl::accessor Scratch; - static EIGEN_CONSTEXPR StorageIndex OutScratchOffset = + static constexpr StorageIndex OutScratchOffset = KFactor * Properties::LocalThreadSizeC * Properties::LocalThreadSizeNC; // Since the access layout for a vector can always be coalesced, when LHS is a vector, we pass false and false to make @@ -1328,8 +1327,8 @@ struct TensorEvaluator struct input_mapper_propertis { - static EIGEN_CONSTEXPR bool is_lhs_matrix = (LDims == 2 && ContractDims == 1) || lhs_inner_dim_contiguous; - static EIGEN_CONSTEXPR bool is_rhs_matrix = + static constexpr bool is_lhs_matrix = (LDims == 2 && ContractDims == 1) || lhs_inner_dim_contiguous; + static constexpr bool is_rhs_matrix = (RDims == 2 && ContractDims == 1) || (rhs_inner_dim_contiguous && !rhs_inner_dim_reordered); }; @@ -1537,9 +1536,9 @@ struct TensorEvaluator Properties; const StorageIndex roundUpC = Eigen::TensorSycl::internal::roundUp(C, Properties::TileSizeDimC); @@ -1601,7 +1600,7 @@ struct TensorEvaluator> { typedef Index Real; enum { IsComplex = 0, RequireInitialization = false, ReadCost = 1, AddCost = 1, MulCost = 1 }; - EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real epsilon() { return 0; } - EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real dummy_precision() { return 0; } - EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real highest() { return n; } - EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real lowest() { return n; } + EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Real epsilon() { return 0; } + EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Real dummy_precision() { return 0; } + EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Real highest() { return n; } + EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE Real lowest() { return n; } }; namespace internal { @@ -569,47 +569,47 @@ struct index_pair_second_statically_eq_impl -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_known_statically(Index i) { +static EIGEN_DEVICE_FUNC constexpr bool index_known_statically(Index i) { return index_known_statically_impl::run(i); } template -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool all_indices_known_statically() { +static EIGEN_DEVICE_FUNC constexpr bool all_indices_known_statically() { return all_indices_known_statically_impl::run(); } template -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool indices_statically_known_to_increase() { +static EIGEN_DEVICE_FUNC constexpr bool indices_statically_known_to_increase() { return indices_statically_known_to_increase_impl::run(); } template -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_eq(Index i, Index value) { +static EIGEN_DEVICE_FUNC constexpr bool index_statically_eq(Index i, Index value) { return index_statically_eq_impl::run(i, value); } template -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_ne(Index i, Index value) { +static EIGEN_DEVICE_FUNC constexpr bool index_statically_ne(Index i, Index value) { return index_statically_ne_impl::run(i, value); } template -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_gt(Index i, Index value) { +static EIGEN_DEVICE_FUNC constexpr bool index_statically_gt(Index i, Index value) { return index_statically_gt_impl::run(i, value); } template -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_lt(Index i, Index value) { +static EIGEN_DEVICE_FUNC constexpr bool index_statically_lt(Index i, Index value) { return index_statically_lt_impl::run(i, value); } template -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_pair_first_statically_eq(Index i, Index value) { +static EIGEN_DEVICE_FUNC constexpr bool index_pair_first_statically_eq(Index i, Index value) { return index_pair_first_statically_eq_impl::run(i, value); } template -static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_pair_second_statically_eq(Index i, Index value) { +static EIGEN_DEVICE_FUNC constexpr bool index_pair_second_statically_eq(Index i, Index value) { return index_pair_second_statically_eq_impl::run(i, value); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h index 8c2bb2ef9..8454070af 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h @@ -212,9 +212,9 @@ struct Pair { typedef U first_type; typedef V second_type; - EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Pair() : first(), second() {} + constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Pair() : first(), second() {} - EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Pair(const U& f, const V& s) : first(f), second(s) {} + constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Pair(const U& f, const V& s) : first(f), second(s) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(Pair& rhs) { using numext::swap; @@ -224,20 +224,20 @@ struct Pair { }; template -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator==(const Pair& x, const Pair& y) { +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator==(const Pair& x, const Pair& y) { return (x.first == y.first && x.second == y.second); } template -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator!=(const Pair& x, const Pair& y) { +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator!=(const Pair& x, const Pair& y) { return !(x == y); } // Can't use std::pairs on cuda devices template struct IndexPair { - EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair() : first(0), second(0) {} - EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair(Idx f, Idx s) : first(f), second(s) {} + constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair() : first(0), second(0) {} + constexpr EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair(Idx f, Idx s) : first(f), second(s) {} EIGEN_DEVICE_FUNC void set(IndexPair val) { first = val.first; @@ -251,19 +251,18 @@ struct IndexPair { namespace internal { template -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array customIndices2Array( +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array customIndices2Array( IndexType& idx, numeric_list) { return {static_cast(idx[First]), static_cast(idx[Is])...}; } template -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array customIndices2Array(IndexType&, - numeric_list) { +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array customIndices2Array(IndexType&, numeric_list) { return array(); } /** Make an array (for index/dimensions) out of a custom index */ template -EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array customIndices2Array(IndexType& idx) { +constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE array customIndices2Array(IndexType& idx) { return customIndices2Array(idx, typename gen_numeric_list::type{}); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h index 6944c0337..b4749b41f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h @@ -402,9 +402,9 @@ struct SecondStepPartialReduction { template struct ReductionPannel { - static EIGEN_CONSTEXPR Index LocalThreadSizeP = LTP; - static EIGEN_CONSTEXPR Index LocalThreadSizeR = LTR; - static EIGEN_CONSTEXPR bool BC = BC_; + static constexpr Index LocalThreadSizeP = LTP; + static constexpr Index LocalThreadSizeR = LTR; + static constexpr bool BC = BC_; }; template @@ -430,7 +430,7 @@ struct PartialReducerLauncher { "The Local thread size must be a power of 2 for the reduction " "operation"); - EIGEN_CONSTEXPR Index localRange = PannelParameters::LocalThreadSizeP * PannelParameters::LocalThreadSizeR; + constexpr Index localRange = PannelParameters::LocalThreadSizeP * PannelParameters::LocalThreadSizeR; // In this step, we force the code not to be more than 2-step reduction: // Our empirical research shows that if each thread reduces at least 64 // elements individually, we get better performance. However, this can change @@ -445,7 +445,7 @@ struct PartialReducerLauncher { const Index rNumGroups = num_coeffs_to_reduce > reductionPerThread * localRange ? std::min(rGroups, localRange) : 1; const Index globalRange = pNumGroups * rNumGroups * localRange; - EIGEN_CONSTEXPR Index scratchSize = + constexpr Index scratchSize = PannelParameters::LocalThreadSizeR * (PannelParameters::LocalThreadSizeP + PannelParameters::BC); auto thread_range = cl::sycl::nd_range<1>(cl::sycl::range<1>(globalRange), cl::sycl::range<1>(localRange)); if (rNumGroups > 1) { @@ -482,15 +482,15 @@ template struct FullReducer { typedef typename Self::CoeffReturnType CoeffReturnType; typedef typename Self::EvaluatorPointerType EvaluatorPointerType; - static EIGEN_CONSTEXPR bool HasOptimizedImplementation = true; - static EIGEN_CONSTEXPR int PacketSize = Self::PacketAccess ? Self::PacketSize : 1; + static constexpr bool HasOptimizedImplementation = true; + static constexpr int PacketSize = Self::PacketAccess ? Self::PacketSize : 1; static void run(const Self &self, Op &reducer, const Eigen::SyclDevice &dev, EvaluatorPointerType data) { typedef std::conditional_t OutType; static_assert(!((EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1) & (EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1 - 1)), "The Local thread size must be a power of 2 for the reduction " "operation"); - EIGEN_CONSTEXPR Index local_range = EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1; + constexpr Index local_range = EIGEN_SYCL_LOCAL_THREAD_DIM0 * EIGEN_SYCL_LOCAL_THREAD_DIM1; typename Self::Index inputSize = self.impl().dimensions().TotalSize(); // In this step we force the code not to be more than 2-step reduction: @@ -535,7 +535,7 @@ struct FullReducer { // col reduction template struct OuterReducer { - static EIGEN_CONSTEXPR bool HasOptimizedImplementation = true; + static constexpr bool HasOptimizedImplementation = true; static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev, typename Self::EvaluatorPointerType output, typename Self::Index num_coeffs_to_reduce, @@ -549,7 +549,7 @@ struct OuterReducer { // row reduction template struct InnerReducer { - static EIGEN_CONSTEXPR bool HasOptimizedImplementation = true; + static constexpr bool HasOptimizedImplementation = true; static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev, typename Self::EvaluatorPointerType output, typename Self::Index num_coeffs_to_reduce, @@ -566,7 +566,7 @@ struct InnerReducer { // generic partial reduction template struct GenericReducer { - static EIGEN_CONSTEXPR bool HasOptimizedImplementation = false; + static constexpr bool HasOptimizedImplementation = false; static bool run(const Self &self, const Op &reducer, const Eigen::SyclDevice &dev, typename Self::EvaluatorPointerType output, typename Self::Index num_values_to_reduce, typename Self::Index num_coeffs_to_preserve) { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h b/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h index f0a390fb1..6de08679a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h @@ -197,7 +197,7 @@ struct ScanLauncher { // threads. Currently set to twice the cache line size on Intel and ARM // processors. EIGEN_STRONG_INLINE Index AdjustBlockSize(Index item_size, Index block_size) { - EIGEN_CONSTEXPR Index kBlockAlignment = 128; + constexpr Index kBlockAlignment = 128; const Index items_per_cacheline = numext::maxi(1, kBlockAlignment / item_size); return items_per_cacheline * numext::div_ceil(block_size, items_per_cacheline); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h index 30fde9197..3636788cc 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h @@ -51,7 +51,7 @@ namespace internal { template struct ScanParameters { // must be power of 2 - static EIGEN_CONSTEXPR index_t ScanPerThread = 8; + static constexpr index_t ScanPerThread = 8; const index_t total_size; const index_t non_scan_size; const index_t scan_size; @@ -86,7 +86,7 @@ template LocalAccessor; - static EIGEN_CONSTEXPR int PacketSize = ScanParameters::ScanPerThread / 2; + static constexpr int PacketSize = ScanParameters::ScanPerThread / 2; LocalAccessor scratch; Evaluator dev_eval; @@ -288,7 +288,7 @@ template LocalAccessor; - static EIGEN_CONSTEXPR int PacketSize = ScanParameters::ScanPerThread / 2; + static constexpr int PacketSize = ScanParameters::ScanPerThread / 2; InAccessor in_ptr; OutAccessor out_ptr; const ScanParameters scanParameters; diff --git a/unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h b/unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h index 51c0ad665..ae5c4f4c4 100644 --- a/unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h +++ b/unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h @@ -106,7 +106,7 @@ class DynamicSGroup { int one; int two; int flags; - constexpr inline Generator(int one_, int two_, int flags_) : one(one_), two(two_), flags(flags_) {} + constexpr Generator(int one_, int two_, int flags_) : one(one_), two(two_), flags(flags_) {} }; std::size_t m_numIndices; diff --git a/unsupported/Eigen/CXX11/src/TensorSymmetry/StaticSymmetry.h b/unsupported/Eigen/CXX11/src/TensorSymmetry/StaticSymmetry.h index 3f9bb51e7..66a982bde 100644 --- a/unsupported/Eigen/CXX11/src/TensorSymmetry/StaticSymmetry.h +++ b/unsupported/Eigen/CXX11/src/TensorSymmetry/StaticSymmetry.h @@ -25,7 +25,7 @@ struct tensor_static_symgroup_permutate> { constexpr static std::size_t N = sizeof...(nn); template - constexpr static inline std::array run(const std::array& indices) { + constexpr static std::array run(const std::array& indices) { return {{indices[nn]...}}; } }; @@ -51,7 +51,7 @@ struct tensor_static_symgroup_identity_ctor { template struct tensor_static_symgroup_multiply_helper { template - constexpr static inline numeric_list::value...> helper(numeric_list) { + constexpr static numeric_list::value...> helper(numeric_list) { return numeric_list::value...>(); } }; @@ -107,9 +107,9 @@ struct tensor_static_symgroup { }; template -constexpr static inline std::array tensor_static_symgroup_index_permute(std::array idx, - internal::numeric_list, - internal::numeric_list) { +constexpr static std::array tensor_static_symgroup_index_permute(std::array idx, + internal::numeric_list, + internal::numeric_list) { return {{idx[ii]..., idx[jj]...}}; } @@ -179,9 +179,9 @@ class StaticSGroup { typedef typename group_elements::type ge; public: - constexpr inline StaticSGroup() {} - constexpr inline StaticSGroup(const StaticSGroup&) {} - constexpr inline StaticSGroup(StaticSGroup&&) {} + constexpr StaticSGroup() {} + constexpr StaticSGroup(const StaticSGroup&) {} + constexpr StaticSGroup(StaticSGroup&&) {} template static inline RV apply(const std::array& idx, RV initial, Args&&... args) { @@ -196,8 +196,8 @@ class StaticSGroup { constexpr static std::size_t static_size = ge::count; - constexpr static inline std::size_t size() { return ge::count; } - constexpr static inline int globalFlags() { return group_elements::global_flags; } + constexpr static std::size_t size() { return ge::count; } + constexpr static int globalFlags() { return group_elements::global_flags; } template inline internal::tensor_symmetry_value_setter> operator()( diff --git a/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h b/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h index e3be69d85..632f43706 100644 --- a/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h +++ b/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h @@ -36,15 +36,15 @@ namespace internal { */ template -constexpr inline T& array_get(std::vector& a) { +constexpr T& array_get(std::vector& a) { return a[I_]; } template -constexpr inline T&& array_get(std::vector&& a) { +constexpr T&& array_get(std::vector&& a) { return a[I_]; } template -constexpr inline T const& array_get(std::vector const& a) { +constexpr T const& array_get(std::vector const& a) { return a[I_]; }