Skip to content

Refactor Memory Access Iterators#75

Merged
SimeonEhrig merged 5 commits intoalpaka-group:masterfrom
SimeonEhrig:refactorMemAccessStrategy
Feb 15, 2022
Merged

Refactor Memory Access Iterators#75
SimeonEhrig merged 5 commits intoalpaka-group:masterfrom
SimeonEhrig:refactorMemAccessStrategy

Conversation

@SimeonEhrig
Copy link
Copy Markdown
Member

  • Rename Iterator to Memory Access Strategy
  • remove data member from iterator because:
  • not necessary for functionality
  • causes a bug on CPU backends with fancy iterators
  • create unnecessary temporary objects
  • harder to read
  • harder to optimize for the compiler

- rename was necessary to avoid confusions with fancy iterator
- rename and flat namespace of the mem access strategy
- move related files to new folder
- now, the memory access strategy returns the index instead the actual data element
@bussmann
Copy link
Copy Markdown

I wonder if Vikunja memory access could profit from LLAMA...

@SimeonEhrig
Copy link
Copy Markdown
Member Author

I wonder if Vikunja memory access could profit from LLAMA...

For this PR, it is not interesting, because the current implementation of the memory access strategies requires 1D memory without padding. But in general, yes. I want to support also multidimensional memory #61 . I think std::mdspan is a good idea for the memory access, like @bernhardmgruber already suggested for llama and alpaka.

- rename also folder hierarchy
@SimeonEhrig
Copy link
Copy Markdown
Member Author

After a discussion with @bernhardmgruber we find out, that std::mdspan does not support padding, when the padding is not multiple of the size of a single element. Therefore I will use alpaka::accessors, which supports this.

As side not, std::mdspan supports also other nice features like slicing. But I don't need this feature for vikunja.

- clean up of the test
- prepare for addition iterator tests
- add cmake helper function for tests
- add memory allocation function for tests
@SimeonEhrig SimeonEhrig marked this pull request as ready for review February 8, 2022 13:05
@SimeonEhrig
Copy link
Copy Markdown
Member Author

The RP is ready for merging. At the moment, some tests and documentation are missing. This will follow in another PR. This PR needs to be merged, because it is a show stopper for PR #62, #68, #71, #72.

Copy link
Copy Markdown
Member

@j-stephan j-stephan left a comment

Choose a reason for hiding this comment

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

Some suggestions:

Comment thread include/vikunja/access/BaseStrategy.hpp Outdated
Comment thread include/vikunja/access/PolicyBasedBlockStrategy.hpp Outdated
Comment thread include/vikunja/access/PolicyBasedBlockStrategy.hpp Outdated
Comment thread include/vikunja/access/PolicyBasedBlockStrategy.hpp Outdated
Comment thread include/vikunja/access/PolicyBasedBlockStrategy.hpp Outdated
Comment thread include/vikunja/access/PolicyBasedBlockStrategy.hpp Outdated
Comment thread test/include/vikunja/test/AlpakaSetup.hpp Outdated
Comment thread include/vikunja/reduce/detail/BlockThreadReduceKernel.hpp Outdated
@SimeonEhrig SimeonEhrig force-pushed the refactorMemAccessStrategy branch from b86b6fc to f3aaa68 Compare February 15, 2022 12:49
@SimeonEhrig SimeonEhrig merged commit 4baaeb4 into alpaka-group:master Feb 15, 2022
@SimeonEhrig SimeonEhrig added this to the release 0.2 milestone Feb 23, 2022
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.

3 participants