mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Let unpacket_traits<> exposes the required alignment and make use of it everywhere
This commit is contained in:
@@ -553,7 +553,8 @@ inline Index first_aligned(const Scalar* array, Index size)
|
||||
template<typename Scalar, typename Index>
|
||||
inline Index first_default_aligned(const Scalar* array, Index size)
|
||||
{
|
||||
return first_aligned<packet_traits<Scalar>::size*sizeof(Scalar)>(array, size);
|
||||
typedef typename packet_traits<Scalar>::type DefaultPacketType;
|
||||
return first_aligned<unpacket_traits<DefaultPacketType>::alignment>(array, size);
|
||||
}
|
||||
|
||||
/** \internal Returns the smallest integer multiple of \a base and greater or equal to \a size
|
||||
|
||||
@@ -119,7 +119,11 @@ template<typename T> struct unpacket_traits
|
||||
{
|
||||
typedef T type;
|
||||
typedef T half;
|
||||
enum {size=1};
|
||||
enum
|
||||
{
|
||||
size = 1,
|
||||
alignment = 1
|
||||
};
|
||||
};
|
||||
|
||||
#if EIGEN_MAX_STATIC_ALIGN_BYTES>0
|
||||
|
||||
Reference in New Issue
Block a user