Teuchos: Kokkos::Compat::persistingView must not call Teuchos::arcp with nonnull pointer and zero length
Created by: mhoemmen
@trilinos/teuchos @trilinos/tpetra @trilinos/kokkos
Kokkos::Compat::persistingView passes the
Kokkos::View's pointer directly to
Teuchos::arcp (nonmember "constructor" for
Kokkos::View, just like
std::vector, permits a nonnull pointer with a zero size.
Teuchos::ArrayRCP does not; its constructor throws when bounds checking is enabled (a configure-time option). This causes some Tpetra tests to fail.
It should be harmless to convert a zero-size
Kokkos::View to a
Some Tpetra tests fail, because
Teuchos::arcp throws. When I fix
persistingView as suggested below, the tests pass.
Here are two possible solutions:
persistingViewso that it gives
Teuchos::arcpa null pointer if the
Kokkos::View's size is zero.
Teuchos::arcp, analogously to
Teuchos::ArrayView(see #4234 (closed)).
- Related to #4234 (closed)