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

Align SoA subarrays when using single blob #648

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

bernhardmgruber
Copy link
Member

@bernhardmgruber bernhardmgruber commented Dec 2, 2022

This changeset will align SoA sub arrays by default when using a single blob. This can cause a potential performance loss, but improves correctness.

@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Merging #648 (d21a40a) into develop (78d38bd) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #648   +/-   ##
========================================
  Coverage    98.75%   98.75%           
========================================
  Files           74       74           
  Lines         6818     6818           
========================================
  Hits          6733     6733           
  Misses          85       85           

@psychocoderHPC
Copy link
Member

Why could this result in a performance loss?

@bernhardmgruber
Copy link
Member Author

bernhardmgruber commented Dec 13, 2022

Because I need to do additional arithmetic in the mapping function which depends on the array size to compute the necessary padding. If the array size is runtime, this padding can also only be computed at runtime. Furthermore, you need to repeat that computation for each struct member that comes before the one you are accessing. It is essentially this loop: https://github.com/alpaka-group/llama/blob/develop/include/llama/mapping/SoA.hpp#L119-L127. With #653, I can precompute a table and avoid the loop iff the array extents are known at compile time.

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

Successfully merging this pull request may close these issues.

2 participants