Commit fb733396 authored by Alain O' Miniussi's avatar Alain O' Miniussi
Browse files

make the managedView function more general

parent 46b36ab7
......@@ -93,12 +93,17 @@ namespace fargOCA {
int managedRadiusMax(int altShift = 0) const { return nbRadius() - (last() ? altShift : ghostSize()); }
std::pair<int,int> managedRadii() const { return std::make_pair(managedRadiusMin(), managedRadiusMax()); }
arr3d<real> managedView(arr3d<real> v) const { return Kokkos::subview(v, managedRadii(), Kokkos::ALL(), Kokkos::ALL()); }
arr3d<real const> managedView(arr3d<real const> v) const { return Kokkos::subview(v, managedRadii(), Kokkos::ALL(), Kokkos::ALL()); }
arr2d<real> managedView(arr2d<real> v) const { return Kokkos::subview(v, managedRadii(), Kokkos::ALL()); }
arr2d<real const> managedView(arr2d<real const> v) const { return Kokkos::subview(v, managedRadii(), Kokkos::ALL()); }
arr1d<real> managedView(arr1d<real> v) const { return Kokkos::subview(v, managedRadii()); }
arr1d<real const> managedView(arr1d<real const> v) const { return Kokkos::subview(v, managedRadii()); }
template<typename T, class... RP>
Kokkos::View<T***, RP...>
managedView(Kokkos::View<T***, RP...> v) const { return Kokkos::subview(v, managedRadii(), Kokkos::ALL(), Kokkos::ALL()); }
template<typename T, class... RP>
Kokkos::View<T**, RP...>
managedView(Kokkos::View<T**, RP...> v) const { return Kokkos::subview(v, managedRadii(), Kokkos::ALL()); }
template<typename T, class... RP>
Kokkos::View<T*, RP...>
managedView(Kokkos::View<T*, RP...> v) const { return Kokkos::subview(v, managedRadii()); }
/// \brief Return a 0 initialized nr,ni,ns array.
template<typename T = real>
arr3d<T> scalarView(std::string label) const { return arr3d<T>(label, nbRadius(), nbLayer(), nbSector()); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment