From 65186ef18d6212b3d09b1d619f1cf1019c2ae0fb Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 6 Aug 2015 14:07:59 +0200 Subject: Fix logic in compute_default_alignment, extend it to Dynamic size, and move it to XprHelper.h file. --- Eigen/src/Core/DenseStorage.h | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'Eigen/src/Core/DenseStorage.h') diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 5edf8a4ee..340484610 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -34,34 +34,13 @@ void check_static_allocation_size() #endif } -templateEIGEN_MIN_ALIGN_BYTES) > -struct compute_default_alignment -{ - enum { value = 0 }; -}; - -template -struct compute_default_alignment // Match -{ - enum { value = AlignmentBytes }; -}; - -template -struct compute_default_alignment // Try-half -{ - // current packet too large, try with an half-packet - enum { value = compute_default_alignment::value }; -}; - /** \internal * Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned: * to 16 bytes boundary if the total size is a multiple of 16 bytes. */ template ::size*sizeof(T), EIGEN_MAX_STATIC_ALIGN_BYTES) >::value > + : compute_default_alignment::value > struct plain_array { T array[Size]; @@ -107,7 +86,7 @@ struct plain_array EIGEN_DEVICE_FUNC plain_array() - { + { EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(7); check_static_allocation_size(); } @@ -145,7 +124,7 @@ struct plain_array EIGEN_DEVICE_FUNC plain_array() - { + { EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(31); check_static_allocation_size(); } -- cgit v1.2.3