Update Eigen to: https://gitlab.com/libeigen/eigen/-/commit/085c2fc5d53f391afcccce21c45e15f61c827ab1
PiperOrigin-RevId: 413516685
Change-Id: Ic07fda17cf8a4055dbd45a128e1106e6781a9301
diff --git a/Eigen/Core b/Eigen/Core
index d6cc162..f6f4e31 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -94,9 +94,7 @@
// for min/max:
#include <algorithm>
-#if EIGEN_HAS_CXX11
#include <array>
-#endif
// for std::is_nothrow_move_assignable
#ifdef EIGEN_INCLUDE_TYPE_TRAITS
diff --git a/Eigen/src/Cholesky/LLT_LAPACKE.h b/Eigen/src/Cholesky/LLT_LAPACKE.h
index 6b2bf28..bde9bcd 100644
--- a/Eigen/src/Cholesky/LLT_LAPACKE.h
+++ b/Eigen/src/Cholesky/LLT_LAPACKE.h
@@ -35,64 +35,119 @@
#include "./InternalHeaderCheck.h"
-namespace Eigen {
+namespace Eigen {
namespace internal {
-template<typename Scalar> struct lapacke_llt;
+namespace lapacke_llt_helpers {
-#define EIGEN_LAPACKE_LLT(EIGTYPE, BLASTYPE, LAPACKE_PREFIX) \
-template<> struct lapacke_llt<EIGTYPE> \
-{ \
- template<typename MatrixType> \
- static inline Index potrf(MatrixType& m, char uplo) \
- { \
- lapack_int matrix_order; \
- lapack_int size, lda, info, StorageOrder; \
- EIGTYPE* a; \
- eigen_assert(m.rows()==m.cols()); \
- /* Set up parameters for ?potrf */ \
- size = convert_index<lapack_int>(m.rows()); \
- StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor; \
- matrix_order = StorageOrder==RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \
- a = &(m.coeffRef(0,0)); \
- lda = convert_index<lapack_int>(m.outerStride()); \
-\
- info = LAPACKE_##LAPACKE_PREFIX##potrf( matrix_order, uplo, size, (BLASTYPE*)a, lda ); \
- info = (info==0) ? -1 : info>0 ? info-1 : size; \
- return info; \
- } \
-}; \
-template<> struct llt_inplace<EIGTYPE, Lower> \
-{ \
- template<typename MatrixType> \
- static Index blocked(MatrixType& m) \
- { \
- return lapacke_llt<EIGTYPE>::potrf(m, 'L'); \
- } \
- template<typename MatrixType, typename VectorType> \
- static Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \
- { return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); } \
-}; \
-template<> struct llt_inplace<EIGTYPE, Upper> \
-{ \
- template<typename MatrixType> \
- static Index blocked(MatrixType& m) \
- { \
- return lapacke_llt<EIGTYPE>::potrf(m, 'U'); \
- } \
- template<typename MatrixType, typename VectorType> \
- static Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \
- { \
- Transpose<MatrixType> matt(mat); \
- return llt_inplace<EIGTYPE, Lower>::rankUpdate(matt, vec.conjugate(), sigma); \
- } \
-};
+ // -------------------------------------------------------------------------------------------------------------------
+ // Translation from Eigen to Lapacke types
+ // -------------------------------------------------------------------------------------------------------------------
-EIGEN_LAPACKE_LLT(double, double, d)
-EIGEN_LAPACKE_LLT(float, float, s)
-EIGEN_LAPACKE_LLT(dcomplex, lapack_complex_double, z)
-EIGEN_LAPACKE_LLT(scomplex, lapack_complex_float, c)
+ // For complex numbers, the types in Eigen and Lapacke are different, but layout compatible.
+ template<typename Scalar> struct translate_type;
+ template<> struct translate_type<float> { using type = float; };
+ template<> struct translate_type<double> { using type = double; };
+ template<> struct translate_type<dcomplex> { using type = lapack_complex_double; };
+ template<> struct translate_type<scomplex> { using type = lapack_complex_float; };
+
+ // -------------------------------------------------------------------------------------------------------------------
+ // Dispatch for potrf handling double, float, complex double, complex float types
+ // -------------------------------------------------------------------------------------------------------------------
+
+ inline lapack_int potrf(lapack_int matrix_order, char uplo, lapack_int size, double* a, lapack_int lda) {
+ return LAPACKE_dpotrf( matrix_order, uplo, size, a, lda );
+ }
+
+ inline lapack_int potrf(lapack_int matrix_order, char uplo, lapack_int size, float* a, lapack_int lda) {
+ return LAPACKE_spotrf( matrix_order, uplo, size, a, lda );
+ }
+
+ inline lapack_int potrf(lapack_int matrix_order, char uplo, lapack_int size, lapack_complex_double* a, lapack_int lda) {
+ return LAPACKE_zpotrf( matrix_order, uplo, size, a, lda );
+ }
+
+ inline lapack_int potrf(lapack_int matrix_order, char uplo, lapack_int size, lapack_complex_float* a, lapack_int lda) {
+ return LAPACKE_cpotrf( matrix_order, uplo, size, a, lda );
+ }
+
+ // -------------------------------------------------------------------------------------------------------------------
+ // Dispatch for rank update handling upper and lower parts
+ // -------------------------------------------------------------------------------------------------------------------
+
+ template<unsigned Mode>
+ struct rank_update {};
+
+ template<>
+ struct rank_update<Lower> {
+ template<typename MatrixType, typename VectorType>
+ static Index run(MatrixType &mat, const VectorType &vec, const typename MatrixType::RealScalar &sigma) {
+ return Eigen::internal::llt_rank_update_lower(mat, vec, sigma);
+ }
+ };
+
+ template<>
+ struct rank_update<Upper> {
+ template<typename MatrixType, typename VectorType>
+ static Index run(MatrixType &mat, const VectorType &vec, const typename MatrixType::RealScalar &sigma) {
+ Transpose<MatrixType> matt(mat);
+ return Eigen::internal::llt_rank_update_lower(matt, vec.conjugate(), sigma);
+ }
+ };
+
+ // -------------------------------------------------------------------------------------------------------------------
+ // Generic lapacke llt implementation that hands of to the dispatches
+ // -------------------------------------------------------------------------------------------------------------------
+
+ template<typename Scalar, unsigned Mode>
+ struct lapacke_llt {
+ using BlasType = typename translate_type<Scalar>::type;
+ template<typename MatrixType>
+ static Index blocked(MatrixType& m)
+ {
+ eigen_assert(m.rows() == m.cols());
+ if(m.rows() == 0) {
+ return -1;
+ }
+
+ /* Set up parameters for ?potrf */
+ lapack_int size = convert_index<lapack_int>(m.rows());
+ lapack_int StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor;
+ lapack_int matrix_order = StorageOrder==RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR;
+ Scalar* a = &(m.coeffRef(0,0));
+ lapack_int lda = convert_index<lapack_int>(m.outerStride());
+
+ lapack_int info = potrf( matrix_order, Mode == Lower ? 'L' : 'U', size, (BlasType*)a, lda );
+ info = (info==0) ? -1 : info>0 ? info-1 : size;
+ return info;
+ }
+
+ template<typename MatrixType, typename VectorType>
+ static Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma)
+ {
+ return rank_update<Mode>::run(mat, vec, sigma);
+ }
+ };
+}
+// end namespace lapacke_llt_helpers
+
+/*
+ * Here, we just put the generic implementation from lapacke_llt into a full specialization of the llt_inplace
+ * type. By being a full specialization, the versions defined here thus get precedence over the generic implementation
+ * in LLT.h for double, float and complex double, complex float types.
+ */
+
+#define EIGEN_LAPACKE_LLT(EIGTYPE) \
+template<> struct llt_inplace<EIGTYPE, Lower> : public lapacke_llt_helpers::lapacke_llt<EIGTYPE, Lower> {}; \
+template<> struct llt_inplace<EIGTYPE, Upper> : public lapacke_llt_helpers::lapacke_llt<EIGTYPE, Upper> {};
+
+EIGEN_LAPACKE_LLT(double)
+EIGEN_LAPACKE_LLT(float)
+EIGEN_LAPACKE_LLT(dcomplex)
+EIGEN_LAPACKE_LLT(scomplex)
+
+#undef EIGEN_LAPACKE_LLT
} // end namespace internal
diff --git a/Eigen/src/Core/ArithmeticSequence.h b/Eigen/src/Core/ArithmeticSequence.h
index 331ff49..1c8b670 100644
--- a/Eigen/src/Core/ArithmeticSequence.h
+++ b/Eigen/src/Core/ArithmeticSequence.h
@@ -16,7 +16,7 @@
namespace internal {
-#if (!EIGEN_HAS_CXX11) || !((!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48)
+#if !((!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48)
template<typename T> struct aseq_negate {};
template<> struct aseq_negate<Index> {
@@ -140,7 +140,7 @@
public:
-#if EIGEN_HAS_CXX11 && ((!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48)
+#if (!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48
auto reverse() const -> decltype(Eigen::seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr)) {
return seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr);
}
@@ -202,7 +202,6 @@
#else // EIGEN_PARSED_BY_DOXYGEN
-#if EIGEN_HAS_CXX11
template<typename FirstType,typename LastType>
auto seq(FirstType f, LastType l) -> decltype(seqN(typename internal::cleanup_index_type<FirstType>::type(f),
( typename internal::cleanup_index_type<LastType>::type(l)
@@ -228,102 +227,11 @@
CleanedIncrType(incr));
}
-#else // EIGEN_HAS_CXX11
-
-template<typename FirstType,typename LastType>
-typename internal::enable_if<!(symbolic::is_symbolic<FirstType>::value || symbolic::is_symbolic<LastType>::value),
- ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,Index> >::type
-seq(FirstType f, LastType l)
-{
- return seqN(typename internal::cleanup_index_type<FirstType>::type(f),
- Index((typename internal::cleanup_index_type<LastType>::type(l)-typename internal::cleanup_index_type<FirstType>::type(f)+fix<1>())));
-}
-
-template<typename FirstTypeDerived,typename LastType>
-typename internal::enable_if<!symbolic::is_symbolic<LastType>::value,
- ArithmeticSequence<FirstTypeDerived, symbolic::AddExpr<symbolic::AddExpr<symbolic::NegateExpr<FirstTypeDerived>,symbolic::ValueExpr<> >,
- symbolic::ValueExpr<internal::FixedInt<1> > > > >::type
-seq(const symbolic::BaseExpr<FirstTypeDerived> &f, LastType l)
-{
- return seqN(f.derived(),(typename internal::cleanup_index_type<LastType>::type(l)-f.derived()+fix<1>()));
-}
-
-template<typename FirstType,typename LastTypeDerived>
-typename internal::enable_if<!symbolic::is_symbolic<FirstType>::value,
- ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
- symbolic::AddExpr<symbolic::AddExpr<LastTypeDerived,symbolic::ValueExpr<> >,
- symbolic::ValueExpr<internal::FixedInt<1> > > > >::type
-seq(FirstType f, const symbolic::BaseExpr<LastTypeDerived> &l)
-{
- return seqN(typename internal::cleanup_index_type<FirstType>::type(f),(l.derived()-typename internal::cleanup_index_type<FirstType>::type(f)+fix<1>()));
-}
-
-template<typename FirstTypeDerived,typename LastTypeDerived>
-ArithmeticSequence<FirstTypeDerived,
- symbolic::AddExpr<symbolic::AddExpr<LastTypeDerived,symbolic::NegateExpr<FirstTypeDerived> >,symbolic::ValueExpr<internal::FixedInt<1> > > >
-seq(const symbolic::BaseExpr<FirstTypeDerived> &f, const symbolic::BaseExpr<LastTypeDerived> &l)
-{
- return seqN(f.derived(),(l.derived()-f.derived()+fix<1>()));
-}
-
-
-template<typename FirstType,typename LastType, typename IncrType>
-typename internal::enable_if<!(symbolic::is_symbolic<FirstType>::value || symbolic::is_symbolic<LastType>::value),
- ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,Index,typename internal::cleanup_seq_incr<IncrType>::type> >::type
-seq(FirstType f, LastType l, IncrType incr)
-{
- typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
- return seqN(typename internal::cleanup_index_type<FirstType>::type(f),
- Index((typename internal::cleanup_index_type<LastType>::type(l)-typename internal::cleanup_index_type<FirstType>::type(f)+CleanedIncrType(incr))/CleanedIncrType(incr)), incr);
-}
-
-template<typename FirstTypeDerived,typename LastType, typename IncrType>
-typename internal::enable_if<!symbolic::is_symbolic<LastType>::value,
- ArithmeticSequence<FirstTypeDerived,
- symbolic::QuotientExpr<symbolic::AddExpr<symbolic::AddExpr<symbolic::NegateExpr<FirstTypeDerived>,
- symbolic::ValueExpr<> >,
- symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
- symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
- typename internal::cleanup_seq_incr<IncrType>::type> >::type
-seq(const symbolic::BaseExpr<FirstTypeDerived> &f, LastType l, IncrType incr)
-{
- typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
- return seqN(f.derived(),(typename internal::cleanup_index_type<LastType>::type(l)-f.derived()+CleanedIncrType(incr))/CleanedIncrType(incr), incr);
-}
-
-template<typename FirstType,typename LastTypeDerived, typename IncrType>
-typename internal::enable_if<!symbolic::is_symbolic<FirstType>::value,
- ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
- symbolic::QuotientExpr<symbolic::AddExpr<symbolic::AddExpr<LastTypeDerived,symbolic::ValueExpr<> >,
- symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
- symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
- typename internal::cleanup_seq_incr<IncrType>::type> >::type
-seq(FirstType f, const symbolic::BaseExpr<LastTypeDerived> &l, IncrType incr)
-{
- typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
- return seqN(typename internal::cleanup_index_type<FirstType>::type(f),
- (l.derived()-typename internal::cleanup_index_type<FirstType>::type(f)+CleanedIncrType(incr))/CleanedIncrType(incr), incr);
-}
-
-template<typename FirstTypeDerived,typename LastTypeDerived, typename IncrType>
-ArithmeticSequence<FirstTypeDerived,
- symbolic::QuotientExpr<symbolic::AddExpr<symbolic::AddExpr<LastTypeDerived,
- symbolic::NegateExpr<FirstTypeDerived> >,
- symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
- symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
- typename internal::cleanup_seq_incr<IncrType>::type>
-seq(const symbolic::BaseExpr<FirstTypeDerived> &f, const symbolic::BaseExpr<LastTypeDerived> &l, IncrType incr)
-{
- typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
- return seqN(f.derived(),(l.derived()-f.derived()+CleanedIncrType(incr))/CleanedIncrType(incr), incr);
-}
-#endif // EIGEN_HAS_CXX11
#endif // EIGEN_PARSED_BY_DOXYGEN
namespace placeholders {
-#if EIGEN_HAS_CXX11 || defined(EIGEN_PARSED_BY_DOXYGEN)
/** \cpp11
* \returns a symbolic ArithmeticSequence representing the last \a size elements with increment \a incr.
*
@@ -349,7 +257,6 @@
{
return seqN(Eigen::placeholders::last+fix<1>()-size, size);
}
-#endif
} // namespace placeholders
@@ -407,9 +314,7 @@
using Eigen::seqN;
using Eigen::placeholders::all;
using Eigen::placeholders::last;
- #if EIGEN_HAS_CXX11
using Eigen::placeholders::lastN;
- #endif
using Eigen::placeholders::lastp1;
}
diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h
index c39aa15..b652852 100644
--- a/Eigen/src/Core/Array.h
+++ b/Eigen/src/Core/Array.h
@@ -147,7 +147,6 @@
}
#endif
-#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
Array(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value)
: Base(std::move(other))
@@ -159,9 +158,7 @@
Base::operator=(std::move(other));
return *this;
}
-#endif
- #if EIGEN_HAS_CXX11
/** \copydoc PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)
*
* Example: \include Array_variadic_ctor_cxx11.cpp
@@ -198,7 +195,6 @@
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
- #endif // end EIGEN_HAS_CXX11
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<typename T>
@@ -354,8 +350,6 @@
#undef EIGEN_MAKE_ARRAY_TYPEDEFS
#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS
-#if EIGEN_HAS_CXX11
-
#define EIGEN_MAKE_ARRAY_TYPEDEFS(Size, SizeSuffix) \
/** \ingroup arraytypedefs */ \
/** \brief \cpp11 */ \
@@ -387,8 +381,6 @@
#undef EIGEN_MAKE_ARRAY_TYPEDEFS
#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS
-#endif // EIGEN_HAS_CXX11
-
#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \
using Eigen::Matrix##SizeSuffix##TypeSuffix; \
using Eigen::Vector##SizeSuffix##TypeSuffix; \
diff --git a/Eigen/src/Core/BooleanRedux.h b/Eigen/src/Core/BooleanRedux.h
index 9689ca3..78939a6 100644
--- a/Eigen/src/Core/BooleanRedux.h
+++ b/Eigen/src/Core/BooleanRedux.h
@@ -136,7 +136,7 @@
* \sa allFinite()
*/
template<typename Derived>
-inline bool DenseBase<Derived>::hasNaN() const
+EIGEN_DEVICE_FUNC inline bool DenseBase<Derived>::hasNaN() const
{
#if EIGEN_COMP_MSVC || (defined __FAST_MATH__)
return derived().array().isNaN().any();
@@ -150,7 +150,7 @@
* \sa hasNaN()
*/
template<typename Derived>
-inline bool DenseBase<Derived>::allFinite() const
+EIGEN_DEVICE_FUNC inline bool DenseBase<Derived>::allFinite() const
{
#if EIGEN_COMP_MSVC || (defined __FAST_MATH__)
return derived().array().isFinite().all();
diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h
index 98fdabb..a3828d1 100644
--- a/Eigen/src/Core/CwiseBinaryOp.h
+++ b/Eigen/src/Core/CwiseBinaryOp.h
@@ -105,7 +105,7 @@
typedef typename internal::remove_reference<LhsNested>::type _LhsNested;
typedef typename internal::remove_reference<RhsNested>::type _RhsNested;
-#if EIGEN_COMP_MSVC && EIGEN_HAS_CXX11
+#if EIGEN_COMP_MSVC
//Required for Visual Studio or the Copy constructor will probably not get inlined!
EIGEN_STRONG_INLINE
CwiseBinaryOp(const CwiseBinaryOp<BinaryOp,LhsType,RhsType>&) = default;
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h
index 940eabd..439322d 100644
--- a/Eigen/src/Core/DenseBase.h
+++ b/Eigen/src/Core/DenseBase.h
@@ -204,11 +204,6 @@
typedef typename internal::conditional<internal::is_same<typename internal::traits<Derived>::XprKind,MatrixXpr >::value,
PlainMatrix, PlainArray>::type PlainObject;
- /** \returns the number of nonzero coefficients which is in practice the number
- * of stored coefficients. */
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- inline Index nonZeros() const { return size(); }
-
/** \returns the outer size.
*
* \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension
@@ -382,8 +377,8 @@
EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
- inline bool hasNaN() const;
- inline bool allFinite() const;
+ EIGEN_DEVICE_FUNC inline bool hasNaN() const;
+ EIGEN_DEVICE_FUNC inline bool allFinite() const;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Derived& operator*=(const Scalar& other);
diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h
index 19a6980..04afd72 100644
--- a/Eigen/src/Core/DenseStorage.h
+++ b/Eigen/src/Core/DenseStorage.h
@@ -216,7 +216,7 @@
EIGEN_DEVICE_FUNC
explicit DenseStorage(internal::constructor_without_unaligned_array_assert)
: m_data(internal::constructor_without_unaligned_array_assert()) {}
-#if !EIGEN_HAS_CXX11 || defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN)
+#if defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN)
EIGEN_DEVICE_FUNC
DenseStorage(const DenseStorage& other) : m_data(other.m_data) {
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size)
@@ -224,33 +224,9 @@
#else
EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage&) = default;
#endif
-#if !EIGEN_HAS_CXX11
- EIGEN_DEVICE_FUNC
- DenseStorage& operator=(const DenseStorage& other)
- {
- if (this != &other) m_data = other.m_data;
- return *this;
- }
-#else
EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage&) = default;
-#endif
-#if EIGEN_HAS_RVALUE_REFERENCES
-#if !EIGEN_HAS_CXX11
- EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
- : m_data(std::move(other.m_data))
- {
- }
- EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT
- {
- if (this != &other)
- m_data = std::move(other.m_data);
- return *this;
- }
-#else
EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&&) = default;
EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&&) = default;
-#endif
-#endif
EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) {
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
eigen_internal_assert(size==rows*cols && rows==Rows_ && cols==Cols_);
@@ -444,7 +420,6 @@
}
return *this;
}
-#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
: m_data(std::move(other.m_data))
@@ -463,7 +438,6 @@
numext::swap(m_cols, other.m_cols);
return *this;
}
-#endif
EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, m_rows*m_cols); }
EIGEN_DEVICE_FUNC void swap(DenseStorage& other)
{
@@ -527,7 +501,6 @@
}
return *this;
}
-#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
: m_data(std::move(other.m_data))
@@ -543,7 +516,6 @@
numext::swap(m_cols, other.m_cols);
return *this;
}
-#endif
EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Rows_*m_cols); }
EIGEN_DEVICE_FUNC void swap(DenseStorage& other) {
numext::swap(m_data,other.m_data);
@@ -603,7 +575,6 @@
}
return *this;
}
-#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
: m_data(std::move(other.m_data))
@@ -619,7 +590,6 @@
numext::swap(m_rows, other.m_rows);
return *this;
}
-#endif
EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, Cols_*m_rows); }
EIGEN_DEVICE_FUNC void swap(DenseStorage& other) {
numext::swap(m_data,other.m_data);
diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h
index cf5e906..d5053d6 100644
--- a/Eigen/src/Core/DiagonalMatrix.h
+++ b/Eigen/src/Core/DiagonalMatrix.h
@@ -180,7 +180,6 @@
EIGEN_DEVICE_FUNC
inline DiagonalMatrix(const Scalar& x, const Scalar& y, const Scalar& z) : m_diagonal(x,y,z) {}
- #if EIGEN_HAS_CXX11
/** \brief Construct a diagonal matrix with fixed size from an arbitrary number of coefficients. \cpp11
*
* There exists C++98 anologue constructors for fixed-size diagonal matrices having 2 or 3 coefficients.
@@ -202,7 +201,6 @@
EIGEN_DEVICE_FUNC
explicit EIGEN_STRONG_INLINE DiagonalMatrix(const std::initializer_list<std::initializer_list<Scalar>>& list)
: m_diagonal(list) {}
- #endif // EIGEN_HAS_CXX11
/** Copy constructor. */
template<typename OtherDerived>
diff --git a/Eigen/src/Core/IndexedView.h b/Eigen/src/Core/IndexedView.h
index 51e28b9..d27ec80 100644
--- a/Eigen/src/Core/IndexedView.h
+++ b/Eigen/src/Core/IndexedView.h
@@ -23,8 +23,8 @@
enum {
RowsAtCompileTime = int(array_size<RowIndices>::value),
ColsAtCompileTime = int(array_size<ColIndices>::value),
- MaxRowsAtCompileTime = RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime) : Dynamic,
- MaxColsAtCompileTime = ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime) : Dynamic,
+ MaxRowsAtCompileTime = RowsAtCompileTime,
+ MaxColsAtCompileTime = ColsAtCompileTime,
XprTypeIsRowMajor = (int(traits<XprType>::Flags)&RowMajorBit) != 0,
IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1
@@ -44,8 +44,8 @@
IsBlockAlike = InnerIncr==1 && OuterIncr==1,
IsInnerPannel = HasSameStorageOrderAsXprType && is_same<AllRange<InnerSize>,typename conditional<XprTypeIsRowMajor,ColIndices,RowIndices>::type>::value,
- InnerStrideAtCompileTime = InnerIncr<0 || InnerIncr==DynamicIndex || XprInnerStride==Dynamic ? Dynamic : XprInnerStride * InnerIncr,
- OuterStrideAtCompileTime = OuterIncr<0 || OuterIncr==DynamicIndex || XprOuterstride==Dynamic ? Dynamic : XprOuterstride * OuterIncr,
+ InnerStrideAtCompileTime = InnerIncr<0 || InnerIncr==DynamicIndex || XprInnerStride==Dynamic || InnerIncr==UndefinedIncr ? Dynamic : XprInnerStride * InnerIncr,
+ OuterStrideAtCompileTime = OuterIncr<0 || OuterIncr==DynamicIndex || XprOuterstride==Dynamic || OuterIncr==UndefinedIncr ? Dynamic : XprOuterstride * OuterIncr,
ReturnAsScalar = is_same<RowIndices,SingleRange>::value && is_same<ColIndices,SingleRange>::value,
ReturnAsBlock = (!ReturnAsScalar) && IsBlockAlike,
diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h
index bc75a28..44c0e25 100644
--- a/Eigen/src/Core/Matrix.h
+++ b/Eigen/src/Core/Matrix.h
@@ -269,7 +269,6 @@
: Base(internal::constructor_without_unaligned_array_assert())
{ EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
-#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Matrix(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value)
: Base(std::move(other)) {}
@@ -279,9 +278,7 @@
Base::operator=(std::move(other));
return *this;
}
-#endif
-#if EIGEN_HAS_CXX11
/** \copydoc PlainObjectBase(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&... args)
*
* Example: \include Matrix_variadic_ctor_cxx11.cpp
@@ -317,7 +314,6 @@
*/
EIGEN_DEVICE_FUNC
explicit EIGEN_STRONG_INLINE Matrix(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
-#endif // end EIGEN_HAS_CXX11
#ifndef EIGEN_PARSED_BY_DOXYGEN
@@ -505,8 +501,6 @@
#undef EIGEN_MAKE_TYPEDEFS
#undef EIGEN_MAKE_FIXED_TYPEDEFS
-#if EIGEN_HAS_CXX11
-
#define EIGEN_MAKE_TYPEDEFS(Size, SizeSuffix) \
/** \ingroup matrixtypedefs */ \
/** \brief \cpp11 */ \
@@ -552,8 +546,6 @@
#undef EIGEN_MAKE_TYPEDEFS
#undef EIGEN_MAKE_FIXED_TYPEDEFS
-#endif // EIGEN_HAS_CXX11
-
} // end namespace Eigen
#endif // EIGEN_MATRIX_H
diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h
index 607e1c8..89960b9 100644
--- a/Eigen/src/Core/PlainObjectBase.h
+++ b/Eigen/src/Core/PlainObjectBase.h
@@ -501,7 +501,6 @@
}
#endif
-#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
PlainObjectBase(PlainObjectBase&& other) EIGEN_NOEXCEPT
: m_storage( std::move(other.m_storage) )
@@ -514,7 +513,6 @@
m_storage = std::move(other.m_storage);
return *this;
}
-#endif
/** Copy constructor */
EIGEN_DEVICE_FUNC
@@ -527,7 +525,6 @@
// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
}
- #if EIGEN_HAS_CXX11
/** \brief Construct a row of column vector with fixed size from an arbitrary number of coefficients. \cpp11
*
* \only_for_vectors
@@ -587,7 +584,6 @@
}
}
}
- #endif // end EIGEN_HAS_CXX11
/** \sa PlainObjectBase::operator=(const EigenBase<OtherDerived>&) */
template<typename OtherDerived>
diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h
index 97c2a19..6b11247 100644
--- a/Eigen/src/Core/SelfAdjointView.h
+++ b/Eigen/src/Core/SelfAdjointView.h
@@ -218,10 +218,10 @@
typedef SelfAdjointView<typename MatrixType::TransposeReturnType,TransposeMode> TransposeReturnType;
/** \sa MatrixBase::transpose() */
+ template<class Dummy=int>
EIGEN_DEVICE_FUNC
- inline TransposeReturnType transpose()
+ inline TransposeReturnType transpose(typename internal::enable_if<Eigen::internal::is_lvalue<MatrixType>::value, Dummy*>::type = nullptr)
{
- EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
typename MatrixType::TransposeReturnType tmp(m_matrix);
return TransposeReturnType(tmp);
}
diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h
index e9a4cae..9376a79 100644
--- a/Eigen/src/Core/TriangularMatrix.h
+++ b/Eigen/src/Core/TriangularMatrix.h
@@ -264,10 +264,10 @@
typedef TriangularView<typename MatrixType::TransposeReturnType,TransposeMode> TransposeReturnType;
/** \sa MatrixBase::transpose() */
+ template<class Dummy=int>
EIGEN_DEVICE_FUNC
- inline TransposeReturnType transpose()
+ inline TransposeReturnType transpose(typename internal::enable_if<Eigen::internal::is_lvalue<MatrixType>::value, Dummy*>::type = nullptr)
{
- EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
typename MatrixType::TransposeReturnType tmp(m_matrix);
return TransposeReturnType(tmp);
}
diff --git a/Eigen/src/Core/functors/StlFunctors.h b/Eigen/src/Core/functors/StlFunctors.h
index dbb3854..5971075 100644
--- a/Eigen/src/Core/functors/StlFunctors.h
+++ b/Eigen/src/Core/functors/StlFunctors.h
@@ -104,17 +104,6 @@
struct functor_traits<numext::not_equal_to<T> >
: functor_traits<std::not_equal_to<T> > {};
-#if (EIGEN_COMP_CXXVER < 11)
-// std::binder* are deprecated since c++11 and will be removed in c++17
-template<typename T>
-struct functor_traits<std::binder2nd<T> >
-{ enum { Cost = functor_traits<T>::Cost, PacketAccess = false }; };
-
-template<typename T>
-struct functor_traits<std::binder1st<T> >
-{ enum { Cost = functor_traits<T>::Cost, PacketAccess = false }; };
-#endif
-
#if (EIGEN_COMP_CXXVER < 17)
// std::unary_negate is deprecated since c++17 and will be removed in c++20
template<typename T>
diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h
index 72e094e..007c71e 100644
--- a/Eigen/src/Core/products/GeneralMatrixMatrix.h
+++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h
@@ -150,9 +150,6 @@
// Release all the sub blocks A'_i of A' for the current thread,
// i.e., we simply decrement the number of users by 1
for(Index i=0; i<threads; ++i)
-#if !EIGEN_HAS_CXX11_ATOMIC
- #pragma omp atomic
-#endif
info[i].users -= 1;
}
}
diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h
index c046ba3..d38d3da 100644
--- a/Eigen/src/Core/products/Parallelizer.h
+++ b/Eigen/src/Core/products/Parallelizer.h
@@ -10,9 +10,7 @@
#ifndef EIGEN_PARALLELIZER_H
#define EIGEN_PARALLELIZER_H
-#if EIGEN_HAS_CXX11_ATOMIC
#include <atomic>
-#endif
#include "../InternalHeaderCheck.h"
@@ -86,13 +84,8 @@
// to guarantee that when thread A says to thread B that it is
// done with packing a block, then all writes have been really
// carried out... C++11 memory model+atomic guarantees this.
-#if EIGEN_HAS_CXX11_ATOMIC
std::atomic<Index> sync;
std::atomic<int> users;
-#else
- Index volatile sync;
- int volatile users;
-#endif
Index lhs_start;
Index lhs_length;
@@ -106,7 +99,7 @@
// Without C++11, we have to disable GEMM's parallelization on
// non x86 architectures because there volatile is not enough for our purpose.
// See bug 1572.
-#if (! defined(EIGEN_HAS_OPENMP)) || defined(EIGEN_USE_BLAS) || ((!EIGEN_HAS_CXX11_ATOMIC) && !(EIGEN_ARCH_i386_OR_x86_64))
+#if (! defined(EIGEN_HAS_OPENMP)) || defined(EIGEN_USE_BLAS)
// FIXME the transpose variable is only needed to properly split
// the matrix product when multithreading is enabled. This is a temporary
// fix to support row-major destination matrices. This whole
diff --git a/Eigen/src/Core/util/ConfigureVectorization.h b/Eigen/src/Core/util/ConfigureVectorization.h
index dd6d451..16ca3ef 100644
--- a/Eigen/src/Core/util/ConfigureVectorization.h
+++ b/Eigen/src/Core/util/ConfigureVectorization.h
@@ -116,7 +116,6 @@
// static alignment is completely disabled with GCC 3, Sun Studio, and QCC/QNX
#if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT \
- && !EIGEN_GCC3_OR_OLDER \
&& !EIGEN_COMP_SUNCC \
&& !EIGEN_OS_QNX
#define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1
diff --git a/Eigen/src/Core/util/IntegralConstant.h b/Eigen/src/Core/util/IntegralConstant.h
index ddcd370..0a9990c 100644
--- a/Eigen/src/Core/util/IntegralConstant.h
+++ b/Eigen/src/Core/util/IntegralConstant.h
@@ -88,9 +88,7 @@
FixedInt ( FixedInt<N> (*)() ) {}
#endif
-#if EIGEN_HAS_CXX11
FixedInt(std::integral_constant<int,N>) {}
-#endif
};
/** \internal
@@ -178,9 +176,7 @@
// If VariableAndFixedInt matches DynamicKey, then we turn it to a pure runtime-value (aka Index):
template<int DynamicKey> struct cleanup_index_type<VariableAndFixedInt<DynamicKey>, DynamicKey> { typedef Index type; };
-#if EIGEN_HAS_CXX11
template<int N, int DynamicKey> struct cleanup_index_type<std::integral_constant<int,N>, DynamicKey> { typedef FixedInt<N> type; };
-#endif
} // end namespace internal
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index bd9f13e..c5cbf73 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -10,7 +10,6 @@
#ifndef EIGEN_MACROS_H
#define EIGEN_MACROS_H
-
#include "../InternalHeaderCheck.h"
//------------------------------------------------------------------------------------------
@@ -218,14 +217,6 @@
#define EIGEN_GNUC_AT(x,y) 0
#endif
-// FIXME: could probably be removed as we do not support gcc 3.x anymore
-#if EIGEN_COMP_GNUC && (__GNUC__ <= 3)
-#define EIGEN_GCC3_OR_OLDER 1
-#else
-#define EIGEN_GCC3_OR_OLDER 0
-#endif
-
-
//------------------------------------------------------------------------------------------
// Architecture identification, EIGEN_ARCH_*
@@ -581,13 +572,6 @@
// Detect Compiler/Architecture/OS specific features
//------------------------------------------------------------------------------------------
-#if EIGEN_GNUC_AT_MOST(4,3) && !EIGEN_COMP_CLANG
- // see bug 89
- #define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 0
-#else
- #define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 1
-#endif
-
// Cross compiler wrapper around LLVM's __has_builtin
#ifdef __has_builtin
# define EIGEN_HAS_BUILTIN(x) __has_builtin(x)
@@ -656,11 +640,9 @@
// but in practice we should not rely on them but rather on the availability of
// individual features as defined later.
// This is why there is no EIGEN_HAS_CXX17.
-// FIXME: get rid of EIGEN_HAS_CXX14 and maybe even EIGEN_HAS_CXX11.
-#if EIGEN_MAX_CPP_VER>=11 && EIGEN_COMP_CXXVER>=11
-#define EIGEN_HAS_CXX11 1
-#else
-#define EIGEN_HAS_CXX11 0
+// FIXME: get rid of EIGEN_HAS_CXX14.
+#if EIGEN_MAX_CPP_VER<11 || EIGEN_COMP_CXXVER<11 || (EIGEN_COMP_MSVC && EIGEN_COMP_MSVC < 1700) || (EIGEN_COMP_ICC && EIGEN_COMP_ICC < 1400)
+#error This compiler appears to be too old to be supported by Eigen
#endif
#if EIGEN_MAX_CPP_VER>=14 && EIGEN_COMP_CXXVER>=14
@@ -669,23 +651,11 @@
#define EIGEN_HAS_CXX14 0
#endif
-// Do we support r-value references?
-#ifndef EIGEN_HAS_RVALUE_REFERENCES
-#if EIGEN_MAX_CPP_VER>=11 && \
- (__has_feature(cxx_rvalue_references) || \
- (EIGEN_COMP_CXXVER >= 11) || (EIGEN_COMP_MSVC >= 1600))
- #define EIGEN_HAS_RVALUE_REFERENCES 1
-#else
- #define EIGEN_HAS_RVALUE_REFERENCES 0
-#endif
-#endif
-
// Does the compiler support C99?
// Need to include <cmath> to make sure _GLIBCXX_USE_C99 gets defined
#include <cmath>
#ifndef EIGEN_HAS_C99_MATH
-#if EIGEN_MAX_CPP_VER>=11 && \
- ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \
+#if ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \
|| (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \
|| (defined(_LIBCPP_VERSION) && !defined(_MSC_VER)) \
|| (EIGEN_COMP_MSVC >= 1900) || defined(SYCL_DEVICE_ONLY))
@@ -698,7 +668,7 @@
// Does the compiler support result_of?
// result_of was deprecated in c++17 and removed in c++ 20
#ifndef EIGEN_HAS_STD_RESULT_OF
-#if EIGEN_HAS_CXX11 && EIGEN_COMP_CXXVER < 17
+#if EIGEN_COMP_CXXVER < 17
#define EIGEN_HAS_STD_RESULT_OF 1
#else
#define EIGEN_HAS_STD_RESULT_OF 0
@@ -709,7 +679,7 @@
#ifndef EIGEN_HAS_STD_HASH
// The std::hash struct is defined in C++11 but is not labelled as a __device__
// function and is not constexpr, so cannot be used on device.
-#if EIGEN_HAS_CXX11 && !defined(EIGEN_GPU_COMPILE_PHASE)
+#if !defined(EIGEN_GPU_COMPILE_PHASE)
#define EIGEN_HAS_STD_HASH 1
#else
#define EIGEN_HAS_STD_HASH 0
@@ -725,8 +695,7 @@
#endif
#ifndef EIGEN_HAS_ALIGNAS
-#if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \
- ( __has_feature(cxx_alignas) \
+#if ( __has_feature(cxx_alignas) \
|| EIGEN_HAS_CXX14 \
|| (EIGEN_COMP_MSVC >= 1800) \
|| (EIGEN_GNUC_AT_LEAST(4,8)) \
@@ -744,8 +713,7 @@
// - full support of type traits was added only to GCC 5.1.0.
// - 20150626 corresponds to the last release of 4.x libstdc++
#ifndef EIGEN_HAS_TYPE_TRAITS
-#if EIGEN_MAX_CPP_VER>=11 && (EIGEN_HAS_CXX11 || EIGEN_COMP_MSVC >= 1700) \
- && ((!EIGEN_COMP_GNUC_STRICT) || EIGEN_GNUC_AT_LEAST(5, 1)) \
+#if ((!EIGEN_COMP_GNUC_STRICT) || EIGEN_GNUC_AT_LEAST(5, 1)) \
&& ((!defined(__GLIBCXX__)) || __GLIBCXX__ > 20150626)
#define EIGEN_HAS_TYPE_TRAITS 1
#define EIGEN_INCLUDE_TYPE_TRAITS
@@ -756,12 +724,11 @@
// Does the compiler support variadic templates?
#ifndef EIGEN_HAS_VARIADIC_TEMPLATES
-#if EIGEN_MAX_CPP_VER>=11 && (EIGEN_COMP_CXXVER >= 11) \
- && (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (EIGEN_COMP_NVCC >= 80000) )
+#if (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (EIGEN_COMP_NVCC >= 80000) )
// ^^ Disable the use of variadic templates when compiling with versions of nvcc older than 8.0 on ARM devices:
// this prevents nvcc from crashing when compiling Eigen on Tegra X1
#define EIGEN_HAS_VARIADIC_TEMPLATES 1
-#elif EIGEN_MAX_CPP_VER>=11 && (EIGEN_COMP_CXXVER >= 11) && defined(SYCL_DEVICE_ONLY)
+#elif defined(SYCL_DEVICE_ONLY)
#define EIGEN_HAS_VARIADIC_TEMPLATES 1
#else
#define EIGEN_HAS_VARIADIC_TEMPLATES 0
@@ -772,7 +739,7 @@
#ifndef EIGEN_HAS_CONSTEXPR
#if defined(EIGEN_CUDACC)
// Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above
- #if EIGEN_MAX_CPP_VER>=14 && (EIGEN_COMP_CXXVER >= 11 && (EIGEN_COMP_CLANG || EIGEN_COMP_NVCC >= 70500))
+ #if EIGEN_MAX_CPP_VER>=14 && (EIGEN_COMP_CLANG || EIGEN_COMP_NVCC >= 70500)
#define EIGEN_HAS_CONSTEXPR 1
#endif
#elif EIGEN_MAX_CPP_VER>=14 && (__has_feature(cxx_relaxed_constexpr) || (EIGEN_COMP_CXXVER >= 14) || \
@@ -796,7 +763,7 @@
// Does the compiler support C++11 math?
// Let's be conservative and enable the default C++11 implementation only if we are sure it exists
#ifndef EIGEN_HAS_CXX11_MATH
- #if EIGEN_MAX_CPP_VER>=11 && ((EIGEN_COMP_CXXVER > 11) || (EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \
+ #if ((EIGEN_COMP_CXXVER > 11) || (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \
&& (EIGEN_ARCH_i386_OR_x86_64) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC))
#define EIGEN_HAS_CXX11_MATH 1
#else
@@ -804,49 +771,6 @@
#endif
#endif
-// Does the compiler support proper C++11 containers?
-#ifndef EIGEN_HAS_CXX11_CONTAINERS
- #if EIGEN_MAX_CPP_VER>=11 && \
- ((EIGEN_COMP_CXXVER > 11) \
- || ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC>=1400)))
- #define EIGEN_HAS_CXX11_CONTAINERS 1
- #else
- #define EIGEN_HAS_CXX11_CONTAINERS 0
- #endif
-#endif
-
-// Does the compiler support C++11 noexcept?
-#ifndef EIGEN_HAS_CXX11_NOEXCEPT
- #if EIGEN_MAX_CPP_VER>=11 && \
- (__has_feature(cxx_noexcept) \
- || (EIGEN_COMP_CXXVER > 11) \
- || ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC>=1400)))
- #define EIGEN_HAS_CXX11_NOEXCEPT 1
- #else
- #define EIGEN_HAS_CXX11_NOEXCEPT 0
- #endif
-#endif
-
-#ifndef EIGEN_HAS_CXX11_ATOMIC
- #if EIGEN_MAX_CPP_VER>=11 && \
- (__has_feature(cxx_atomic) \
- || (EIGEN_COMP_CXXVER > 11) \
- || ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_MSVC==0 || EIGEN_COMP_MSVC >= 1700)))
- #define EIGEN_HAS_CXX11_ATOMIC 1
- #else
- #define EIGEN_HAS_CXX11_ATOMIC 0
- #endif
-#endif
-
-#ifndef EIGEN_HAS_CXX11_OVERRIDE_FINAL
- #if EIGEN_MAX_CPP_VER>=11 && \
- (EIGEN_COMP_CXXVER >= 11 || EIGEN_COMP_MSVC >= 1700)
- #define EIGEN_HAS_CXX11_OVERRIDE_FINAL 1
- #else
- #define EIGEN_HAS_CXX11_OVERRIDE_FINAL 0
- #endif
-#endif
-
// NOTE: the required Apple's clang version is very conservative
// and it could be that XCode 9 works just fine.
// NOTE: the MSVC version is based on https://en.cppreference.com/w/cpp/compiler_support
@@ -1004,38 +928,12 @@
#define eigen_plain_assert(x)
#endif
#else
- #if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO
namespace Eigen {
namespace internal {
inline bool copy_bool(bool b) { return b; }
}
}
#define eigen_plain_assert(x) assert(x)
- #else
- // work around bug 89
- #include <cstdlib> // for abort
- #include <iostream> // for std::cerr
-
- namespace Eigen {
- namespace internal {
- // trivial function copying a bool. Must be EIGEN_DONT_INLINE, so we implement it after including Eigen headers.
- // see bug 89.
- namespace {
- EIGEN_DONT_INLINE bool copy_bool(bool b) { return b; }
- }
- inline void assert_fail(const char *condition, const char *function, const char *file, int line)
- {
- std::cerr << "assertion failed: " << condition << " in function " << function << " at " << file << ":" << line << std::endl;
- abort();
- }
- }
- }
- #define eigen_plain_assert(x) \
- do { \
- if(!Eigen::internal::copy_bool(x)) \
- Eigen::internal::assert_fail(EIGEN_MAKESTRING(x), __PRETTY_FUNCTION__, __FILE__, __LINE__); \
- } while(false)
- #endif
#endif
// eigen_assert can be overridden
@@ -1230,11 +1128,7 @@
* \brief Macro to explicitly define the default copy constructor.
* This is necessary, because the implicit definition is deprecated if the copy-assignment is overridden.
*/
-#if EIGEN_HAS_CXX11
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) EIGEN_DEVICE_FUNC CLASS(const CLASS&) = default;
-#else
-#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
-#endif
@@ -1254,15 +1148,9 @@
*
* Hiding the default destructor lead to problems in C++03 mode together with boost::multiprecision
*/
-#if EIGEN_HAS_CXX11
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
EIGEN_DEVICE_FUNC Derived() = default; \
EIGEN_DEVICE_FUNC ~Derived() = default;
-#else
-#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
- EIGEN_DEVICE_FUNC Derived() {}; \
- /* EIGEN_DEVICE_FUNC ~Derived() {}; */
-#endif
@@ -1423,24 +1311,12 @@
#endif
-#if EIGEN_HAS_CXX11_NOEXCEPT
-# define EIGEN_INCLUDE_TYPE_TRAITS
-# define EIGEN_NOEXCEPT noexcept
-# define EIGEN_NOEXCEPT_IF(x) noexcept(x)
-# define EIGEN_NO_THROW noexcept(true)
-# define EIGEN_EXCEPTION_SPEC(X) noexcept(false)
-#else
-# define EIGEN_NOEXCEPT
-# define EIGEN_NOEXCEPT_IF(x)
-# define EIGEN_NO_THROW throw()
-# if EIGEN_COMP_MSVC || EIGEN_COMP_CXXVER>=17
- // MSVC does not support exception specifications (warning C4290),
- // and they are deprecated in c++11 anyway. This is even an error in c++17.
-# define EIGEN_EXCEPTION_SPEC(X) throw()
-# else
-# define EIGEN_EXCEPTION_SPEC(X) throw(X)
-# endif
-#endif
+#define EIGEN_INCLUDE_TYPE_TRAITS
+#define EIGEN_NOEXCEPT noexcept
+#define EIGEN_NOEXCEPT_IF(x) noexcept(x)
+#define EIGEN_NO_THROW noexcept(true)
+#define EIGEN_EXCEPTION_SPEC(X) noexcept(false)
+
#if EIGEN_HAS_VARIADIC_TEMPLATES
// The all function is used to enable a variadic version of eigen_assert which can take a parameter pack as its input.
@@ -1456,14 +1332,9 @@
}
#endif
-#if EIGEN_HAS_CXX11_OVERRIDE_FINAL
// provide override and final specifiers if they are available:
-# define EIGEN_OVERRIDE override
-# define EIGEN_FINAL final
-#else
-# define EIGEN_OVERRIDE
-# define EIGEN_FINAL
-#endif
+#define EIGEN_OVERRIDE override
+#define EIGEN_FINAL final
// Wrapping #pragma unroll in a macro since it is required for SYCL
#if defined(SYCL_DEVICE_ONLY)
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index 909d00e..5211d04 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -568,17 +568,10 @@
}
};
-#if EIGEN_HAS_RVALUE_REFERENCES
template<typename T> EIGEN_DEVICE_FUNC T* smart_move(T* start, T* end, T* target)
{
return std::move(start, end, target);
}
-#else
-template<typename T> EIGEN_DEVICE_FUNC T* smart_move(T* start, T* end, T* target)
-{
- return std::copy(start, end, target);
-}
-#endif
/*****************************************************************************
*** Implementation of runtime stack allocation (falling back to malloc) ***
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
index 26a6ea4..f2c4dfe 100755
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -28,10 +28,9 @@
#endif
// Recent versions of ICC require <cstdint> for pointer types below.
-#define EIGEN_ICC_NEEDS_CSTDINT (EIGEN_COMP_ICC>=1600 && EIGEN_COMP_CXXVER >= 11)
+#define EIGEN_ICC_NEEDS_CSTDINT (EIGEN_COMP_ICC>=1600)
// Define portable (u)int{32,64} types
-#if EIGEN_HAS_CXX11 || EIGEN_ICC_NEEDS_CSTDINT
#include <cstdint>
namespace Eigen {
@@ -46,24 +45,6 @@
typedef std::int64_t int64_t;
}
}
-#else
-// Without c++11, all compilers able to compile Eigen also
-// provide the C99 stdint.h header file.
-#include <stdint.h>
-
-namespace Eigen {
-namespace numext {
-typedef ::uint8_t uint8_t;
-typedef ::int8_t int8_t;
-typedef ::uint16_t uint16_t;
-typedef ::int16_t int16_t;
-typedef ::uint32_t uint32_t;
-typedef ::int32_t int32_t;
-typedef ::uint64_t uint64_t;
-typedef ::int64_t int64_t;
-}
-}
-#endif
namespace Eigen {
@@ -155,59 +136,11 @@
template< class T >
struct is_void : is_same<void, typename remove_const<T>::type> {};
-#if EIGEN_HAS_CXX11
template<> struct is_arithmetic<signed long long> { enum { value = true }; };
template<> struct is_arithmetic<unsigned long long> { enum { value = true }; };
using std::is_integral;
-#else
-template<typename T> struct is_integral { enum { value = false }; };
-template<> struct is_integral<bool> { enum { value = true }; };
-template<> struct is_integral<char> { enum { value = true }; };
-template<> struct is_integral<signed char> { enum { value = true }; };
-template<> struct is_integral<unsigned char> { enum { value = true }; };
-template<> struct is_integral<signed short> { enum { value = true }; };
-template<> struct is_integral<unsigned short> { enum { value = true }; };
-template<> struct is_integral<signed int> { enum { value = true }; };
-template<> struct is_integral<unsigned int> { enum { value = true }; };
-template<> struct is_integral<signed long> { enum { value = true }; };
-template<> struct is_integral<unsigned long> { enum { value = true }; };
-#if EIGEN_COMP_MSVC
-template<> struct is_integral<signed __int64> { enum { value = true }; };
-template<> struct is_integral<unsigned __int64> { enum { value = true }; };
-#endif
-#endif
-#if EIGEN_HAS_CXX11
using std::make_unsigned;
-#else
-// TODO: Possibly improve this implementation of make_unsigned.
-// It is currently used only by
-// template<typename Scalar> struct random_default_impl<Scalar, false, true>.
-template<typename> struct make_unsigned;
-template<> struct make_unsigned<char> { typedef unsigned char type; };
-template<> struct make_unsigned<signed char> { typedef unsigned char type; };
-template<> struct make_unsigned<unsigned char> { typedef unsigned char type; };
-template<> struct make_unsigned<signed short> { typedef unsigned short type; };
-template<> struct make_unsigned<unsigned short> { typedef unsigned short type; };
-template<> struct make_unsigned<signed int> { typedef unsigned int type; };
-template<> struct make_unsigned<unsigned int> { typedef unsigned int type; };
-template<> struct make_unsigned<signed long> { typedef unsigned long type; };
-template<> struct make_unsigned<unsigned long> { typedef unsigned long type; };
-#if EIGEN_COMP_MSVC
-template<> struct make_unsigned<signed __int64> { typedef unsigned __int64 type; };
-template<> struct make_unsigned<unsigned __int64> { typedef unsigned __int64 type; };
-#endif
-
-// Some platforms define int64_t as `long long` even for C++03, where
-// `long long` is not guaranteed by the standard. In this case we are missing
-// the definition for make_unsigned. If we just define it, we run into issues
-// where `long long` doesn't exist in some compilers for C++03. We therefore add
-// the specialization for these platforms only.
-#if EIGEN_OS_MAC || EIGEN_COMP_MINGW
-template<> struct make_unsigned<unsigned long long> { typedef unsigned long long type; };
-template<> struct make_unsigned<long long> { typedef unsigned long long type; };
-#endif
-#endif
template <typename T> struct add_const { typedef const T type; };
template <typename T> struct add_const<T&> { typedef T& type; };
@@ -221,56 +154,8 @@
template<typename T> struct add_const_on_value_type<T* const> { typedef T const* const type; };
template<typename T> struct add_const_on_value_type<T const* const> { typedef T const* const type; };
-#if EIGEN_HAS_CXX11
-
using std::is_convertible;
-#else
-
-template<typename From, typename To>
-struct is_convertible_impl
-{
-private:
- struct any_conversion
- {
- template <typename T> any_conversion(const volatile T&);
- template <typename T> any_conversion(T&);
- };
- struct yes {int a[1];};
- struct no {int a[2];};
-
- template<typename T>
- static yes test(T, int);
-
- template<typename T>
- static no test(any_conversion, ...);
-
-public:
- static typename internal::remove_reference<From>::type* ms_from;
-#ifdef __INTEL_COMPILER
- #pragma warning push
- #pragma warning ( disable : 2259 )
-#endif
- enum { value = sizeof(test<To>(*ms_from, 0))==sizeof(yes) };
-#ifdef __INTEL_COMPILER
- #pragma warning pop
-#endif
-};
-
-template<typename From, typename To>
-struct is_convertible
-{
- enum { value = is_convertible_impl<From,To>::value };
-};
-
-template<typename T>
-struct is_convertible<T,T&> { enum { value = false }; };
-
-template<typename T>
-struct is_convertible<const T,const T&> { enum { value = true }; };
-
-#endif
-
/** \internal Allows to enable/disable an overload
* according to a compile time condition.
*/
@@ -279,147 +164,6 @@
template<typename T> struct enable_if<true,T>
{ typedef T type; };
-#if defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
-#if !defined(__FLT_EPSILON__)
-#define __FLT_EPSILON__ FLT_EPSILON
-#define __DBL_EPSILON__ DBL_EPSILON
-#endif
-
-namespace device {
-
-template<typename T> struct numeric_limits
-{
- EIGEN_DEVICE_FUNC
- static EIGEN_CONSTEXPR T epsilon() { return 0; }
- static T (max)() { assert(false && "Highest not supported for this type"); }
- static T (min)() { assert(false && "Lowest not supported for this type"); }
- static T infinity() { assert(false && "Infinity not supported for this type"); }
- static T quiet_NaN() { assert(false && "quiet_NaN not supported for this type"); }
-};
-template<> struct numeric_limits<float>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static float epsilon() { return __FLT_EPSILON__; }
- EIGEN_DEVICE_FUNC
- static float (max)() {
- #if defined(EIGEN_CUDA_ARCH)
- return CUDART_MAX_NORMAL_F;
- #else
- return HIPRT_MAX_NORMAL_F;
- #endif
- }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static float (min)() { return FLT_MIN; }
- EIGEN_DEVICE_FUNC
- static float infinity() {
- #if defined(EIGEN_CUDA_ARCH)
- return CUDART_INF_F;
- #else
- return HIPRT_INF_F;
- #endif
- }
- EIGEN_DEVICE_FUNC
- static float quiet_NaN() {
- #if defined(EIGEN_CUDA_ARCH)
- return CUDART_NAN_F;
- #else
- return HIPRT_NAN_F;
- #endif
- }
-};
-template<> struct numeric_limits<double>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static double epsilon() { return __DBL_EPSILON__; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static double (max)() { return DBL_MAX; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static double (min)() { return DBL_MIN; }
- EIGEN_DEVICE_FUNC
- static double infinity() {
- #if defined(EIGEN_CUDA_ARCH)
- return CUDART_INF;
- #else
- return HIPRT_INF;
- #endif
- }
- EIGEN_DEVICE_FUNC
- static double quiet_NaN() {
- #if defined(EIGEN_CUDA_ARCH)
- return CUDART_NAN;
- #else
- return HIPRT_NAN;
- #endif
- }
-};
-template<> struct numeric_limits<int>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static int epsilon() { return 0; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static int (max)() { return INT_MAX; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static int (min)() { return INT_MIN; }
-};
-template<> struct numeric_limits<unsigned int>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned int epsilon() { return 0; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned int (max)() { return UINT_MAX; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned int (min)() { return 0; }
-};
-template<> struct numeric_limits<long>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static long epsilon() { return 0; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static long (max)() { return LONG_MAX; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static long (min)() { return LONG_MIN; }
-};
-template<> struct numeric_limits<unsigned long>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned long epsilon() { return 0; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned long (max)() { return ULONG_MAX; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned long (min)() { return 0; }
-};
-template<> struct numeric_limits<long long>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static long long epsilon() { return 0; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static long long (max)() { return LLONG_MAX; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static long long (min)() { return LLONG_MIN; }
-};
-template<> struct numeric_limits<unsigned long long>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned long long epsilon() { return 0; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned long long (max)() { return ULLONG_MAX; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static unsigned long long (min)() { return 0; }
-};
-template<> struct numeric_limits<bool>
-{
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static bool epsilon() { return false; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static bool (max)() { return true; }
- EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
- static bool (min)() { return false; }
-};
-
-}
-
-#endif // defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
-
/** \internal
* A base class do disable default copy ctor and copy assignment operator.
*/
@@ -461,14 +205,12 @@
enum { value = N };
};
-#if EIGEN_HAS_CXX11
template<typename T, std::size_t N> struct array_size<const std::array<T,N> > {
enum { value = N };
};
template<typename T, std::size_t N> struct array_size<std::array<T,N> > {
enum { value = N };
};
-#endif
/** \internal
* Analogue of the std::size free function.
@@ -620,36 +362,12 @@
typedef typename std::invoke_result<F, ArgTypes...>::type type1;
typedef typename remove_all<type1>::type type;
};
-#elif EIGEN_HAS_CXX11
+#else
template<typename F, typename... ArgTypes>
struct invoke_result {
typedef typename result_of<F(ArgTypes...)>::type type1;
typedef typename remove_all<type1>::type type;
};
-#else
-template<typename F, typename ArgType0 = void, typename ArgType1 = void, typename ArgType2 = void>
-struct invoke_result {
- typedef typename result_of<F(ArgType0, ArgType1, ArgType2)>::type type1;
- typedef typename remove_all<type1>::type type;
-};
-
-template<typename F>
-struct invoke_result<F, void, void, void> {
- typedef typename result_of<F()>::type type1;
- typedef typename remove_all<type1>::type type;
-};
-
-template<typename F, typename ArgType0>
-struct invoke_result<F, ArgType0, void, void> {
- typedef typename result_of<F(ArgType0)>::type type1;
- typedef typename remove_all<type1>::type type;
-};
-
-template<typename F, typename ArgType0, typename ArgType1>
-struct invoke_result<F, ArgType0, ArgType1, void> {
- typedef typename result_of<F(ArgType0, ArgType1)>::type type1;
- typedef typename remove_all<type1>::type type;
-};
#endif
// C++14 integer/index_sequence.
@@ -824,11 +542,7 @@
template<typename T> EIGEN_STRONG_INLINE void swap(T &a, T &b) { std::swap(a,b); }
#endif
-#if defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
-using internal::device::numeric_limits;
-#else
using std::numeric_limits;
-#endif
// Integer division with rounding up.
// T is assumed to be an integer type with a>=0, and b>0
diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h
index 918d488..5740510 100644
--- a/Eigen/src/Core/util/XprHelper.h
+++ b/Eigen/src/Core/util/XprHelper.h
@@ -188,8 +188,32 @@
template<typename T> struct unpacket_traits;
+// If we vectorize regardless of alignment, pick the full-sized packet if:
+//
+// * The size is large enough;
+// * Picking it will result in less operations than picking the half size.
+// Consider the case where the size is 12, the full packet is 8, and the
+// half packet is 4. If we pick the full packet we'd have 1 + 4 operations,
+// but only 3 operations if we pick the half-packet.
+//
+// The reason why we only do this with EIGEN_UNALIGNED_VECTORIZE is that if
+// we chose packets which do not divide the data size exactly we're going to
+// be left with some possibly unaligned data at the end.
+#if EIGEN_UNALIGNED_VECTORIZE
+template<int Size, typename PacketType,
+ bool Stop =
+ Size==Dynamic ||
+ (Size >= unpacket_traits<PacketType>::size &&
+ // If the packet size is 1 we're always good -- it will always divide things perfectly.
+ // We have this check since otherwise 1/2 would be 0 in the division below.
+ (unpacket_traits<PacketType>::size == 1 ||
+ (Size/unpacket_traits<PacketType>::size + Size%unpacket_traits<PacketType>::size) <=
+ (Size/(unpacket_traits<PacketType>::size/2) + Size%(unpacket_traits<PacketType>::size/2)))) ||
+ is_same<PacketType,typename unpacket_traits<PacketType>::half>::value>
+#else
template<int Size, typename PacketType,
bool Stop = Size==Dynamic || (Size%unpacket_traits<PacketType>::size)==0 || is_same<PacketType,typename unpacket_traits<PacketType>::half>::value>
+#endif
struct find_best_packet_helper;
template< int Size, typename PacketType>
diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h
index 42ce0bb..e291bf3 100644
--- a/Eigen/src/Geometry/Quaternion.h
+++ b/Eigen/src/Geometry/Quaternion.h
@@ -319,7 +319,6 @@
EIGEN_DEVICE_FUNC explicit inline Quaternion(const Quaternion<OtherScalar, OtherOptions>& other)
{ m_coeffs = other.coeffs().template cast<Scalar>(); }
-#if EIGEN_HAS_RVALUE_REFERENCES
// We define a copy constructor, which means we don't get an implicit move constructor or assignment operator.
/** Default move constructor */
EIGEN_DEVICE_FUNC inline Quaternion(Quaternion&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value)
@@ -332,7 +331,6 @@
m_coeffs = std::move(other.coeffs());
return *this;
}
-#endif
EIGEN_DEVICE_FUNC static Quaternion UnitRandom();
diff --git a/Eigen/src/StlSupport/StdDeque.h b/Eigen/src/StlSupport/StdDeque.h
index cd79a15..1e95182 100644
--- a/Eigen/src/StlSupport/StdDeque.h
+++ b/Eigen/src/StlSupport/StdDeque.h
@@ -48,73 +48,4 @@
}; \
}
-// check whether we really need the std::deque specialization
-#if !EIGEN_HAS_CXX11_CONTAINERS && !(defined(_GLIBCXX_DEQUE) && (!EIGEN_GNUC_AT_LEAST(4,1))) /* Note that before gcc-4.1 we already have: std::deque::resize(size_type,const T&). */
-
-namespace std {
-
-#define EIGEN_STD_DEQUE_SPECIALIZATION_BODY \
- public: \
- typedef T value_type; \
- typedef typename deque_base::allocator_type allocator_type; \
- typedef typename deque_base::size_type size_type; \
- typedef typename deque_base::iterator iterator; \
- typedef typename deque_base::const_iterator const_iterator; \
- explicit deque(const allocator_type& a = allocator_type()) : deque_base(a) {} \
- template<typename InputIterator> \
- deque(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) \
- : deque_base(first, last, a) {} \
- deque(const deque& c) : deque_base(c) {} \
- explicit deque(size_type num, const value_type& val = value_type()) : deque_base(num, val) {} \
- deque(iterator start_, iterator end_) : deque_base(start_, end_) {} \
- deque& operator=(const deque& x) { \
- deque_base::operator=(x); \
- return *this; \
- }
-
- template<typename T>
- class deque<T,EIGEN_ALIGNED_ALLOCATOR<T> >
- : public deque<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
- Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> >
-{
- typedef deque<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
- Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> > deque_base;
- EIGEN_STD_DEQUE_SPECIALIZATION_BODY
-
- void resize(size_type new_size)
- { resize(new_size, T()); }
-
-#if defined(_DEQUE_)
- // workaround MSVC std::deque implementation
- void resize(size_type new_size, const value_type& x)
- {
- if (deque_base::size() < new_size)
- deque_base::_Insert_n(deque_base::end(), new_size - deque_base::size(), x);
- else if (new_size < deque_base::size())
- deque_base::erase(deque_base::begin() + new_size, deque_base::end());
- }
- void push_back(const value_type& x)
- { deque_base::push_back(x); }
- void push_front(const value_type& x)
- { deque_base::push_front(x); }
- using deque_base::insert;
- iterator insert(const_iterator position, const value_type& x)
- { return deque_base::insert(position,x); }
- void insert(const_iterator position, size_type new_size, const value_type& x)
- { deque_base::insert(position, new_size, x); }
-#else
- // default implementation which should always work.
- void resize(size_type new_size, const value_type& x)
- {
- if (new_size < deque_base::size())
- deque_base::erase(deque_base::begin() + new_size, deque_base::end());
- else if (new_size > deque_base::size())
- deque_base::insert(deque_base::end(), new_size - deque_base::size(), x);
- }
-#endif
- };
-}
-
-#endif // check whether specialization is actually required
-
#endif // EIGEN_STDDEQUE_H
diff --git a/Eigen/src/StlSupport/StdList.h b/Eigen/src/StlSupport/StdList.h
index 6070e95..da36677 100644
--- a/Eigen/src/StlSupport/StdList.h
+++ b/Eigen/src/StlSupport/StdList.h
@@ -47,64 +47,4 @@
}; \
}
-// check whether we really need the std::list specialization
-#if !EIGEN_HAS_CXX11_CONTAINERS && !(defined(_GLIBCXX_LIST) && (!EIGEN_GNUC_AT_LEAST(4,1))) /* Note that before gcc-4.1 we already have: std::list::resize(size_type,const T&). */
-
-namespace std
-{
-
-#define EIGEN_STD_LIST_SPECIALIZATION_BODY \
- public: \
- typedef T value_type; \
- typedef typename list_base::allocator_type allocator_type; \
- typedef typename list_base::size_type size_type; \
- typedef typename list_base::iterator iterator; \
- typedef typename list_base::const_iterator const_iterator; \
- explicit list(const allocator_type& a = allocator_type()) : list_base(a) {} \
- template<typename InputIterator> \
- list(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) \
- : list_base(first, last, a) {} \
- list(const list& c) : list_base(c) {} \
- explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \
- list(iterator start_, iterator end_) : list_base(start_, end_) {} \
- list& operator=(const list& x) { \
- list_base::operator=(x); \
- return *this; \
- }
-
- template<typename T>
- class list<T,EIGEN_ALIGNED_ALLOCATOR<T> >
- : public list<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
- Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> >
- {
- typedef list<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
- Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> > list_base;
- EIGEN_STD_LIST_SPECIALIZATION_BODY
-
- void resize(size_type new_size)
- { resize(new_size, T()); }
-
- void resize(size_type new_size, const value_type& x)
- {
- if (list_base::size() < new_size)
- list_base::insert(list_base::end(), new_size - list_base::size(), x);
- else
- while (new_size < list_base::size()) list_base::pop_back();
- }
-
-#if defined(_LIST_)
- // workaround MSVC std::list implementation
- void push_back(const value_type& x)
- { list_base::push_back(x); }
- using list_base::insert;
- iterator insert(const_iterator position, const value_type& x)
- { return list_base::insert(position,x); }
- void insert(const_iterator position, size_type new_size, const value_type& x)
- { list_base::insert(position, new_size, x); }
-#endif
- };
-}
-
-#endif // check whether specialization is actually required
-
#endif // EIGEN_STDLIST_H
diff --git a/Eigen/src/StlSupport/StdVector.h b/Eigen/src/StlSupport/StdVector.h
index 93cc4a0..02dfb39 100644
--- a/Eigen/src/StlSupport/StdVector.h
+++ b/Eigen/src/StlSupport/StdVector.h
@@ -48,88 +48,4 @@
}; \
}
-// Don't specialize if containers are implemented according to C++11
-#if !EIGEN_HAS_CXX11_CONTAINERS
-
-namespace std {
-
-#define EIGEN_STD_VECTOR_SPECIALIZATION_BODY \
- public: \
- typedef T value_type; \
- typedef typename vector_base::allocator_type allocator_type; \
- typedef typename vector_base::size_type size_type; \
- typedef typename vector_base::iterator iterator; \
- typedef typename vector_base::const_iterator const_iterator; \
- explicit vector(const allocator_type& a = allocator_type()) : vector_base(a) {} \
- template<typename InputIterator> \
- vector(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) \
- : vector_base(first, last, a) {} \
- vector(const vector& c) : vector_base(c) {} \
- explicit vector(size_type num, const value_type& val = value_type()) : vector_base(num, val) {} \
- vector(iterator start_, iterator end_) : vector_base(start_, end_) {} \
- vector& operator=(const vector& x) { \
- vector_base::operator=(x); \
- return *this; \
- }
-
- template<typename T>
- class vector<T,EIGEN_ALIGNED_ALLOCATOR<T> >
- : public vector<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
- Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> >
-{
- typedef vector<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
- Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> > vector_base;
- EIGEN_STD_VECTOR_SPECIALIZATION_BODY
-
- void resize(size_type new_size)
- { resize(new_size, T()); }
-
-#if defined(_VECTOR_)
- // workaround MSVC std::vector implementation
- void resize(size_type new_size, const value_type& x)
- {
- if (vector_base::size() < new_size)
- vector_base::_Insert_n(vector_base::end(), new_size - vector_base::size(), x);
- else if (new_size < vector_base::size())
- vector_base::erase(vector_base::begin() + new_size, vector_base::end());
- }
- void push_back(const value_type& x)
- { vector_base::push_back(x); }
- using vector_base::insert;
- iterator insert(const_iterator position, const value_type& x)
- { return vector_base::insert(position,x); }
- void insert(const_iterator position, size_type new_size, const value_type& x)
- { vector_base::insert(position, new_size, x); }
-#elif defined(_GLIBCXX_VECTOR) && (!(EIGEN_GNUC_AT_LEAST(4,1)))
- /* Note that before gcc-4.1 we already have: std::vector::resize(size_type,const T&).
- * However, this specialization is still needed to make the above EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION trick to work. */
- void resize(size_type new_size, const value_type& x)
- {
- vector_base::resize(new_size,x);
- }
-#elif defined(_GLIBCXX_VECTOR) && EIGEN_GNUC_AT_LEAST(4,2)
- // workaround GCC std::vector implementation
- void resize(size_type new_size, const value_type& x)
- {
- if (new_size < vector_base::size())
- vector_base::_M_erase_at_end(this->_M_impl._M_start + new_size);
- else
- vector_base::insert(vector_base::end(), new_size - vector_base::size(), x);
- }
-#else
- // either GCC 4.1 or non-GCC
- // default implementation which should always work.
- void resize(size_type new_size, const value_type& x)
- {
- if (new_size < vector_base::size())
- vector_base::erase(vector_base::begin() + new_size, vector_base::end());
- else if (new_size > vector_base::size())
- vector_base::insert(vector_base::end(), new_size - vector_base::size(), x);
- }
-#endif
- };
-}
-#endif // !EIGEN_HAS_CXX11_CONTAINERS
-
-
#endif // EIGEN_STDVECTOR_H
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
index 3077661..3fce0f5 100644
--- a/cmake/EigenTesting.cmake
+++ b/cmake/EigenTesting.cmake
@@ -382,12 +382,6 @@
message(STATUS "S390X ZVECTOR: Using architecture defaults")
endif()
- if(EIGEN_TEST_CXX11)
- message(STATUS "C++11: ON")
- else()
- message(STATUS "C++11: OFF")
- endif()
-
if(EIGEN_TEST_SYCL)
if(EIGEN_SYCL_TRISYCL)
message(STATUS "SYCL: ON (using triSYCL)")
@@ -614,10 +608,6 @@
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-64bit)
endif()
- if(EIGEN_TEST_CXX11)
- set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-cxx11)
- endif()
-
if(EIGEN_BUILD_STRING_SUFFIX)
set(TMP_BUILD_STRING ${TMP_BUILD_STRING}-${EIGEN_BUILD_STRING_SUFFIX})
endif()
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index bc1e03c..7b1d770 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -1600,7 +1600,6 @@
EIGEN_QT_SUPPORT \
EIGEN_STRONG_INLINE=inline \
EIGEN_DEVICE_FUNC= \
- EIGEN_HAS_CXX11=1 \
EIGEN_HAS_CXX11_MATH=1 \
"EIGEN_MAKE_CWISE_BINARY_OP(METHOD,FUNCTOR)=template<typename OtherDerived> const CwiseBinaryOp<FUNCTOR<Scalar>, const Derived, const OtherDerived> METHOD(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const;" \
"EIGEN_CWISE_PRODUCT_RETURN_TYPE(LHS,RHS)=CwiseBinaryOp<internal::scalar_product_op<LHS::Scalar,RHS::Scalar>, const LHS, const RHS>"\
diff --git a/doc/PreprocessorDirectives.dox b/doc/PreprocessorDirectives.dox
index 9d46388..79581a5 100644
--- a/doc/PreprocessorDirectives.dox
+++ b/doc/PreprocessorDirectives.dox
@@ -55,7 +55,7 @@
the information provided by the compiler.
- \b EIGEN_MAX_CPP_VER - disables usage of C++ features requiring a version greater than EIGEN_MAX_CPP_VER.
- Possible values are: 03, 11, 14, 17, etc. If not defined (the default), %Eigen enables all features supported
+ Possible values are: 11, 14, 17, etc. If not defined (the default), %Eigen enables all features supported
by the compiler.
Individual features can be explicitly enabled or disabled by defining the following token to 0 or 1 respectively.
@@ -66,18 +66,12 @@
Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
- \b EIGEN_HAS_CXX11_MATH - controls the implementation of some functions such as round, logp1, isinf, isnan, etc.
Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
- - \b EIGEN_HAS_RVALUE_REFERENCES - defines whether rvalue references are supported
- Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
- \b EIGEN_HAS_STD_RESULT_OF - defines whether std::result_of is supported
Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
- \b EIGEN_HAS_VARIADIC_TEMPLATES - defines whether variadic templates are supported
Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
- \b EIGEN_HAS_CONSTEXPR - defines whether relaxed const expression are supported
Automatic detection disabled if EIGEN_MAX_CPP_VER<14.
- - \b EIGEN_HAS_CXX11_CONTAINERS - defines whether STL's containers follows C++11 specifications
- Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
- - \b EIGEN_HAS_CXX11_NOEXCEPT - defines whether noexcept is supported
- Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
- \b EIGEN_NO_IO - Disables any usage and support for `<iostreams>`.
\section TopicPreprocessorDirectivesAssertions Assertions
diff --git a/doc/examples/nullary_indexing.cpp b/doc/examples/nullary_indexing.cpp
index b74db5f..f710c84 100644
--- a/doc/examples/nullary_indexing.cpp
+++ b/doc/examples/nullary_indexing.cpp
@@ -56,11 +56,9 @@
B = mat_indexing(A, ri+1, ci);
std::cout << "A(ri+1,ci) =" << std::endl;
std::cout << B << std::endl << std::endl;
-#if EIGEN_COMP_CXXVER >= 11
B = mat_indexing(A, ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3));
std::cout << "A(ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)) =" << std::endl;
std::cout << B << std::endl << std::endl;
-#endif
std::cout << "[main2]\n";
}
diff --git a/test/AnnoyingScalar.h b/test/AnnoyingScalar.h
index 7ace083..d4cca79 100644
--- a/test/AnnoyingScalar.h
+++ b/test/AnnoyingScalar.h
@@ -37,9 +37,7 @@
AnnoyingScalar(float _v) { init(); *v = _v; }
AnnoyingScalar(int _v) { init(); *v = _v; }
AnnoyingScalar(long _v) { init(); *v = _v; }
- #if EIGEN_HAS_CXX11
AnnoyingScalar(long long _v) { init(); *v = _v; }
- #endif
AnnoyingScalar(const AnnoyingScalar& other) { init(); *v = *(other.v); }
~AnnoyingScalar() {
if(v!=&data)
diff --git a/test/array_cwise.cpp b/test/array_cwise.cpp
index 0cc438b..7485140 100644
--- a/test/array_cwise.cpp
+++ b/test/array_cwise.cpp
@@ -176,7 +176,6 @@
FixedArrayType f4(f1.data());
VERIFY_IS_APPROX(f4, f1);
}
- #if EIGEN_HAS_CXX11
{
FixedArrayType f1{s1};
VERIFY_IS_APPROX(f1, FixedArrayType::Constant(s1));
@@ -188,7 +187,6 @@
FixedArrayType f4{f1.data()};
VERIFY_IS_APPROX(f4, f1);
}
- #endif
// pow
VERIFY_IS_APPROX(m1.pow(2), m1.square());
@@ -214,14 +212,12 @@
OneDArrayType o2(static_cast<int>(rows));
VERIFY(o2.size()==rows);
}
- #if EIGEN_HAS_CXX11
{
OneDArrayType o1{rows};
VERIFY(o1.size()==rows);
OneDArrayType o4{int(rows)};
VERIFY(o4.size()==rows);
}
- #endif
// Check possible conflicts with 2D ctor
typedef Array<Scalar, Dynamic, Dynamic> TwoDArrayType;
typedef Array<Scalar, 2, 1> ArrayType2;
@@ -238,7 +234,6 @@
ArrayType2 o4(static_cast<int>(rows),static_cast<int>(cols));
VERIFY(o4(0)==Scalar(rows) && o4(1)==Scalar(cols));
}
- #if EIGEN_HAS_CXX11
{
TwoDArrayType o1{rows,cols};
VERIFY(o1.rows()==rows);
@@ -252,7 +247,6 @@
ArrayType2 o4{int(rows),int(cols)};
VERIFY(o4(0)==Scalar(rows) && o4(1)==Scalar(cols));
}
- #endif
}
template<typename ArrayType> void comparisons(const ArrayType& m)
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index 00ef96a..14ecb72 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -69,10 +69,8 @@
x = v1(static_cast<unsigned int>(r1));
x = v1(static_cast<signed long>(r1));
x = v1(static_cast<unsigned long>(r1));
-#if EIGEN_HAS_CXX11
x = v1(static_cast<long long int>(r1));
x = v1(static_cast<unsigned long long int>(r1));
-#endif
VERIFY_IS_APPROX( v1, v1);
VERIFY_IS_NOT_APPROX( v1, 2*v1);
@@ -231,10 +229,8 @@
casting_test<SrcScalar, uint16_t>::run();
casting_test<SrcScalar, int32_t>::run();
casting_test<SrcScalar, uint32_t>::run();
-#if EIGEN_HAS_CXX11
casting_test<SrcScalar, int64_t>::run();
casting_test<SrcScalar, uint64_t>::run();
-#endif
casting_test<SrcScalar, half>::run();
casting_test<SrcScalar, bfloat16>::run();
casting_test<SrcScalar, float>::run();
@@ -264,10 +260,8 @@
casting_test_runner<uint16_t>::run();
casting_test_runner<int32_t>::run();
casting_test_runner<uint32_t>::run();
-#if EIGEN_HAS_CXX11
casting_test_runner<int64_t>::run();
casting_test_runner<uint64_t>::run();
-#endif
casting_test_runner<half>::run();
casting_test_runner<bfloat16>::run();
casting_test_runner<float>::run();
diff --git a/test/blasutil.cpp b/test/blasutil.cpp
index 845a498..ee98df4 100644
--- a/test/blasutil.cpp
+++ b/test/blasutil.cpp
@@ -196,12 +196,7 @@
// TODO: Replace this by a call to numext::int64_t as soon as we have a way to
// detect the typedef for int64_t on all platforms
-#if EIGEN_HAS_CXX11
CALL_SUBTEST_4(run_test<signed long long>());
-#else
- CALL_SUBTEST_4(run_test<signed long>());
-#endif
-
CALL_SUBTEST_5(run_test<float_t>());
CALL_SUBTEST_6(run_test<double_t>());
CALL_SUBTEST_7(run_test<std::complex<float> >());
diff --git a/test/dense_storage.cpp b/test/dense_storage.cpp
index 45c2bd7..826874c 100644
--- a/test/dense_storage.cpp
+++ b/test/dense_storage.cpp
@@ -13,7 +13,7 @@
#include <Eigen/Core>
-#if EIGEN_HAS_TYPE_TRAITS && EIGEN_HAS_CXX11
+#if EIGEN_HAS_TYPE_TRAITS
using DenseStorageD3x3 = Eigen::DenseStorage<double, 3, 3, 3, 3>;
static_assert(std::is_trivially_move_constructible<DenseStorageD3x3>::value, "DenseStorage not trivially_move_constructible");
static_assert(std::is_trivially_move_assignable<DenseStorageD3x3>::value, "DenseStorage not trivially_move_assignable");
diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp
index c561fc8..34404c2 100644
--- a/test/geo_quaternion.cpp
+++ b/test/geo_quaternion.cpp
@@ -293,8 +293,6 @@
VERIFY( !(Map<ConstPlainObjectType, Aligned>::Flags & LvalueBit) );
}
-#if EIGEN_HAS_RVALUE_REFERENCES
-
// Regression for bug 1573
struct MovableClass {
// The following line is a workaround for gcc 4.7 and 4.8 (see bug 1573 comments).
@@ -307,8 +305,6 @@
Quaternionf m_quat;
};
-#endif
-
EIGEN_DECLARE_TEST(geo_quaternion)
{
for(int i = 0; i < g_repeat; i++) {
diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp
index 04ba91a..a3b336c 100644
--- a/test/indexed_view.cpp
+++ b/test/indexed_view.cpp
@@ -12,26 +12,6 @@
#define EIGEN_MAX_CPP_VER 11
#endif
-#ifdef EIGEN_TEST_PART_3
-// Make sure we also check c++98 max implementation
-#define EIGEN_MAX_CPP_VER 03
-
-// We need to disable this warning when compiling with c++11 while limiting Eigen to c++98
-// Ideally we would rather configure the compiler to build in c++98 mode but this needs
-// to be done at the CMakeLists.txt level.
-#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
- #pragma GCC diagnostic ignored "-Wdeprecated"
-#endif
-
-#if defined(__GNUC__) && (__GNUC__ >=9)
- #pragma GCC diagnostic ignored "-Wdeprecated-copy"
-#endif
-#if defined(__clang__) && (__clang_major__ >= 10)
- #pragma clang diagnostic ignored "-Wdeprecated-copy"
-#endif
-
-#endif
-
#include <valarray>
#include <vector>
#include "main.h"
@@ -39,11 +19,8 @@
using Eigen::placeholders::all;
using Eigen::placeholders::last;
using Eigen::placeholders::lastp1;
-
-#if EIGEN_HAS_CXX11
using Eigen::placeholders::lastN;
#include <array>
-#endif
typedef std::pair<Index,Index> IndexPair;
@@ -225,7 +202,6 @@
VERIFY( is_same_seq_type( seqN(2,fix<5>(5),fix<-2>), seqN(2,fix<5>,fix<-2>()) ) );
VERIFY( is_same_seq_type( seq(2,fix<5>), seqN(2,4) ) );
- #if EIGEN_HAS_CXX11
VERIFY( is_same_seq_type( seq(fix<2>,fix<5>), seqN(fix<2>,fix<4>) ) );
VERIFY( is_same_seq( seqN(2,std::integral_constant<int,5>(),std::integral_constant<int,-2>()), seqN(2,fix<5>,fix<-2>()) ) );
VERIFY( is_same_seq( seq(std::integral_constant<int,1>(),std::integral_constant<int,5>(),std::integral_constant<int,2>()),
@@ -236,10 +212,6 @@
VERIFY( is_same_seq_type( seqN(2,std::integral_constant<int,5>()), seqN(2,fix<5>) ) );
VERIFY( is_same_seq_type( seq(std::integral_constant<int,1>(),std::integral_constant<int,5>()), seq(fix<1>,fix<5>) ) );
-#else
- // sorry, no compile-time size recovery in c++98/03
- VERIFY( is_same_seq( seq(fix<2>,fix<5>), seqN(fix<2>,fix<4>) ) );
-#endif
VERIFY( (A(seqN(2,fix<5>), 5)).RowsAtCompileTime == 5);
VERIFY( (A(4, all)).ColsAtCompileTime == Dynamic);
@@ -315,7 +287,6 @@
A(seq(last-5,last-1,2), seqN(last-3,3,fix<-2>)).reverse() );
}
-#if EIGEN_HAS_CXX11
// check lastN
VERIFY_IS_APPROX( a(lastN(3)), a.tail(3) );
VERIFY( MATCH( a(lastN(3)), "7\n8\n9" ) );
@@ -343,8 +314,6 @@
VERIFY_IS_EQUAL( b({1,3,5}).SizeAtCompileTime, 3 );
#endif
-#endif
-
// check mat(i,j) with weird types for i and j
{
VERIFY_IS_APPROX( A(B.RowsAtCompileTime-1, 1), A(3,1) );
@@ -401,13 +370,11 @@
a(XX) = 1;
A(XX,YY) = 1;
// Anonymous enums only work with C++11
-#if EIGEN_HAS_CXX11
enum { X=0, Y=1 };
a(X) = 1;
A(X,Y) = 1;
A(XX,Y) = 1;
A(X,YY) = 1;
-#endif
// Check compilation of varying integer types as index types:
Index i = n/2;
@@ -447,13 +414,23 @@
VERIFY( MATCH( A(all,1)(1), "101"));
}
-#if EIGEN_HAS_CXX11
+#if EIGEN_HAS_STATIC_ARRAY_TEMPLATE
+ // bug #2375: indexing over matrices of dim >128 should compile on gcc
+ {
+ Matrix<double, 513, 3> large_mat = Matrix<double, 513, 3>::Random();
+ std::array<int, 2> test_indices = {0, 1};
+ Matrix<double, 513, 2> thin_slice = large_mat(all, test_indices);
+ for(int col = 0; col < int(test_indices.size()); ++col)
+ for(int row = 0; row < large_mat.rows(); ++row)
+ VERIFY_IS_EQUAL( thin_slice(row, col), large_mat(row, col) );
+ }
+#endif
+
//Bug IndexView with a single static row should be RowMajor:
{
// A(1, seq(0,2,1)).cwiseAbs().colwise().replicate(2).eval();
STATIC_CHECK(( (internal::evaluator<decltype( A(1,seq(0,2,1)) )>::Flags & RowMajorBit) == RowMajorBit ));
}
-#endif
}
@@ -462,7 +439,6 @@
// for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( check_indexed_view() );
CALL_SUBTEST_2( check_indexed_view() );
- CALL_SUBTEST_3( check_indexed_view() );
// }
// static checks of some internals:
diff --git a/test/integer_types.cpp b/test/integer_types.cpp
index ce64e18..1322527 100644
--- a/test/integer_types.cpp
+++ b/test/integer_types.cpp
@@ -160,12 +160,10 @@
CALL_SUBTEST_6( integer_type_tests(Matrix<unsigned short, 4, 4>()) );
-#if EIGEN_HAS_CXX11
CALL_SUBTEST_7( integer_type_tests(Matrix<long long, 11, 13>()) );
CALL_SUBTEST_7( signed_integer_type_tests(Matrix<long long, 11, 13>()) );
CALL_SUBTEST_8( integer_type_tests(Matrix<unsigned long long, Dynamic, 5>(1, 5)) );
-#endif
}
CALL_SUBTEST_9( integer_types_extra<0>() );
}
diff --git a/test/main.h b/test/main.h
index 9b2938a..041233d 100644
--- a/test/main.h
+++ b/test/main.h
@@ -433,10 +433,8 @@
EIGEN_TEST_SCALAR_TEST_OVERLOAD(unsigned int)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(long)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(unsigned long)
-#if EIGEN_HAS_CXX11
EIGEN_TEST_SCALAR_TEST_OVERLOAD(long long)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(unsigned long long)
-#endif
EIGEN_TEST_SCALAR_TEST_OVERLOAD(float)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(double)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(half)
diff --git a/test/num_dimensions.cpp b/test/num_dimensions.cpp
index 7ad7ef6..528c8f6 100644
--- a/test/num_dimensions.cpp
+++ b/test/num_dimensions.cpp
@@ -15,7 +15,6 @@
STATIC_CHECK( Xpr::NumDimensions == ExpectedDim );
}
-#if EIGEN_HAS_CXX11
template<template <typename,int,int> class Object>
void map_num_dimensions()
{
@@ -58,8 +57,6 @@
template<typename Scalar, int Rows, int Cols>
using TMatrix = Matrix<Scalar,Rows,Cols>;
-#endif
-
EIGEN_DECLARE_TEST(num_dimensions)
{
int n = 10;
@@ -81,10 +78,7 @@
SparseVector<double> s(n);
CALL_SUBTEST( check_dim<1>(s) );
CALL_SUBTEST( check_dim<1>(s.head(2)) );
-
- #if EIGEN_HAS_CXX11
CALL_SUBTEST( map_num_dimensions<TArray>() );
CALL_SUBTEST( map_num_dimensions<TMatrix>() );
- #endif
}
diff --git a/test/packetmath.cpp b/test/packetmath.cpp
index 6150481..0600ddb 100644
--- a/test/packetmath.cpp
+++ b/test/packetmath.cpp
@@ -847,7 +847,7 @@
}
}
-#if EIGEN_HAS_C99_MATH && (EIGEN_COMP_CXXVER >= 11)
+#if EIGEN_HAS_C99_MATH
data1[0] = NumTraits<Scalar>::infinity();
data1[1] = Scalar(-1);
CHECK_CWISE1_IF(PacketTraits::HasLog1p, std::log1p, internal::plog1p);
diff --git a/test/rvalue_types.cpp b/test/rvalue_types.cpp
index 2c9999c..9af7c92 100644
--- a/test/rvalue_types.cpp
+++ b/test/rvalue_types.cpp
@@ -10,16 +10,13 @@
#define EIGEN_RUNTIME_NO_MALLOC
#include "main.h"
-#if EIGEN_HAS_CXX11
#include "MovableScalar.h"
-#endif
#include "SafeScalar.h"
#include <Eigen/Core>
using internal::UIntPtr;
-#if EIGEN_HAS_RVALUE_REFERENCES
template <typename MatrixType>
void rvalue_copyassign(const MatrixType& m)
{
@@ -114,14 +111,6 @@
g_dst = std::move(g_src);
VERIFY_IS_EQUAL(g_dst, m);
}
-#else
-template <typename MatrixType>
-void rvalue_copyassign(const MatrixType&) {}
-template<typename TranspositionsType>
-void rvalue_transpositions(Index) {}
-template <typename MatrixType>
-void rvalue_move(const MatrixType&) {}
-#endif
EIGEN_DECLARE_TEST(rvalue_types)
{
@@ -148,10 +137,8 @@
CALL_SUBTEST_4((rvalue_transpositions<Transpositions<Dynamic, Dynamic, int> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
CALL_SUBTEST_4((rvalue_transpositions<Transpositions<Dynamic, Dynamic, Index> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
-#if EIGEN_HAS_CXX11
CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<MovableScalar<float>,1,3>::Random().eval()));
CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<SafeScalar<float>,1,3>::Random().eval()));
CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<SafeScalar<float>,Eigen::Dynamic,Eigen::Dynamic>::Random(1,3).eval()));
-#endif
}
}
diff --git a/test/sparse.h b/test/sparse.h
index 663aaee..9a63e0d 100644
--- a/test/sparse.h
+++ b/test/sparse.h
@@ -14,8 +14,6 @@
#include "main.h"
-#if EIGEN_HAS_CXX11
-
#ifdef min
#undef min
#endif
@@ -27,8 +25,6 @@
#include <unordered_map>
#define EIGEN_UNORDERED_MAP_SUPPORT
-#endif
-
#include <Eigen/Cholesky>
#include <Eigen/LU>
#include <Eigen/Sparse>
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp
index 93c30a5..85a6077 100644
--- a/test/sparse_basic.cpp
+++ b/test/sparse_basic.cpp
@@ -413,10 +413,8 @@
m.setFromTriplets(triplets.begin(), triplets.end(), std::multiplies<Scalar>());
VERIFY_IS_APPROX(m, refMat_prod);
-#if (EIGEN_COMP_CXXVER >= 11)
m.setFromTriplets(triplets.begin(), triplets.end(), [] (Scalar,Scalar b) { return b; });
VERIFY_IS_APPROX(m, refMat_last);
-#endif
}
// test Map
diff --git a/test/stl_iterators.cpp b/test/stl_iterators.cpp
index f868d68..533a3fe 100644
--- a/test/stl_iterators.cpp
+++ b/test/stl_iterators.cpp
@@ -18,28 +18,7 @@
return std::reverse_iterator<Iterator>(i);
}
-#if !EIGEN_HAS_CXX11
-template<class ForwardIt>
-ForwardIt is_sorted_until(ForwardIt firstIt, ForwardIt lastIt)
-{
- if (firstIt != lastIt) {
- ForwardIt next = firstIt;
- while (++next != lastIt) {
- if (*next < *firstIt)
- return next;
- firstIt = next;
- }
- }
- return lastIt;
-}
-template<class ForwardIt>
-bool is_sorted(ForwardIt firstIt, ForwardIt lastIt)
-{
- return ::is_sorted_until(firstIt, lastIt) == lastIt;
-}
-#else
using std::is_sorted;
-#endif
template<typename XprType>
bool is_pointer_based_stl_iterator(const internal::pointer_based_stl_iterator<XprType> &) { return true; }
@@ -50,10 +29,8 @@
template<typename Iter>
bool is_default_constructible_and_assignable(const Iter& it)
{
-#if EIGEN_HAS_CXX11
VERIFY(std::is_default_constructible<Iter>::value);
VERIFY(std::is_nothrow_default_constructible<Iter>::value);
-#endif
Iter it2;
it2 = it;
return (it==it2);
@@ -82,12 +59,10 @@
typename Xpr::const_iterator cit = xpr.begin();
cit = xpr.cbegin();
- #if EIGEN_HAS_CXX11
auto tmp1 = xpr.begin();
VERIFY(tmp1==xpr.begin());
auto tmp2 = xpr.cbegin();
VERIFY(tmp2==xpr.cbegin());
- #endif
}
VERIFY( xpr.end() -xpr.begin() == xpr.size() );
@@ -123,9 +98,7 @@
void test_stl_iterators(int rows=Rows, int cols=Cols)
{
typedef Matrix<Scalar,Rows,1> VectorType;
- #if EIGEN_HAS_CXX11
typedef Matrix<Scalar,1,Cols> RowVectorType;
- #endif
typedef Matrix<Scalar,Rows,Cols,ColMajor> ColMatrixType;
typedef Matrix<Scalar,Rows,Cols,RowMajor> RowMatrixType;
VectorType v = VectorType::Random(rows);
@@ -191,7 +164,6 @@
check_begin_end_for_loop(v+v);
}
-#if EIGEN_HAS_CXX11
// check swappable
{
using std::swap;
@@ -326,8 +298,6 @@
}
}
-#endif
-
if(rows>=3) {
VERIFY_IS_EQUAL((v.begin()+rows/2)[1], v(rows/2+1));
@@ -344,11 +314,7 @@
if(rows>=2)
{
v(1) = v(0)-Scalar(1);
- #if EIGEN_HAS_CXX11
VERIFY(!is_sorted(std::begin(v),std::end(v)));
- #else
- VERIFY(!is_sorted(v.cbegin(),v.cend()));
- #endif
}
// on a vector
@@ -428,7 +394,6 @@
VERIFY_IS_APPROX(v1(rows/4), v(rows/4));
}
-#if EIGEN_HAS_CXX11
// check rows/cols iterators with range-for loops
{
j = 0;
@@ -492,12 +457,9 @@
STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::cend (std::declval<const VecOp&>()))>::value ));
#endif
}
-
-#endif
}
-#if EIGEN_HAS_CXX11
// When the compiler sees expression IsContainerTest<C>(0), if C is an
// STL-style container class, the first overload of IsContainerTest
// will be viable (since both C::iterator* and C::const_iterator* are
@@ -545,7 +507,6 @@
VERIFY_IS_EQUAL(IsContainerType<ColMatrixType>(0), rows == 1 || cols == 1);
VERIFY_IS_EQUAL(IsContainerType<RowMatrixType>(0), rows == 1 || cols == 1);
}
-#endif
EIGEN_DECLARE_TEST(stl_iterators)
{
@@ -555,9 +516,7 @@
CALL_SUBTEST_1(( test_stl_iterators<int,Dynamic,Dynamic>(internal::random<int>(5,10), internal::random<int>(5,10)) ));
CALL_SUBTEST_1(( test_stl_iterators<int,Dynamic,Dynamic>(internal::random<int>(10,200), internal::random<int>(10,200)) ));
}
-
-#if EIGEN_HAS_CXX11
+
CALL_SUBTEST_1(( test_stl_container_detection<float,1,1>() ));
CALL_SUBTEST_1(( test_stl_container_detection<float,5,5>() ));
-#endif
}
diff --git a/test/symbolic_index.cpp b/test/symbolic_index.cpp
index e40cb18..22ed00c 100644
--- a/test/symbolic_index.cpp
+++ b/test/symbolic_index.cpp
@@ -7,16 +7,6 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#ifdef EIGEN_TEST_PART_2
-#define EIGEN_MAX_CPP_VER 03
-
-// see indexed_view.cpp
-#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
- #pragma GCC diagnostic ignored "-Wdeprecated"
-#endif
-
-#endif
-
#include "main.h"
using Eigen::placeholders::last;
@@ -84,5 +74,4 @@
EIGEN_DECLARE_TEST(symbolic_index)
{
CALL_SUBTEST_1( check_symbolic_index() );
- CALL_SUBTEST_2( check_symbolic_index() );
}
diff --git a/test/type_alias.cpp b/test/type_alias.cpp
index 9a6616c..0a223d9 100644
--- a/test/type_alias.cpp
+++ b/test/type_alias.cpp
@@ -18,8 +18,6 @@
STATIC_CHECK((is_same<Matrix2f,Matrix<float,2,2> >::value));
STATIC_CHECK((is_same<Array33i,Array<int,3,3> >::value));
-#if EIGEN_HAS_CXX11
-
STATIC_CHECK((is_same<MatrixX<double>, MatrixXd>::value));
STATIC_CHECK((is_same<MatrixX<int>, MatrixXi>::value));
STATIC_CHECK((is_same<Matrix2<int>, Matrix2i>::value));
@@ -42,7 +40,4 @@
STATIC_CHECK((is_same<RowVector<float,3>, RowVector3f>::value));
STATIC_CHECK((is_same<RowVector<int,Dynamic>, RowVectorXi>::value));
-#else
- std::cerr << "WARNING: c++11 type aliases not tested.\n";
-#endif
}
diff --git a/test/vectorization_logic.cpp b/test/vectorization_logic.cpp
index 602e9f1..62d3f60 100644
--- a/test/vectorization_logic.cpp
+++ b/test/vectorization_logic.cpp
@@ -258,7 +258,38 @@
VERIFY(test_redux(VectorX(10),
LinearVectorizedTraversal,NoUnrolling));
+
+ // Some static checks for packet-picking -- see
+ // <https://gitlab.com/libeigen/eigen/merge_requests/46#note_271497656> for context.
+
+ // Any multiple of the packet size itself will result in the normal packet
+ STATIC_CHECK((
+ internal::is_same<typename internal::find_best_packet<Scalar, PacketSize>::type, PacketType>::value
+ ));
+ STATIC_CHECK((
+ internal::is_same<typename internal::find_best_packet<Scalar, PacketSize*2>::type, PacketType>::value
+ ));
+ STATIC_CHECK((
+ internal::is_same<typename internal::find_best_packet<Scalar, PacketSize*5>::type, PacketType>::value
+ ));
+ // Moreover, situations where the size is _not_ a multiple but picking the full packet
+ // is convenient will also work, but only with unaligned vectorize
+ STATIC_CHECK((
+ !(EIGEN_UNALIGNED_VECTORIZE || PacketSize == HalfPacketSize) ||
+ internal::is_same<typename internal::find_best_packet<Scalar, PacketSize*5+1>::type, PacketType>::value
+ ));
+ STATIC_CHECK((
+ !(EIGEN_UNALIGNED_VECTORIZE || PacketSize == HalfPacketSize) ||
+ internal::is_same<typename internal::find_best_packet<Scalar, PacketSize*5+2>::type, PacketType>::value
+ ));
+ // In situations where the picking the full-packet would be detrimental the half-packet
+ // is chosen.
+ STATIC_CHECK((
+ !(PacketSize > 2) ||
+ internal::is_same<typename internal::find_best_packet<Scalar, PacketSize*2-1>::type, HalfPacketType>::value
+ ));
}
+
};
template<typename Scalar> struct vectorization_logic<Scalar,false>
diff --git a/unsupported/Eigen/CXX11/Tensor b/unsupported/Eigen/CXX11/Tensor
index c269289..0a04a0e 100644
--- a/unsupported/Eigen/CXX11/Tensor
+++ b/unsupported/Eigen/CXX11/Tensor
@@ -13,8 +13,6 @@
#include "../../../Eigen/Core"
-#if EIGEN_HAS_CXX11
-
#include "../SpecialFunctions"
#include "../../../Eigen/src/Core/util/DisableStupidWarnings.h"
@@ -137,5 +135,4 @@
#include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h"
-#endif // EIGEN_HAS_CXX11
//#endif // EIGEN_CXX11_TENSOR_MODULE_H
diff --git a/unsupported/Eigen/CXX11/ThreadPool b/unsupported/Eigen/CXX11/ThreadPool
index 5fb9fa7..a2eb06c 100644
--- a/unsupported/Eigen/CXX11/ThreadPool
+++ b/unsupported/Eigen/CXX11/ThreadPool
@@ -30,7 +30,6 @@
// The code depends on CXX11, so only include the module if the
// compiler supports it.
-#if (EIGEN_COMP_CXXVER >= 11)
#include <cstddef>
#include <cstring>
#include <time.h>
@@ -91,8 +90,6 @@
#include "src/ThreadPool/Barrier.h"
#include "src/ThreadPool/NonBlockingThreadPool.h"
-#endif
-
#include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h"
#endif // EIGEN_CXX11_THREADPOOL_MODULE_H
diff --git a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h
index 26358d5..5a14c71 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h
@@ -402,7 +402,6 @@
internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice());
}
- #if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Tensor(Self&& other)
: m_storage(std::move(other.m_storage))
@@ -414,7 +413,6 @@
m_storage = std::move(other.m_storage);
return *this;
}
- #endif
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Tensor& operator=(const Tensor& other)
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
index 325fa6d..6b11b79 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
@@ -318,12 +318,10 @@
{
}
-#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorFixedSize(Self&& other)
: m_storage(other.m_storage)
{
}
-#endif
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
index 5ec81a6..2dff543 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
@@ -110,7 +110,6 @@
return *this;
}
-#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC TensorStorage(Self&& other) : TensorStorage()
{
*this = std::move(other);
@@ -122,7 +121,6 @@
numext::swap(m_dimensions, other.m_dimensions);
return *this;
}
-#endif
EIGEN_DEVICE_FUNC ~TensorStorage() { internal::conditional_aligned_delete_auto<T,(Options_&DontAlign)==0>(m_data, internal::array_prod(m_dimensions)); }
EIGEN_DEVICE_FUNC void swap(Self& other)
diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h b/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h
index d6cca42..6bb67e4 100644
--- a/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h
+++ b/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h
@@ -18,8 +18,7 @@
#else
-#if EIGEN_MAX_CPP_VER >= 11 && \
- ((EIGEN_COMP_GNUC && EIGEN_GNUC_AT_LEAST(4, 8)) || \
+#if ((EIGEN_COMP_GNUC && EIGEN_GNUC_AT_LEAST(4, 8)) || \
__has_feature(cxx_thread_local) || \
(EIGEN_COMP_MSVC >= 1900) )
#define EIGEN_THREAD_LOCAL static thread_local
diff --git a/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h b/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h
index 056736c..386e390 100644
--- a/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h
+++ b/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h
@@ -27,18 +27,6 @@
#error GNU C++ Compiler (g++) only supports required C++ features since version 4.6.
#endif
-/* Check that the compiler at least claims to support C++11. It might not be sufficient
- * because the compiler may not implement it correctly, but at least we'll know.
- * On the other hand, visual studio still doesn't claim to support C++11 although it's
- * compliant enugh for our purpose.
- */
-#if (EIGEN_COMP_CXXVER < 11)
-#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
-#pragma GCC diagnostic error "-Wfatal-errors"
-#endif
-#error This library needs at least a C++11 compliant compiler. If you use g++/clang, please enable the -std=c++11 compiler flag. (-std=c++0x on older versions.)
-#endif
-
namespace Eigen {
namespace internal {
diff --git a/unsupported/Eigen/CXX11/src/util/EmulateArray.h b/unsupported/Eigen/CXX11/src/util/EmulateArray.h
index 0265136..f87cb81 100644
--- a/unsupported/Eigen/CXX11/src/util/EmulateArray.h
+++ b/unsupported/Eigen/CXX11/src/util/EmulateArray.h
@@ -69,6 +69,7 @@
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const T& back() const { return values[n-1]; }
+
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
static std::size_t size() { return n; }
diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt
index 579b34e..f87bacd 100644
--- a/unsupported/test/CMakeLists.txt
+++ b/unsupported/test/CMakeLists.txt
@@ -105,183 +105,180 @@
ei_add_test(special_functions)
ei_add_test(special_packetmath "-DEIGEN_FAST_MATH=1")
-if(EIGEN_TEST_CXX11)
- if(EIGEN_TEST_SYCL)
- set(EIGEN_SYCL ON)
- # Forward CMake options as preprocessor definitions
- if(EIGEN_SYCL_USE_DEFAULT_SELECTOR)
- add_definitions(-DEIGEN_SYCL_USE_DEFAULT_SELECTOR=${EIGEN_SYCL_USE_DEFAULT_SELECTOR})
- endif()
- if(EIGEN_SYCL_NO_LOCAL_MEM)
- add_definitions(-DEIGEN_SYCL_NO_LOCAL_MEM=${EIGEN_SYCL_NO_LOCAL_MEM})
- endif()
- if(EIGEN_SYCL_LOCAL_MEM)
- add_definitions(-DEIGEN_SYCL_LOCAL_MEM=${EIGEN_SYCL_LOCAL_MEM})
- endif()
- if(EIGEN_SYCL_MAX_GLOBAL_RANGE)
- add_definitions(-DEIGEN_SYCL_MAX_GLOBAL_RANGE=${EIGEN_SYCL_MAX_GLOBAL_RANGE})
- endif()
- if(EIGEN_SYCL_LOCAL_THREAD_DIM0)
- add_definitions(-DEIGEN_SYCL_LOCAL_THREAD_DIM0=${EIGEN_SYCL_LOCAL_THREAD_DIM0})
- endif()
- if(EIGEN_SYCL_LOCAL_THREAD_DIM1)
- add_definitions(-DEIGEN_SYCL_LOCAL_THREAD_DIM1=${EIGEN_SYCL_LOCAL_THREAD_DIM1})
- endif()
- if(EIGEN_SYCL_REG_M)
- add_definitions(-DEIGEN_SYCL_REG_M=${EIGEN_SYCL_REG_M})
- endif()
- if(EIGEN_SYCL_REG_N)
- add_definitions(-DEIGEN_SYCL_REG_N=${EIGEN_SYCL_REG_N})
- endif()
- if(EIGEN_SYCL_USE_PROGRAM_CLASS)
- add_definitions(-DEIGEN_SYCL_USE_PROGRAM_CLASS=${EIGEN_SYCL_USE_PROGRAM_CLASS})
- endif()
- if(EIGEN_SYCL_ASYNC_EXECUTION)
- add_definitions(-DEIGEN_SYCL_ASYNC_EXECUTION=${EIGEN_SYCL_ASYNC_EXECUTION})
- endif()
- if(EIGEN_SYCL_DISABLE_SKINNY)
- add_definitions(-DEIGEN_SYCL_DISABLE_SKINNY=${EIGEN_SYCL_DISABLE_SKINNY})
- endif()
- if(EIGEN_SYCL_DISABLE_DOUBLE_BUFFER)
- add_definitions(-DEIGEN_SYCL_DISABLE_DOUBLE_BUFFER=${EIGEN_SYCL_DISABLE_DOUBLE_BUFFER})
- endif()
- if(EIGEN_SYCL_DISABLE_RANK1)
- add_definitions(-DEIGEN_SYCL_DISABLE_RANK1=${EIGEN_SYCL_DISABLE_RANK1})
- endif()
- if(EIGEN_SYCL_DISABLE_SCALAR)
- add_definitions(-DEIGEN_SYCL_DISABLE_SCALAR=${EIGEN_SYCL_DISABLE_SCALAR})
- endif()
- if(EIGEN_SYCL_DISABLE_GEMV)
- add_definitions(-DEIGEN_SYCL_DISABLE_GEMV=${EIGEN_SYCL_DISABLE_GEMV})
- endif()
- if(EIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION)
- add_definitions(-DEIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION=${EIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION})
- endif()
+if(EIGEN_TEST_SYCL)
+ set(EIGEN_SYCL ON)
+ # Forward CMake options as preprocessor definitions
+ if(EIGEN_SYCL_USE_DEFAULT_SELECTOR)
+ add_definitions(-DEIGEN_SYCL_USE_DEFAULT_SELECTOR=${EIGEN_SYCL_USE_DEFAULT_SELECTOR})
+ endif()
+ if(EIGEN_SYCL_NO_LOCAL_MEM)
+ add_definitions(-DEIGEN_SYCL_NO_LOCAL_MEM=${EIGEN_SYCL_NO_LOCAL_MEM})
+ endif()
+ if(EIGEN_SYCL_LOCAL_MEM)
+ add_definitions(-DEIGEN_SYCL_LOCAL_MEM=${EIGEN_SYCL_LOCAL_MEM})
+ endif()
+ if(EIGEN_SYCL_MAX_GLOBAL_RANGE)
+ add_definitions(-DEIGEN_SYCL_MAX_GLOBAL_RANGE=${EIGEN_SYCL_MAX_GLOBAL_RANGE})
+ endif()
+ if(EIGEN_SYCL_LOCAL_THREAD_DIM0)
+ add_definitions(-DEIGEN_SYCL_LOCAL_THREAD_DIM0=${EIGEN_SYCL_LOCAL_THREAD_DIM0})
+ endif()
+ if(EIGEN_SYCL_LOCAL_THREAD_DIM1)
+ add_definitions(-DEIGEN_SYCL_LOCAL_THREAD_DIM1=${EIGEN_SYCL_LOCAL_THREAD_DIM1})
+ endif()
+ if(EIGEN_SYCL_REG_M)
+ add_definitions(-DEIGEN_SYCL_REG_M=${EIGEN_SYCL_REG_M})
+ endif()
+ if(EIGEN_SYCL_REG_N)
+ add_definitions(-DEIGEN_SYCL_REG_N=${EIGEN_SYCL_REG_N})
+ endif()
+ if(EIGEN_SYCL_USE_PROGRAM_CLASS)
+ add_definitions(-DEIGEN_SYCL_USE_PROGRAM_CLASS=${EIGEN_SYCL_USE_PROGRAM_CLASS})
+ endif()
+ if(EIGEN_SYCL_ASYNC_EXECUTION)
+ add_definitions(-DEIGEN_SYCL_ASYNC_EXECUTION=${EIGEN_SYCL_ASYNC_EXECUTION})
+ endif()
+ if(EIGEN_SYCL_DISABLE_SKINNY)
+ add_definitions(-DEIGEN_SYCL_DISABLE_SKINNY=${EIGEN_SYCL_DISABLE_SKINNY})
+ endif()
+ if(EIGEN_SYCL_DISABLE_DOUBLE_BUFFER)
+ add_definitions(-DEIGEN_SYCL_DISABLE_DOUBLE_BUFFER=${EIGEN_SYCL_DISABLE_DOUBLE_BUFFER})
+ endif()
+ if(EIGEN_SYCL_DISABLE_RANK1)
+ add_definitions(-DEIGEN_SYCL_DISABLE_RANK1=${EIGEN_SYCL_DISABLE_RANK1})
+ endif()
+ if(EIGEN_SYCL_DISABLE_SCALAR)
+ add_definitions(-DEIGEN_SYCL_DISABLE_SCALAR=${EIGEN_SYCL_DISABLE_SCALAR})
+ endif()
+ if(EIGEN_SYCL_DISABLE_GEMV)
+ add_definitions(-DEIGEN_SYCL_DISABLE_GEMV=${EIGEN_SYCL_DISABLE_GEMV})
+ endif()
+ if(EIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION)
+ add_definitions(-DEIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION=${EIGEN_SYCL_DISABLE_ARM_GPU_CACHE_OPTIMISATION})
+ endif()
- if(EIGEN_SYCL_TRISYCL)
- # triSYCL now requires c++17.
- set(CMAKE_CXX_STANDARD 17)
+ if(EIGEN_SYCL_TRISYCL)
+ # triSYCL now requires c++17.
+ set(CMAKE_CXX_STANDARD 17)
+ else()
+ if(MSVC)
+ # Set the host and device compilers C++ standard to C++14. On Windows setting this to C++11
+ # can cause issues with the ComputeCpp device compiler parsing Visual Studio Headers.
+ set(CMAKE_CXX_STANDARD 14)
+ list(APPEND COMPUTECPP_USER_FLAGS -DWIN32)
else()
- if(MSVC)
- # Set the host and device compilers C++ standard to C++14. On Windows setting this to C++11
- # can cause issues with the ComputeCpp device compiler parsing Visual Studio Headers.
- set(CMAKE_CXX_STANDARD 14)
- list(APPEND COMPUTECPP_USER_FLAGS -DWIN32)
- else()
- set(CMAKE_CXX_STANDARD 11)
- list(APPEND COMPUTECPP_USER_FLAGS -Wall)
- endif()
- # The following flags are not supported by Clang and can cause warnings
- # if used with -Werror so they are removed here.
- if(COMPUTECPP_USE_COMPILER_DRIVER)
- set(CMAKE_CXX_COMPILER ${ComputeCpp_DEVICE_COMPILER_EXECUTABLE})
- string(REPLACE "-Wlogical-op" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
- string(REPLACE "-Wno-psabi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
- endif()
- list(APPEND COMPUTECPP_USER_FLAGS
- -DEIGEN_NO_ASSERTION_CHECKING=1
- -no-serial-memop
- -Xclang
- -cl-mad-enable)
+ set(CMAKE_CXX_STANDARD 11)
+ list(APPEND COMPUTECPP_USER_FLAGS -Wall)
endif()
-
- ei_add_test(cxx11_tensor_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_image_op_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_math_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_forced_eval_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_broadcast_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_device_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_reduction_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_morphing_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_shuffling_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_padding_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_builtins_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_contract_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_concatenation_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_reverse_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_convolution_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_striding_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_chipping_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_layout_swap_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_inflation_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_random_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_generator_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_patch_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_image_patch_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_volume_patch_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_argmax_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_custom_op_sycl ${STD_CXX_FLAG})
- ei_add_test(cxx11_tensor_scan_sycl ${STD_CXX_FLAG})
- set(EIGEN_SYCL OFF)
+ # The following flags are not supported by Clang and can cause warnings
+ # if used with -Werror so they are removed here.
+ if(COMPUTECPP_USE_COMPILER_DRIVER)
+ set(CMAKE_CXX_COMPILER ${ComputeCpp_DEVICE_COMPILER_EXECUTABLE})
+ string(REPLACE "-Wlogical-op" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ string(REPLACE "-Wno-psabi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ endif()
+ list(APPEND COMPUTECPP_USER_FLAGS
+ -DEIGEN_NO_ASSERTION_CHECKING=1
+ -no-serial-memop
+ -Xclang
+ -cl-mad-enable)
endif()
- ei_add_test(cxx11_eventcount "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
- ei_add_test(cxx11_runqueue "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
- ei_add_test(cxx11_non_blocking_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
+ ei_add_test(cxx11_tensor_sycl)
+ ei_add_test(cxx11_tensor_image_op_sycl)
+ ei_add_test(cxx11_tensor_math_sycl)
+ ei_add_test(cxx11_tensor_forced_eval_sycl)
+ ei_add_test(cxx11_tensor_broadcast_sycl)
+ ei_add_test(cxx11_tensor_device_sycl)
+ ei_add_test(cxx11_tensor_reduction_sycl)
+ ei_add_test(cxx11_tensor_morphing_sycl)
+ ei_add_test(cxx11_tensor_shuffling_sycl)
+ ei_add_test(cxx11_tensor_padding_sycl)
+ ei_add_test(cxx11_tensor_builtins_sycl)
+ ei_add_test(cxx11_tensor_contract_sycl)
+ ei_add_test(cxx11_tensor_concatenation_sycl)
+ ei_add_test(cxx11_tensor_reverse_sycl)
+ ei_add_test(cxx11_tensor_convolution_sycl)
+ ei_add_test(cxx11_tensor_striding_sycl)
+ ei_add_test(cxx11_tensor_chipping_sycl)
+ ei_add_test(cxx11_tensor_layout_swap_sycl)
+ ei_add_test(cxx11_tensor_inflation_sycl)
+ ei_add_test(cxx11_tensor_random_sycl)
+ ei_add_test(cxx11_tensor_generator_sycl)
+ ei_add_test(cxx11_tensor_patch_sycl)
+ ei_add_test(cxx11_tensor_image_patch_sycl)
+ ei_add_test(cxx11_tensor_volume_patch_sycl)
+ ei_add_test(cxx11_tensor_argmax_sycl)
+ ei_add_test(cxx11_tensor_custom_op_sycl)
+ ei_add_test(cxx11_tensor_scan_sycl)
+ set(EIGEN_SYCL OFF)
+endif()
- ei_add_test(cxx11_meta)
- ei_add_test(cxx11_maxsizevector)
- ei_add_test(cxx11_tensor_argmax)
- ei_add_test(cxx11_tensor_assign)
- ei_add_test(cxx11_tensor_block_access)
- ei_add_test(cxx11_tensor_block_eval)
- ei_add_test(cxx11_tensor_block_io)
- ei_add_test(cxx11_tensor_broadcasting)
- ei_add_test(cxx11_tensor_casts)
- ei_add_test(cxx11_tensor_chipping)
- ei_add_test(cxx11_tensor_comparisons)
- ei_add_test(cxx11_tensor_concatenation)
- ei_add_test(cxx11_tensor_const)
- ei_add_test(cxx11_tensor_contraction)
- ei_add_test(cxx11_tensor_convolution)
- ei_add_test(cxx11_tensor_custom_index)
- ei_add_test(cxx11_tensor_custom_op)
- ei_add_test(cxx11_tensor_dimension)
- ei_add_test(cxx11_tensor_empty)
- ei_add_test(cxx11_tensor_executor "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
- ei_add_test(cxx11_tensor_expr)
- ei_add_test(cxx11_tensor_fft)
- ei_add_test(cxx11_tensor_fixed_size)
- ei_add_test(cxx11_tensor_forced_eval)
- ei_add_test(cxx11_tensor_generator)
- ei_add_test(cxx11_tensor_ifft)
- ei_add_test(cxx11_tensor_image_patch)
- ei_add_test(cxx11_tensor_index_list)
- ei_add_test(cxx11_tensor_inflation)
- ei_add_test(cxx11_tensor_intdiv)
- ei_add_test(cxx11_tensor_io)
- ei_add_test(cxx11_tensor_layout_swap)
- ei_add_test(cxx11_tensor_lvalue)
- ei_add_test(cxx11_tensor_map)
- ei_add_test(cxx11_tensor_math)
- ei_add_test(cxx11_tensor_mixed_indices)
- ei_add_test(cxx11_tensor_morphing)
- ei_add_test(cxx11_tensor_move)
- ei_add_test(cxx11_tensor_notification "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
- ei_add_test(cxx11_tensor_of_complex)
- ei_add_test(cxx11_tensor_of_const_values)
- ei_add_test(cxx11_tensor_of_strings)
- ei_add_test(cxx11_tensor_padding)
- ei_add_test(cxx11_tensor_patch)
- ei_add_test(cxx11_tensor_random)
- ei_add_test(cxx11_tensor_reduction)
- ei_add_test(cxx11_tensor_ref)
- ei_add_test(cxx11_tensor_roundings)
- ei_add_test(cxx11_tensor_scan)
- ei_add_test(cxx11_tensor_shuffling)
- ei_add_test(cxx11_tensor_simple)
- ei_add_test(cxx11_tensor_striding)
- ei_add_test(cxx11_tensor_sugar)
- ei_add_test(cxx11_tensor_thread_local "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
- ei_add_test(cxx11_tensor_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
- ei_add_test(cxx11_tensor_trace)
- ei_add_test(cxx11_tensor_volume_patch)
- # ei_add_test(cxx11_tensor_symmetry)
- if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- # This test requires __uint128_t which is only available on 64bit systems
- ei_add_test(cxx11_tensor_uint128)
- endif()
+ei_add_test(cxx11_eventcount "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
+ei_add_test(cxx11_runqueue "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
+ei_add_test(cxx11_non_blocking_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
+ei_add_test(cxx11_meta)
+ei_add_test(cxx11_maxsizevector)
+ei_add_test(cxx11_tensor_argmax)
+ei_add_test(cxx11_tensor_assign)
+ei_add_test(cxx11_tensor_block_access)
+ei_add_test(cxx11_tensor_block_eval)
+ei_add_test(cxx11_tensor_block_io)
+ei_add_test(cxx11_tensor_broadcasting)
+ei_add_test(cxx11_tensor_casts)
+ei_add_test(cxx11_tensor_chipping)
+ei_add_test(cxx11_tensor_comparisons)
+ei_add_test(cxx11_tensor_concatenation)
+ei_add_test(cxx11_tensor_const)
+ei_add_test(cxx11_tensor_contraction)
+ei_add_test(cxx11_tensor_convolution)
+ei_add_test(cxx11_tensor_custom_index)
+ei_add_test(cxx11_tensor_custom_op)
+ei_add_test(cxx11_tensor_dimension)
+ei_add_test(cxx11_tensor_empty)
+ei_add_test(cxx11_tensor_executor "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
+ei_add_test(cxx11_tensor_expr)
+ei_add_test(cxx11_tensor_fft)
+ei_add_test(cxx11_tensor_fixed_size)
+ei_add_test(cxx11_tensor_forced_eval)
+ei_add_test(cxx11_tensor_generator)
+ei_add_test(cxx11_tensor_ifft)
+ei_add_test(cxx11_tensor_image_patch)
+ei_add_test(cxx11_tensor_index_list)
+ei_add_test(cxx11_tensor_inflation)
+ei_add_test(cxx11_tensor_intdiv)
+ei_add_test(cxx11_tensor_io)
+ei_add_test(cxx11_tensor_layout_swap)
+ei_add_test(cxx11_tensor_lvalue)
+ei_add_test(cxx11_tensor_map)
+ei_add_test(cxx11_tensor_math)
+ei_add_test(cxx11_tensor_mixed_indices)
+ei_add_test(cxx11_tensor_morphing)
+ei_add_test(cxx11_tensor_move)
+ei_add_test(cxx11_tensor_notification "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
+ei_add_test(cxx11_tensor_of_complex)
+ei_add_test(cxx11_tensor_of_const_values)
+ei_add_test(cxx11_tensor_of_strings)
+ei_add_test(cxx11_tensor_padding)
+ei_add_test(cxx11_tensor_patch)
+ei_add_test(cxx11_tensor_random)
+ei_add_test(cxx11_tensor_reduction)
+ei_add_test(cxx11_tensor_ref)
+ei_add_test(cxx11_tensor_roundings)
+ei_add_test(cxx11_tensor_scan)
+ei_add_test(cxx11_tensor_shuffling)
+ei_add_test(cxx11_tensor_simple)
+ei_add_test(cxx11_tensor_striding)
+ei_add_test(cxx11_tensor_sugar)
+ei_add_test(cxx11_tensor_thread_local "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
+ei_add_test(cxx11_tensor_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
+ei_add_test(cxx11_tensor_trace)
+ei_add_test(cxx11_tensor_volume_patch)
+# ei_add_test(cxx11_tensor_symmetry)
+if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ # This test requires __uint128_t which is only available on 64bit systems
+ ei_add_test(cxx11_tensor_uint128)
endif()
find_package(CUDA 9.0)
diff --git a/unsupported/test/autodiff_scalar.cpp b/unsupported/test/autodiff_scalar.cpp
index e81a778..1dbf585 100644
--- a/unsupported/test/autodiff_scalar.cpp
+++ b/unsupported/test/autodiff_scalar.cpp
@@ -84,9 +84,7 @@
// workaround "unused typedef" warning:
VERIFY(!bool(internal::is_same<B, A>::value));
-#if EIGEN_HAS_CXX11
VERIFY(bool(std::is_base_of<B, A>::value));
-#endif
}
EIGEN_DECLARE_TEST(autodiff_scalar)
diff --git a/unsupported/test/cxx11_tensor_gpu.cu b/unsupported/test/cxx11_tensor_gpu.cu
index 83b150d..33cbac4 100644
--- a/unsupported/test/cxx11_tensor_gpu.cu
+++ b/unsupported/test/cxx11_tensor_gpu.cu
@@ -17,7 +17,7 @@
#include <unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
-#define EIGEN_GPU_TEST_C99_MATH EIGEN_HAS_CXX11
+#define EIGEN_GPU_TEST_C99_MATH 1
using Eigen::Tensor;
diff --git a/unsupported/test/kronecker_product.cpp b/unsupported/test/kronecker_product.cpp
index b5b764c..3bac01d 100644
--- a/unsupported/test/kronecker_product.cpp
+++ b/unsupported/test/kronecker_product.cpp
@@ -29,7 +29,7 @@
{
VERIFY_IS_EQUAL(ab.rows(), 6);
VERIFY_IS_EQUAL(ab.cols(), 6);
- VERIFY_IS_EQUAL(ab.nonZeros(), 36);
+ VERIFY_IS_EQUAL(ab.size(), 36);
VERIFY_IS_APPROX(ab.coeff(0,0), -0.4017367630386106);
VERIFY_IS_APPROX(ab.coeff(0,1), 0.1056863433932735);
VERIFY_IS_APPROX(ab.coeff(0,2), -0.7255206194554212);
diff --git a/unsupported/test/special_packetmath.cpp b/unsupported/test/special_packetmath.cpp
index 31233f1..faf10ef 100644
--- a/unsupported/test/special_packetmath.cpp
+++ b/unsupported/test/special_packetmath.cpp
@@ -114,7 +114,7 @@
Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-1),Scalar(2))));
}
-#if EIGEN_HAS_C99_MATH && (EIGEN_COMP_CXXVER >= 11)
+#if EIGEN_HAS_C99_MATH
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasLGamma, std::lgamma, internal::plgamma);
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErf, std::erf, internal::perf);
CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErfc, std::erfc, internal::perfc);