10 #ifndef TPETRA_DETAILS_GETENTRYONHOST_HPP
11 #define TPETRA_DETAILS_GETENTRYONHOST_HPP
19 #include "TpetraCore_config.h"
20 #include "Kokkos_Core.hpp"
25 template<
class ViewType,
27 typename ViewType::non_const_value_type
28 getEntryOnHost (
const ViewType& x,
31 using execution_space =
typename ViewType::execution_space;
32 static_assert (ViewType::rank == 1,
"x must be a rank-1 Kokkos::View.");
34 typename ViewType::non_const_value_type val;
40 template<
class ViewType,
42 typename ViewType::HostMirror::const_type
43 getEntriesOnHost (
const ViewType& x,
47 static_assert (ViewType::rank == 1,
"x must be a rank-1 Kokkos::View.");
49 auto subview = Kokkos::subview(x, Kokkos::make_pair(ind, ind + count));
50 return Kokkos::create_mirror_view_and_copy(
typename ViewType::HostMirror::memory_space(), subview);
56 #endif // TPETRA_DETAILS_GETENTRYONHOST_HPP
void deep_copy(MultiVector< DS, DL, DG, DN > &dst, const MultiVector< SS, SL, SG, SN > &src)
Copy the contents of the MultiVector src into dst.