From 175ed636ea3ac5b1b807642421a036f8a9a10f1f Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 29 Jul 2015 10:22:25 +0200 Subject: bug #973: update macro-level control of alignement by introducing user-controllable EIGEN_MAX_ALIGN_BYTES and EIGEN_MAX_STATIC_ALIGN_BYTES macros. This changeset also removes EIGEN_ALIGN (replaced by EIGEN_MAX_ALIGN_BYTES>0), EIGEN_ALIGN_STATICALLY (replaced by EIGEN_MAX_STATIC_ALIGN_BYTES>0), EIGEN_USER_ALIGN*, EIGEN_ALIGN_DEFAULT (replaced by EIGEN_ALIGN_MAX). --- Eigen/src/Core/DenseStorage.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'Eigen/src/Core/DenseStorage.h') diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 5eb434c6d..5edf8a4ee 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -34,26 +34,25 @@ void check_static_allocation_size() #endif } -template::type, - bool Match = bool((Size%unpacket_traits::size)==0), - bool TryHalf = bool(int(unpacket_traits::size) > 1) - && bool(int(unpacket_traits::size) > int(unpacket_traits::half>::size)) > +templateEIGEN_MIN_ALIGN_BYTES) > struct compute_default_alignment { enum { value = 0 }; }; -template -struct compute_default_alignment // Match +template +struct compute_default_alignment // Match { - enum { value = sizeof(T) * unpacket_traits::size }; + enum { value = AlignmentBytes }; }; -template -struct compute_default_alignment // Try-half +template +struct compute_default_alignment // Try-half { // current packet too large, try with an half-packet - enum { value = compute_default_alignment::half>::value }; + enum { value = compute_default_alignment::value }; }; /** \internal @@ -62,7 +61,7 @@ struct compute_default_alignment // Try-half */ template ::value > + : compute_default_alignment::size*sizeof(T), EIGEN_MAX_STATIC_ALIGN_BYTES) >::value > struct plain_array { T array[Size]; @@ -180,7 +179,7 @@ struct plain_array template struct plain_array { - EIGEN_USER_ALIGN_DEFAULT T array[1]; + T array[1]; EIGEN_DEVICE_FUNC plain_array() {} EIGEN_DEVICE_FUNC plain_array(constructor_without_unaligned_array_assert) {} }; -- cgit v1.2.3