aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/XprHelper.h
diff options
context:
space:
mode:
authorGravatar Francesco Mazzoli <f@mazzo.li>2020-01-13 16:15:30 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2020-02-07 18:16:16 +0100
commit44df2109c8c700222643a9a45f144676348f4df1 (patch)
treeca18d192bf612f4f72483915f68c83908423830b /Eigen/src/Core/util/XprHelper.h
parent5ca10480b0756e40b0723d90adeba8506291fc7c (diff)
Pick full packet unconditionally when EIGEN_UNALIGNED_VECTORIZE
See comment for details.
Diffstat (limited to 'Eigen/src/Core/util/XprHelper.h')
-rw-r--r--Eigen/src/Core/util/XprHelper.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h
index 26aa609fe..22f8bdd6c 100644
--- a/Eigen/src/Core/util/XprHelper.h
+++ b/Eigen/src/Core/util/XprHelper.h
@@ -194,8 +194,20 @@ template<typename T> struct unpacket_traits
};
};
+// If we vectorize regardless of alignment, always pick the full-sized packet,
+// if we have enough data to process.
+//
+// Otherwise, pick the packet size we know is going to work with the alignment
+// of the given data. See
+// <https://gitlab.com/libeigen/eigen/merge_requests/46#note_270578113> for more
+// information.
+#if EIGEN_UNALIGNED_VECTORIZE
template<int Size, typename PacketType,
bool Stop = Size==Dynamic || Size >= unpacket_traits<PacketType>::size || 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>