fixed doc string for alpaka::Vec named components#505
Open
SimeonEhrig wants to merge 1 commit intoalpaka-group:devfrom
Open
fixed doc string for alpaka::Vec named components#505SimeonEhrig wants to merge 1 commit intoalpaka-group:devfrom
SimeonEhrig wants to merge 1 commit intoalpaka-group:devfrom
Conversation
- refactor macro `ALPAKA_NAMED_ARRAY_ACCESS` to avoid misunderstandings - fixed doc string also for assignment and binary operators
psychocoderHPC
requested changes
Apr 23, 2026
| #define ALPAKA_NAMED_ARRAY_ACCESS(functionName, dimValue) \ | ||
| constexpr decltype(auto) functionName() requires(T_dim >= dimValue + 1) \ | ||
| #define ALPAKA_NAMED_ARRAY_ACCESS(functionName, index_pos) \ | ||
| constexpr decltype(auto) functionName() requires(index_pos >= 0) \ |
Member
There was a problem hiding this comment.
This introduces a bug. The index position is unsigned and using for the call DIM - 3u for w will be a large number if the vector is one dimensional and it will be allowed to call w() because the condition is true.
The requires must be indexPos < T_dim.
Member
There was a problem hiding this comment.
or IndexPos >=0 && indexPos < T_dim because the other could throw a compiler error if dim is one.
| */ | ||
| #define ALPAKA_NAMED_ARRAY_ACCESS(functionName, dimValue) \ | ||
| constexpr decltype(auto) functionName() requires(T_dim >= dimValue + 1) \ | ||
| #define ALPAKA_NAMED_ARRAY_ACCESS(functionName, index_pos) \ |
Member
There was a problem hiding this comment.
index_pos should be indexPos because we use camelaCase not snake_case namings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ALPAKA_NAMED_ARRAY_ACCESSto avoid misunderstandingsBefore the components was created with:
This was misleading because it look likes x would point to index position 0.