mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-24 14:45:14 +08:00
Disabled the use of aligned memory loads when converting a tensor from float to doubles since alignment can't always be guaranteed.
This commit is contained in:
parent
4fd7f47692
commit
d9cb604a5d
@ -94,7 +94,8 @@ struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 1, 2> {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const {
|
||||
const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
|
||||
if (index + SrcPacketSize < m_maxIndex) {
|
||||
return internal::pcast<SrcPacket, TgtPacket>(m_impl.template packet<LoadMode>(index));
|
||||
// Force unaligned memory loads since we can't ensure alignment anymore
|
||||
return internal::pcast<SrcPacket, TgtPacket>(m_impl.template packet<Unaligned>(index));
|
||||
} else {
|
||||
const int TgtPacketSize = internal::unpacket_traits<TgtPacket>::size;
|
||||
EIGEN_ALIGN_DEFAULT typename internal::unpacket_traits<TgtPacket>::type values[TgtPacketSize];
|
||||
|
Loading…
Reference in New Issue
Block a user