-
Notifications
You must be signed in to change notification settings - Fork 407
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
DynRankView: make layout() return the same as a corresponding static View #5026
Conversation
Replaces #4775 |
This got opened because I needed to move away from branches in the NGA repository to a personal fork, so maintainers can push changes on PRs if needed. The comments on the predecessor PR indicate why this shouldn't be merged as is. |
#5188 potentially unblocks this |
This test code that I needed to pass now passes: Kokkos::View<double****> u("foo", 1, 2, 3, 4);
auto ulayout = u.layout();
ASSERT_EQ(ulayout.dimension[0], 1);
ASSERT_EQ(ulayout.dimension[1], 2);
ASSERT_EQ(ulayout.dimension[2], 3);
ASSERT_EQ(ulayout.dimension[3], 4);
ASSERT_EQ(ulayout.dimension[4], KOKKOS_INVALID_INDEX);
ASSERT_EQ(ulayout.dimension[5], KOKKOS_INVALID_INDEX);
ASSERT_EQ(ulayout.dimension[6], KOKKOS_INVALID_INDEX);
ASSERT_EQ(ulayout.dimension[7], KOKKOS_INVALID_INDEX); |
retest this please |
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.
Why is it advantageous for DynRankView
to return the layout of the corresponding View
instead of what it does currently?
It allows easy construction of a View or DRV with matching rank and extent, and thus deep_copy between them. |
Also, generally, it's weird that the rank of the DRV doesn't match the rank described by its layout |
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.
Yes, I think this makes more sense than always returning a 7-dim layout.
No description provided.