8000 16-byte algined memory for NumPy development · Issue #7013 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

16-byte algined memory for NumPy development #7013

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

Closed
bashtage opened this issue Jan 15, 2016 · 3 comments
Closed

16-byte algined memory for NumPy development #7013

bashtage opened this issue Jan 15, 2016 · 3 comments

Comments

@bashtage
Copy link
Contributor

Does anyone have any insights on getting 16 byte aligned memory (at least on x86/_64 systems)? I saw #1165 and #1166 but this doesn't seem to have gone anywhere.

I have implemented dSFMT as an alternative to the random-kit generator in an attempt at general structure for RandomState here https://github.com/bashtage/ng-numpy-randomstate/ . Unfortunately I can't use -DHAVE_SSE2 since on occasion the allocated memory is not aligned.

The obvious solution is to over allocate memory to ensure that the key array si 16-byte aligned, but this feels clumsy at best. If anyone has experience with this it would be appreciated.

@bashtage
Copy link
Contributor Author

Found this reference for working with FFTW which suggests that overallocation and manual alignment is solution.

@juliantaylor
Copy link
Contributor

btw. on x86_64 systems allocated memory is always 16 byte aligned
also modern intel and amd cpus don't care much about alignment anymore, that ended with the haswell

@bashtage
Copy link
Contributor Author

Thanks - I'm surprised I missed #5312 which is almost exactly what I need, and done better than my one-off-solution.

I think alignment still matters when interfacing with 3rd party code which uses SSE2 intrinsics that require alignment (short of rewriting SSE2 parts of the code).

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

No branches or pull requests

2 participants
0