Let unpacket_traits<> exposes the required alignment and make use of it everywhere

This commit is contained in:
Gael Guennebaud
2015-08-07 10:44:01 +02:00
parent 2afdef6a54
commit ce57dbd937
18 changed files with 54 additions and 43 deletions

View File

@@ -614,7 +614,8 @@ template<typename Derived>
static inline Index first_default_aligned(const DenseBase<Derived>& m)
{
typedef typename Derived::Scalar Scalar;
return first_aligned<packet_traits<Scalar>::size*sizeof(Scalar)>(m);
typedef typename packet_traits<Scalar>::type DefaultPacketType;
return first_aligned<unpacket_traits<DefaultPacketType>::alignment>(m);
}
template<typename Derived, bool HasDirectAccess = has_direct_access<Derived>::ret>