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

Add get_subview() Implementations for Multi-Sliced Subfields #333

Merged
merged 7 commits into from
Apr 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
initial change to ekat_subview_utils for multi-slicing eamxx subfields
  • Loading branch information
Michael J. Schmidt authored and mjschmidt271 committed Apr 10, 2024
commit 802aedbed53a9125be0e389ebe76c6e823e9abae
12 changes: 12 additions & 0 deletions src/ekat/kokkos/ekat_subview_utils.hpp
Original file line number Diff line number Diff line change
@@ -93,6 +93,18 @@ subview(const ViewLR<ST****,Props...>& v,
&v.impl_map().reference(i0, i1, i2, 0),v.extent(3));
}

// --- Rank4 multi-slice --- //
template <typename ST, typename... Props>
KOKKOS_INLINE_FUNCTION
ViewLS<ST****, Props...>
subview(const ViewLR<ST****, Props...>& v,
const Kokkos::pair<int, int> &kp0,
const int idim) {
assert(v.data() != nullptr);
auto sv = Kokkos::subview(v, kp0, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL);
return Unmanaged<ViewLS<ST****,Props...>>(sv);
}

// --- Rank5 --- //
template <typename ST, typename... Props>
KOKKOS_INLINE_FUNCTION