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

Add alignment support to contiguous resource #181

Merged
merged 1 commit into from
Jun 29, 2022

Conversation

stephenswat
Copy link
Member

Previously, the contiguous memory resource ignored its allocation parameter, which lead to errors - in particular issue #180. This commit reworks the internal allocation strategy to use std::align, ensuring that memory is properly aligned.

This also breaks (in a valid way) some of the tests, which are adapted to support the new behaviour.

Closes #180.

Previously, the contiguous memory resource ignored its allocation
parameter, which lead to errors - in particular issue acts-project#180. This commit
reworks the internal allocation strategy to use std::align, ensuring
that memory is properly aligned.

This also breaks (in a valid way) some of the tests, which are adapted
to support the new behaviour.

Closes acts-project#180.
Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think std::align is the way to go. Just 2 comments, which don't necessarily need to happen in this PR. But they should happen somewhere.

  • Every other downstream memory resource needs to be taught to respect the alignment requests. Most importantly the caching allocators. (@Yhatoh, how do you feel about teaching vecmem::arenam_memory_resource to deal with alignments correctly as well? 😉)
  • We should add unit tests that exercise the alignment properly. Including some "device tests" that would check if memory created through "weird allocations" could be correctly handled by some dummy kernels.

@stephenswat
Copy link
Member Author

Encoded the requirements into new issues, so we can merge this in as far as I'm concerned.

@krasznaa krasznaa merged commit 01ddca0 into acts-project:main Jun 29, 2022
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 this pull request may close these issues.

Issue with using contiguous memory resource for traccc_seq_example_cuda
2 participants