Update Eigen to commit:a30ecb7221a46824b85cad5f9016efe6e5871d69
CHANGELOG
=========
a30ecb722 - Don't use the fast implementation if EIGEN_GPU_CC, since integer_packet is not defined for float4 used by the GPU compiler (even on host).
5a0a165c0 - fix broken asserts
0b5873893 - Fix two corner cases in the new implementation of logistic sigmoid.
5d7ffe2ca - drop COPYING.GPL
a32e6a404 - Explicit type casting
8d81a2339 - Reduce usage of reserved names
c61b3cb0d - Fix IterativeSolverBase referring to itself as ConjugateGradient
80ccacc71 - Fix accuracy of logistic sigmoid
8b8125c57 - Make sure the scalar and vectorized path for array.exp() return consistent values.
c9df98b07 - Fix Gcc8.5 warning about missing base class initialisation (#2404)
47eac2107 - Make fixed-size Matrix and Array trivially copyable after C++20
c4b1dd2f6 - Add support for Cray, Fujitsu, and Intel ICX compilers
96dc37a03 - Some fixes/cleanups for numeric_limits & fix for related bug in psqrt
ed27d988c - Fixes #i2411
7b5a8b6bc - Improve plog: 20% speedup for float + handle denormals
a491c7f89 - Allow specifying inner & outer stride for CWiseUnaryView - fixes #2398
27a78e4f9 - Some serialization API changes were made in commit...
9210e71fb - ensure that eigen::internal::size is not found by ADL, rename to ssize and...
7244a74ab - Add bounds checking to Eigen serializer
ba91839d7 - Remove user survey from Doxygen header
a4098ac67 - Fix duplicate include guard *ALTIVEC_H -> *ZVECTOR_H
22a347b9d - Remove unused EIGEN_HAS_STATIC_ARRAY_TEMPLATE
d705eb5f8 - Revert "Select AVX2 even if the data size is not a multiple of 8"
8eab7b688 - Improve exp<float>(): Don't flush denormal results +4% speedup.
6e95c0cd9 - Add missing internal namespace
d3675b2e7 - Add vectorization_logic_1 test to list of CI smoketests
c06c3e52a - Include immintrin.h if F16C is available and vectorization is disabled
f7a056bf0 - Small fixes
2a6594de2 - Small cleanup of GDB pretty printer code
dee6428a7 - fixed clang warnings about alignment change and floating point precision
d0b4b75fb - Simplify logical_xor()
e93a07177 - Fix a bug introduced in !751.
PiperOrigin-RevId: 423164395
Change-Id: I8c7351eccfca04dccb07ca7ec6cfb0cbb3cd5a83
diff --git a/Eigen/src/Core/CwiseUnaryView.h b/Eigen/src/Core/CwiseUnaryView.h
index 9fc1dcd..fabb3f8 100644
--- a/Eigen/src/Core/CwiseUnaryView.h
+++ b/Eigen/src/Core/CwiseUnaryView.h
@@ -15,32 +15,37 @@
namespace Eigen {
namespace internal {
-template<typename ViewOp, typename MatrixType>
-struct traits<CwiseUnaryView<ViewOp, MatrixType> >
+template<typename ViewOp, typename MatrixType, typename StrideType>
+struct traits<CwiseUnaryView<ViewOp, MatrixType, StrideType> >
: traits<MatrixType>
{
typedef typename result_of<
ViewOp(const typename traits<MatrixType>::Scalar&)
>::type Scalar;
typedef typename MatrixType::Nested MatrixTypeNested;
- typedef typename remove_all<MatrixTypeNested>::type _MatrixTypeNested;
+ typedef typename remove_all<MatrixTypeNested>::type MatrixTypeNested_;
enum {
FlagsLvalueBit = is_lvalue<MatrixType>::value ? LvalueBit : 0,
- Flags = traits<_MatrixTypeNested>::Flags & (RowMajorBit | FlagsLvalueBit | DirectAccessBit), // FIXME DirectAccessBit should not be handled by expressions
+ Flags = traits<MatrixTypeNested_>::Flags & (RowMajorBit | FlagsLvalueBit | DirectAccessBit), // FIXME DirectAccessBit should not be handled by expressions
MatrixTypeInnerStride = inner_stride_at_compile_time<MatrixType>::ret,
// need to cast the sizeof's from size_t to int explicitly, otherwise:
// "error: no integral type can represent all of the enumerator values
- InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic
- ? int(Dynamic)
- : int(MatrixTypeInnerStride) * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)),
- OuterStrideAtCompileTime = outer_stride_at_compile_time<MatrixType>::ret == Dynamic
- ? int(Dynamic)
- : outer_stride_at_compile_time<MatrixType>::ret * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar))
+ InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0
+ ? (MatrixTypeInnerStride == Dynamic
+ ? int(Dynamic)
+ : int(MatrixTypeInnerStride) * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)))
+ : int(StrideType::InnerStrideAtCompileTime),
+
+ OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0
+ ? (outer_stride_at_compile_time<MatrixType>::ret == Dynamic
+ ? int(Dynamic)
+ : outer_stride_at_compile_time<MatrixType>::ret * int(sizeof(typename traits<MatrixType>::Scalar) / sizeof(Scalar)))
+ : int(StrideType::OuterStrideAtCompileTime)
};
};
}
-template<typename ViewOp, typename MatrixType, typename StorageKind>
+template<typename ViewOp, typename MatrixType, typename StrideType, typename StorageKind>
class CwiseUnaryViewImpl;
/** \class CwiseUnaryView
@@ -56,12 +61,12 @@
*
* \sa MatrixBase::unaryViewExpr(const CustomUnaryOp &) const, class CwiseUnaryOp
*/
-template<typename ViewOp, typename MatrixType>
-class CwiseUnaryView : public CwiseUnaryViewImpl<ViewOp, MatrixType, typename internal::traits<MatrixType>::StorageKind>
+template<typename ViewOp, typename MatrixType, typename StrideType>
+class CwiseUnaryView : public CwiseUnaryViewImpl<ViewOp, MatrixType, StrideType, typename internal::traits<MatrixType>::StorageKind>
{
public:
- typedef typename CwiseUnaryViewImpl<ViewOp, MatrixType,typename internal::traits<MatrixType>::StorageKind>::Base Base;
+ typedef typename CwiseUnaryViewImpl<ViewOp, MatrixType, StrideType, typename internal::traits<MatrixType>::StorageKind>::Base Base;
EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryView)
typedef typename internal::ref_selector<MatrixType>::non_const_type MatrixTypeNested;
typedef typename internal::remove_all<MatrixType>::type NestedExpression;
@@ -93,22 +98,22 @@
};
// Generic API dispatcher
-template<typename ViewOp, typename XprType, typename StorageKind>
+template<typename ViewOp, typename XprType, typename StrideType, typename StorageKind>
class CwiseUnaryViewImpl
- : public internal::generic_xpr_base<CwiseUnaryView<ViewOp, XprType> >::type
+ : public internal::generic_xpr_base<CwiseUnaryView<ViewOp, XprType, StrideType> >::type
{
public:
- typedef typename internal::generic_xpr_base<CwiseUnaryView<ViewOp, XprType> >::type Base;
+ typedef typename internal::generic_xpr_base<CwiseUnaryView<ViewOp, XprType, StrideType> >::type Base;
};
-template<typename ViewOp, typename MatrixType>
-class CwiseUnaryViewImpl<ViewOp,MatrixType,Dense>
- : public internal::dense_xpr_base< CwiseUnaryView<ViewOp, MatrixType> >::type
+template<typename ViewOp, typename MatrixType, typename StrideType>
+class CwiseUnaryViewImpl<ViewOp,MatrixType,StrideType,Dense>
+ : public internal::dense_xpr_base< CwiseUnaryView<ViewOp, MatrixType, StrideType> >::type
{
public:
- typedef CwiseUnaryView<ViewOp, MatrixType> Derived;
- typedef typename internal::dense_xpr_base< CwiseUnaryView<ViewOp, MatrixType> >::type Base;
+ typedef CwiseUnaryView<ViewOp, MatrixType,StrideType> Derived;
+ typedef typename internal::dense_xpr_base< CwiseUnaryView<ViewOp, MatrixType,StrideType> >::type Base;
EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryViewImpl)
@@ -118,12 +123,16 @@
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index innerStride() const
{
- return derived().nestedExpression().innerStride() * sizeof(typename internal::traits<MatrixType>::Scalar) / sizeof(Scalar);
+ return StrideType::InnerStrideAtCompileTime != 0
+ ? int(StrideType::InnerStrideAtCompileTime)
+ : derived().nestedExpression().innerStride() * sizeof(typename internal::traits<MatrixType>::Scalar) / sizeof(Scalar);
}
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outerStride() const
{
- return derived().nestedExpression().outerStride() * sizeof(typename internal::traits<MatrixType>::Scalar) / sizeof(Scalar);
+ return StrideType::OuterStrideAtCompileTime != 0
+ ? int(StrideType::OuterStrideAtCompileTime)
+ : derived().nestedExpression().outerStride() * sizeof(typename internal::traits<MatrixType>::Scalar) / sizeof(Scalar);
}
protected:
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(CwiseUnaryViewImpl)