Skip to content
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

Storage pointer alignment in nalgebra #536

Open
sebcrozet opened this issue Feb 3, 2019 · 1 comment
Open

Storage pointer alignment in nalgebra #536

sebcrozet opened this issue Feb 3, 2019 · 1 comment
Labels

Comments

@sebcrozet
Copy link
Member

See the discussion in #480 for details.
We need to see when and how we want pointers of matrices (including empty matrices) to be aligned.

@sebcrozet sebcrozet added enhancement P-medium Medium priority labels Feb 3, 2019
@Andlon
Copy link
Sponsor Collaborator

Andlon commented May 2, 2019

Just want to add that we really should thoroughly investigate the claim that storage needs to be aligned. On modern microprocessors, whether or not data is aligned may be largely irrelevant for performance reasons. Many SIMD instructions are identical for aligned/unaligned storage on modern hardware. There may be a slight issue with unaligned storage cross cache boundaries, however, but we should in any case try to measure any such effects.

On the other hand, dealing with alignment adds complexity. For an example of this complexity, just look at Eigen (C++ library): due to alignment considerations it is undefined behavior to store aligned types in standard library data structures (e.g. std::vector<Matrix4d>), or in structs (e.g. struct MyStruct { Matrix4d m; }).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants