Re: [eigen] Aligned Fixed Sized Mapped matrices

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi Sameer,

it's not really a requirement but a condition that relax the first requirement, it reads:

- is the given pointer aligned as specified by the user?
- if not, then let's not trigger an assertion if the input data is too small to bother about vectorization (and thus alignment) anyway.

I hope that makes more sense now?

Gael


On Fri, Jan 12, 2018 at 10:13 PM, Sameer Agarwal <sameeragarwal@xxxxxxxxxx> wrote:
I was playing with mapping small fixed aligned buffers to fixed sized matrices and encountered an interesting eigen assertion failure in MapBase.h

Line 190 MapBase.h:
eigen_assert((   ((internal::UIntPtr(m_data) % internal::traits<Derived>::Alignment) == 0)
                    || (cols() * rows() * innerStride() * sizeof(Scalar)) < internal::traits<Derived>::Alignment ) && "data is not aligned");

I am particularly curious about the requirement

(cols() * rows() * innerStride() * sizeof(Scalar)) < internal::traits<Derived>::Alignment

Why this rather strict requirement?

Sameer




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/