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

llama::One is insufficiently aligned #339

Closed
bernhardmgruber opened this issue Aug 22, 2021 · 1 comment · Fixed by #355
Closed

llama::One is insufficiently aligned #339

bernhardmgruber opened this issue Aug 22, 2021 · 1 comment · Fixed by #355
Labels
bug Something isn't working

Comments

@bernhardmgruber
Copy link
Member

bernhardmgruber commented Aug 22, 2021

llama::One represents and maintains storage for a single record value. From the perspective of the compiler however, it is just a byte array plus the mapping and an empty array dimension coord. The latter two occupy no space and are optimized away by [[no_unique_address]]. The compiler thus computes an alignment of 1 for a llama::One. However, on access, bytes inside a llama::One are reinterpreted as types with higher than one alignment requirements. llama::One itself thus needs to be aligned properly depending on the contained record values.

@bernhardmgruber bernhardmgruber added the bug Something isn't working label Aug 23, 2021
@bernhardmgruber
Copy link
Member Author

The problem is even reaching further, because in principle every View with blobs that contain the storage themselves might be insufficiently aligned. We might need to change the allocator interface to support requesting sufficiently aligned blobs.

bernhardmgruber added a commit to bernhardmgruber/llama that referenced this issue Aug 31, 2021
This makes llama::One sufficiently aligned.
Fixes: alpaka-group#339
bernhardmgruber added a commit to bernhardmgruber/llama that referenced this issue Aug 31, 2021
This makes llama::One sufficiently aligned.
Fixes: alpaka-group#339
bernhardmgruber added a commit to bernhardmgruber/llama that referenced this issue Aug 31, 2021
This makes llama::One sufficiently aligned.
Fixes: alpaka-group#339
bernhardmgruber added a commit to bernhardmgruber/llama that referenced this issue Aug 31, 2021
This makes llama::One sufficiently aligned.
Fixes: alpaka-group#339
bernhardmgruber added a commit to bernhardmgruber/llama that referenced this issue Sep 2, 2021
This makes llama::One sufficiently aligned.
Fixes: alpaka-group#339
bernhardmgruber added a commit to bernhardmgruber/llama that referenced this issue Sep 2, 2021
This makes llama::One sufficiently aligned.
Fixes: alpaka-group#339
bernhardmgruber added a commit that referenced this issue Sep 2, 2021
This makes llama::One sufficiently aligned.
Fixes: #339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant