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 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 +// for more +// information. +#if EIGEN_UNALIGNED_VECTORIZE template= unpacket_traits::size || is_same::half>::value> +#else +template::size)==0 || is_same::half>::value> +#endif struct find_best_packet_helper; template< int Size, typename PacketType>