mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
masked load/store framework
This commit is contained in:
@@ -514,6 +514,12 @@ template <typename Xpr>
|
||||
struct eigen_memset_helper;
|
||||
template <typename Xpr, bool use_memset = eigen_memset_helper<Xpr>::value>
|
||||
struct eigen_zero_impl;
|
||||
|
||||
template <typename Packet>
|
||||
struct has_packet_segment : std::false_type {};
|
||||
|
||||
template <typename Xpr>
|
||||
struct enable_packet_segment : std::true_type {};
|
||||
} // namespace internal
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
@@ -90,12 +90,8 @@ namespace internal {
|
||||
* we however don't want to add a dependency to Boost.
|
||||
*/
|
||||
|
||||
struct true_type {
|
||||
enum { value = 1 };
|
||||
};
|
||||
struct false_type {
|
||||
enum { value = 0 };
|
||||
};
|
||||
using std::false_type;
|
||||
using std::true_type;
|
||||
|
||||
template <bool Condition>
|
||||
struct bool_constant;
|
||||
|
||||
@@ -996,6 +996,27 @@ struct is_matrix_base_xpr : std::is_base_of<MatrixBase<remove_all_t<XprType>>, r
|
||||
template <typename XprType>
|
||||
struct is_permutation_base_xpr : std::is_base_of<PermutationBase<remove_all_t<XprType>>, remove_all_t<XprType>> {};
|
||||
|
||||
/*---------------- load/store segment support ----------------*/
|
||||
|
||||
// recursively traverse unary, binary, and ternary expressions to determine if packet segments are supported
|
||||
|
||||
template <typename Func, typename Xpr>
|
||||
struct enable_packet_segment<CwiseNullaryOp<Func, Xpr>> : enable_packet_segment<remove_all_t<Xpr>> {};
|
||||
|
||||
template <typename Func, typename Xpr>
|
||||
struct enable_packet_segment<CwiseUnaryOp<Func, Xpr>> : enable_packet_segment<remove_all_t<Xpr>> {};
|
||||
|
||||
template <typename Func, typename LhsXpr, typename RhsXpr>
|
||||
struct enable_packet_segment<CwiseBinaryOp<Func, LhsXpr, RhsXpr>>
|
||||
: bool_constant<enable_packet_segment<remove_all_t<LhsXpr>>::value &&
|
||||
enable_packet_segment<remove_all_t<RhsXpr>>::value> {};
|
||||
|
||||
template <typename Func, typename LhsXpr, typename MidXpr, typename RhsXpr>
|
||||
struct enable_packet_segment<CwiseTernaryOp<Func, LhsXpr, MidXpr, RhsXpr>>
|
||||
: bool_constant<enable_packet_segment<remove_all_t<LhsXpr>>::value &&
|
||||
enable_packet_segment<remove_all_t<MidXpr>>::value &&
|
||||
enable_packet_segment<remove_all_t<RhsXpr>>::value> {};
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
/** \class ScalarBinaryOpTraits
|
||||
|
||||
Reference in New Issue
Block a user