mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
@@ -317,6 +317,13 @@ class visitor_evaluator {
|
||||
const XprType& m_xpr;
|
||||
};
|
||||
|
||||
template <typename T, typename = void>
|
||||
struct visitor_has_linear_access : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct visitor_has_linear_access<T, decltype(functor_traits<T>::LinearAccess)>
|
||||
: std::integral_constant<bool, static_cast<bool>(functor_traits<T>::LinearAccess)> {};
|
||||
|
||||
template <typename Derived, typename Visitor, bool ShortCircuitEvaulation>
|
||||
struct visit_impl {
|
||||
using Evaluator = visitor_evaluator<Derived>;
|
||||
@@ -329,8 +336,7 @@ struct visit_impl {
|
||||
static constexpr int InnerSizeAtCompileTime = IsRowMajor ? ColsAtCompileTime : RowsAtCompileTime;
|
||||
static constexpr int OuterSizeAtCompileTime = IsRowMajor ? RowsAtCompileTime : ColsAtCompileTime;
|
||||
|
||||
static constexpr bool LinearAccess =
|
||||
Evaluator::LinearAccess && static_cast<bool>(functor_traits<Visitor>::LinearAccess);
|
||||
static constexpr bool LinearAccess = Evaluator::LinearAccess && visitor_has_linear_access<Visitor>::value;
|
||||
static constexpr bool Vectorize = Evaluator::PacketAccess && static_cast<bool>(functor_traits<Visitor>::PacketAccess);
|
||||
|
||||
static constexpr int PacketSize = packet_traits<Scalar>::size;
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace internal {
|
||||
|
||||
template <typename T, bool Vectorizable>
|
||||
struct functor_traits<TrackedVisitor<T, Vectorizable>> {
|
||||
enum { PacketAccess = Vectorizable, LinearAccess = false, Cost = 1 };
|
||||
enum { PacketAccess = Vectorizable, Cost = 1 };
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
Reference in New Issue
Block a user