Skip to content

Conversation

@tcclevenger
Copy link
Contributor

@tcclevenger tcclevenger commented Oct 20, 2025

Kokkos::subview can handle the case of assigning subview(v, ALL, i1, ALL) to layout right, no need to use custom ekat function.

Motivation

The custom ekat::subview_1 for rank 3+ views will need a major rework/might not be possible when updating to Kokkos 5 (and the new mdspan based view implementation) due to changes in stride calculations for layout right. Updating rank 3 case to use Kokkos::subview ensures that we can retain layout right in our most important case, no matter what changes happen to ekat::subview_1.

Testing

Current testing is adequate IMO. I've manually tested with Kokkos' develop branch with both new and legacy view implementations.

@tcclevenger tcclevenger self-assigned this Oct 20, 2025
@tcclevenger tcclevenger force-pushed the tcclevenger/use_kokkos_subview_for_3d branch from 0fb5f35 to ca6dca4 Compare October 20, 2025 17:38
Kokkos can correctly assign to layout right with adjusted stride
@tcclevenger tcclevenger merged commit 7197712 into master Oct 21, 2025
4 checks passed
@tcclevenger tcclevenger deleted the tcclevenger/use_kokkos_subview_for_3d branch October 21, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants