#define EIGEN_UNROLLING_LIMIT 100000 #include #include #include using namespace Eigen; template struct assign_enforcedvec_CompleteUnrolling { enum { outer = Index / Derived1::InnerSizeAtCompileTime, inner = Index % Derived1::InnerSizeAtCompileTime, }; EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src) { dst.template writePacket<(Derived1::Flags&AlignedBit)?Aligned:Unaligned>(inner,outer, src.template packet<(Derived2::Flags&AlignedBit)?Aligned:Unaligned>(inner,outer)); assign_enforcedvec_CompleteUnrolling::size, Stop>::run(dst, src); } }; template struct assign_enforcedvec_CompleteUnrolling { EIGEN_STRONG_INLINE static void run(Derived1 &, const Derived2 &) {} }; template void assign_packet_unrolling(Dest& dst, const Src& src) { assign_enforcedvec_CompleteUnrolling::run(dst, src); } typedef float Scalar; const int N = 16; const int B = 8; const int K = 1; typedef Matrix VectorA; typedef Matrix VectorB; EIGEN_DONT_INLINE void foo_unaligned(const VectorA& v0, const VectorA& v1, VectorA& v2) { EIGEN_ASM_COMMENT("my foo_unaligned"); VectorBlock dest = v2.segment(2); for(int k=0;k(1) - v1.segment(3)); } EIGEN_DONT_INLINE void foo_default(const VectorA& v0, const VectorA& v1, VectorA& v2) { EIGEN_ASM_COMMENT("my foo_default"); for(int k=0;k(2) = 2 * v0.segment(1) - v1.segment(3); } EIGEN_DONT_INLINE void foo_aligned(const VectorB& v0, const VectorB& v1, VectorB& v2) { EIGEN_ASM_COMMENT("my foo_aligned"); for(int k=0;k