Re: [eigen] [Pool] Problems using Boost.Pool with the Eigen matrix library

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


2010/10/14  <lfrfly@xxxxxxxxxxx>:
> Since Eigen matrices and vectors use SSE and therefore require a particular
> alignment, Eigen requires that when these types (specifically, the
> compile-time sized versions) are within a struct or class, that struct be
> given the EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro.

What we do require is that e.g. Vector4f's be created at 16 byte
aligned locations. EIGEN_MAKE_ALIGNED_OPERATOR_NEW is just one way of
doing that.

>
> But here's the problem. What if that struct is allocated by a
> boost::pool_allocator<T>? Is there any way to enforce alignment then?

That's a question for boost::pool_allocator, not for us; if this
allocator doesn't give you 16 byte alignment, then you need a
different allocator (or just modify this allocator to meet this
criterion).

The allocator is what gives you an address. If it's giving
non-16-byte-aligned addresses, then it can't be used.

Benoit



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