New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std container types of Eigen matrix types missing eigen allocators #34
Comments
As you might have expected, it was a conscious decision to not add these to the code. Here are our current thoughts:
So my question would be where you have seen crashes: Do you use a 32-bit platform? What operating system? Which compiler? |
I've not yet seen any Cartographer crashes, but had seen alignment related crashes in the past when using Eigen but not using aligned allocators. The finer points on when it may and may not matter are not something I've dived deep on yet so if you're confident it's not an issue, I certainly defer. |
The alignment macro is required whenever a **fixed-size** Eigen container
is used as a member of classes that will be allocated dynamically in the
heap. For local objects in the stack, it may be required to add a different
compiler attribute that ensures the proper 16-byte alignment, Eigen has its
own macro for this as well.
As said above 64bit systems normally do allocate dynamic memory with the
alignment required by SSE Eigen optimizations, so this is only a real issue
if the maintainers really want to support 32bit builds...
Cheers,
PS: thank you Google for sharing this project!!
|
@jlblancoc I opened a separate issue and pull request specifically regarding EIGEN_MAKE_ALIGNED_NEW (#36, #39). There are a dozen or so classes/structs which have data members which are fixed-size eigen types. I'm unaware of the fine detail on when it's ok not to heed the warnings of the Eigen team, so I defer to those who are confident that they do. |
As discussed and documented in the system requirements, we currently target only 64-bit systems where this is not necessary. I'll close this now. |
Per https://eigen.tuxfamily.org/dox-devel/group__TopicStlContainers.html
Using STL containers on fixed-size vectorizable Eigen types, or classes having members of such types, requires special handling.
Either std container types should use the Eigen::aligned_allocator (preferred)
or a container specialization that has the same effect.
A first attempt to grep for instances that are missing aligned allocators yields a number of apparent cases where std::vector requires an aligned allocator.
I'll try to produce a pull request fixing this issue unless someone can indicate not an issue in this case for some reason unaware of.
The text was updated successfully, but these errors were encountered: