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

permutation iterator, not thoroughly checked yet #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taniakrisanty
Copy link

No description provided.

<< "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 };
Copy link
Member

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;
Copy link
Member

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);
Copy link
Member

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)
Copy link
Member

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.

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