From 6da34d9d9e1416d993e4097b5ed2aec3a3b61884 Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Wed, 6 Mar 2024 09:14:58 -0800 Subject: [PATCH] Allow aligned assignment in TRMV. --- Eigen/src/Core/GeneralProduct.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h index 3ec685274..1220073a8 100644 --- a/Eigen/src/Core/GeneralProduct.h +++ b/Eigen/src/Core/GeneralProduct.h @@ -242,26 +242,18 @@ struct gemv_static_vector_if { template struct gemv_static_vector_if { - enum { - ForceAlignment = internal::packet_traits::Vectorizable, - PacketSize = internal::packet_traits::size - }; #if EIGEN_MAX_STATIC_ALIGN_BYTES != 0 - internal::plain_array + internal::plain_array m_data; EIGEN_STRONG_INLINE Scalar* data() { return m_data.array; } #else // Some architectures cannot align on the stack, // => let's manually enforce alignment by allocating more data and return the address of the first aligned element. internal::plain_array< - Scalar, internal::min_size_prefer_fixed(Size, MaxSize) + (ForceAlignment ? EIGEN_MAX_ALIGN_BYTES : 0), 0> + Scalar, internal::min_size_prefer_fixed(Size, MaxSize) + EIGEN_MAX_ALIGN_BYTES, 0> m_data; EIGEN_STRONG_INLINE Scalar* data() { - return ForceAlignment - ? reinterpret_cast((std::uintptr_t(m_data.array) & ~(std::size_t(EIGEN_MAX_ALIGN_BYTES - 1))) + - EIGEN_MAX_ALIGN_BYTES) - : m_data.array; + return reinterpret_cast((std::uintptr_t(m_data.array) & ~(std::size_t(EIGEN_MAX_ALIGN_BYTES - 1))) + EIGEN_MAX_ALIGN_BYTES); } #endif };