[Pool] Problems using Boost.Pool with the Eigen matrix library
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.
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?
I'm trying it and it just isn't working. I keep getting breakpoints hit
inside of Eigen calls, presumably due to unaligned accesses.
Has anyone investigated this, and are there any reasonable options?
Perhaps a way to force the pool's start to be aligned, and a way to
make sure the sizeof() my type as a whole is aligned? (But what about
allocator conversion, eg, std::allocate_shared<T> may take an
allocator<T> but it converts it internally to an
allocator
On 14/10/10 21:28, lfrfly@icqmail.com wrote:
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.
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? I'm trying it and it just isn't working. I keep getting breakpoints hit inside of Eigen calls, presumably due to unaligned accesses.
Has anyone investigated this, and are there any reasonable options? Perhaps a way to force the pool's start to be aligned, and a way to make sure the sizeof() my type as a whole is aligned? (But what about allocator conversion, eg, std::allocate_shared<T> may take an allocator<T> but it converts it internally to an allocator
?) _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
You may want to make a custom allcoator that inherit from pool then use the poitner stashing memory alignement trick to align it afterward.
participants (2)
-
joel falcou
-
lfrfly@icqmail.com