-
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
Preserve KOKKOS_INVALID_INDEX in ViewDimension and ArrayLayout construction #5188
Conversation
janciesko
commented
Jul 8, 2022
- Preserves KOKKOS_INVALID_INDEX in ViewDimension and ArrayLayout construction.
- Fixes Nightly Trilinos failure in phalanx unit test (all backends) Phalanx_tViewOfViews_MPI_1: Constructor for Kokkos View mismatched number of arguments #5175
- Adds unit test for View construction from Layout. This would have failed previously (as found in the issue).
…uction Co-authored-by: Daniel Arndt <arndtd@ornl.gov>
return array_layout((VORank > 0 ? m_dim.N0 : KOKKOS_INVALID_INDEX), | ||
(VORank > 1 ? m_dim.N1 : KOKKOS_INVALID_INDEX), | ||
(VORank > 2 ? m_dim.N2 : KOKKOS_INVALID_INDEX), | ||
(VORank > 3 ? m_dim.N3 : KOKKOS_INVALID_INDEX), | ||
(VORank > 4 ? m_dim.N4 : KOKKOS_INVALID_INDEX), | ||
(VORank > 5 ? m_dim.N5 : KOKKOS_INVALID_INDEX), | ||
(VORank > 6 ? m_dim.N6 : KOKKOS_INVALID_INDEX), | ||
(VORank > 7 ? m_dim.N7 : KOKKOS_INVALID_INDEX)); |
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.
Doesn't this also need to be the dynamic rank?
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.
From looking at TestViewLayoutTiled and the layout implementation it looks like we do only support static ranks. I think we should be good with that for now.
Note, this does change the behavior to what mdspan does. I wouldn't necessarily document that yet, but I think it is the correct thing to do: i.e. you can either pass dynamik_rank or rank arguments to the View. Note the whole layout() thing is still a bit messy. For example this would still allow this I think: View<int*> a("A",N);
View(int*[4]) b("B",a.layout()); But lets fix that later. |
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.
I think this is good enough as a fix. We should also check for matching static extents in a follow-up.
I expect this will help with the issues I was trying to address in |
Yes, that's fixable. |
Retest this please |
I wonder whether that timeout is real? I.e. we screw somewhere up and don't get all the information over and a loop nest now is infinite long or so? |
I've seen this failure (OpenMP timeout) in other PRs |