Return type of Impl::as_view_of_rank_n
for DynRankView
missing Unmanaged
trait
#6932
Labels
Impl::as_view_of_rank_n
for DynRankView
missing Unmanaged
trait
#6932
Describe the bug
The free function
Kokkos::Impl::as_view_of_rank_n
forDynRankView
creates aView
from aDynRankView
.This function initializes the view from a pointer to the data of the dynamic rank view. Hence, it is unmanaged.
However, with the current implementation of this function, the type of the resulting view does not have the
Kokkos::Unmanaged
trait. One consequence of this issue is that if we ask the type of the returned view for itsis_managed
member, it returns true, i.e., it reports itself as managed, even though it is unmanaged.kokkos/containers/src/Kokkos_DynRankView.hpp
Line 1665 in b0c2566
One way of solving this may be to do something like (still missing the specialize trait):
A drive-by question/issue might be: Could this function be moved from the
Kokkos::Impl
namespace to theKokkos
namespace? Putting it in theKokkos
namespace would allow the function to be used in other packages. A use case might be inIntrepid2
as a helper function to pass dynamic rank views (that users may pass toIntrepid2
's user visible functions) as views to functors (withIntrepid2
's underlying implementation).We would be happy to make a PR with a fix. A question may be whether there may be a better way to replace the MemoryTraits typedef in the template parameters.
Joint work with @romintomasetti.
The text was updated successfully, but these errors were encountered: