-
Notifications
You must be signed in to change notification settings - Fork 406
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
Return type of Impl::as_view_of_rank_n
for DynRankView
missing Unmanaged
trait
#6932
Comments
A Can you elaborate why you absolutely need that information at compile time? |
Hi @dalg24. When we saw this behavior of this function and how it returns, as you say, a view that is runtime unmanaged without having the
All in all, it's a tricky issue, and it may be a relevant question to ask whether this notion of runtime unmanaged view is really a desirable behavior that Kokkos would want to continue to allow. A priori, we're unsure about use cases in which this behavior is convenient, vs the risk of how it may be bug prone. |
The question is whether disallowing creating an unmanaged View without the |
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: