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,
29 const IndexType ind) {
30 using execution_space =
typename ViewType::execution_space;
31 static_assert(ViewType::rank == 1,
"x must be a rank-1 Kokkos::View.");
33 typename ViewType::non_const_value_type val;
39 template <
class ViewType,
41 typename ViewType::host_mirror_type::const_type
42 getEntriesOnHost(
const ViewType& x,
45 static_assert(ViewType::rank == 1,
"x must be a rank-1 Kokkos::View.");
47 auto subview = Kokkos::subview(x, Kokkos::make_pair(ind, ind + count));
48 return Kokkos::create_mirror_view_and_copy(
typename ViewType::host_mirror_type::memory_space(), subview);
54 #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.