-
Notifications
You must be signed in to change notification settings - Fork 5
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
permutation iterator, not thoroughly checked yet #71
base: master
Are you sure you want to change the base?
Conversation
<< "Testing permutation iterator with value: 10\n"; | ||
//*/ | ||
|
||
std::vector<TRed> values{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
values and indices should be alpaka memory buffers or pointers to the buffers.
// Get a queue on the accelerator device. | ||
QueueAcc queueAcc(devAcc); | ||
|
||
typedef std::vector<TRed> element_range_type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use using
instead typedef
.
*/ | ||
NODISCARD ALPAKA_FN_INLINE reference operator*() const | ||
{ | ||
return *(elIter + *idxIter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The access should be elIter[idxIter[idx]]]
. Don't forget to check the size of idxIter
.
/** | ||
* @brief Index operator to get stored value at some given offset from this iterator | ||
*/ | ||
NODISCARD ALPAKA_FN_INLINE reference operator[](int _idx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
operator[]
does not change the own index.
No description provided.