Select AVX2 even if the data size is not a multiple of 8

This is a second version of !46 (closed) . That PR contained very useful comments that now seem to be lost.

In any case, it was first merged, and then reverted by @rmlarsen1 because some tests were failing. I fixed the tests and added some more tests on top, but it was never merged back.

Moreover, the branch was reverted wrongly, in the sense that the revert still left some changes in:

% git diff 52a2fbbb008a47c5e3fb8ac1c65c2feecb0c511c..5ca10480b0756e40b0723d90adeba8506291fc7c Eigen/src/Core/util/XprHelper.h
diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h
index fd2db56a4..26aa609fe 100644
--- a/Eigen/src/Core/util/XprHelper.h
+++ b/Eigen/src/Core/util/XprHelper.h
@@ -195,7 +195,7 @@ template<typename T> struct unpacket_traits
 };
 
 template<int Size, typename PacketType,
-         bool Stop = Size==Dynamic || (Size%unpacket_traits<PacketType>::size)==0 || is_same<PacketType,typename unpacket_traits<PacketType>::half>::value>
+         bool Stop = Size==Dynamic || Size >= unpacket_traits<PacketType>::size || is_same<PacketType,typename unpacket_traits<PacketType>::half>::value>
 struct find_best_packet_helper;
 
 template< int Size, typename PacketType>

So the first fix of my MR (commit 5ca10480) actually mistakenly remained in master, but without the further improvements later.

It's quite unfortunate that the very useful discussion that happened in !46 (closed) is now gone. Is there a way to recover it?

Edited by Francesco Mazzoli

Merge request reports

Loading