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

Reshape method #1760

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open

Reshape method #1760

wants to merge 13 commits into from

Conversation

artv3
Copy link
Member

@artv3 artv3 commented Nov 5, 2024

Summary

This PR adds helper methods to views to create Reshape methods with compile time options C and Fortran style indexing

@artv3 artv3 changed the title reshape method Reshape method Nov 5, 2024
examples/reshape.cpp Outdated Show resolved Hide resolved
examples/reshape.cpp Outdated Show resolved Hide resolved
examples/reshape.cpp Outdated Show resolved Hide resolved
examples/reshape.cpp Outdated Show resolved Hide resolved
examples/reshape.cpp Outdated Show resolved Hide resolved
include/RAJA/util/View.hpp Outdated Show resolved Hide resolved
examples/reshape.cpp Outdated Show resolved Hide resolved
examples/reshape.cpp Outdated Show resolved Hide resolved
@artv3
Copy link
Member Author

artv3 commented Dec 23, 2024

@MrBurmark , @rhornung67 I think the example for the reshape method can be simplified. I just pushed up a new version. I was a bit worried the previous version might have too much going on.

examples/reshape.cpp Outdated Show resolved Hide resolved
examples/reshape.cpp Outdated Show resolved Hide resolved
@artv3 artv3 marked this pull request as ready for review December 23, 2024 22:22
}

template<std::size_t...Is>
struct Reshape<std::index_sequence<Is...>>
Copy link
Member Author

Choose a reason for hiding this comment

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

@MrBurmark , this is the specialization that takes an index_sequence and identifies the correct unit stride

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, I see an example is documentation coming?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, thanks for reminding me. I'll make something in the read the docs page within the next few days.

// Initialize memory using right most unit stride
//
//----------------------------------------------------------------------------//
std::cout << "\n\nInitialize array with right most indexing...\n";
Copy link
Member

Choose a reason for hiding this comment

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

I think these implementations are much easier to understand if your intent is just to show the mechanics of View reshaping. 👍

include/RAJA/util/View.hpp Outdated Show resolved Hide resolved
@artv3
Copy link
Member Author

artv3 commented Dec 26, 2024

I fixed a bug with the custom sequence, thanks @rhornung67 for point it out. This PR is now ready for review.

examples/reshape.cpp Outdated Show resolved Hide resolved
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