10#ifndef TPETRA_DETAILS_GETENTRYONHOST_HPP
11#define TPETRA_DETAILS_GETENTRYONHOST_HPP
19#include "TpetraCore_config.h"
20#include "Kokkos_Core.hpp"
25template<
class ViewType,
27typename ViewType::non_const_value_type
28getEntryOnHost (
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;
36 Kokkos::deep_copy(execution_space(), val, Kokkos::subview(x, ind));
40template<
class ViewType,
42typename ViewType::HostMirror::const_type
43getEntriesOnHost (
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);
Nonmember function that computes a residual Computes R = B - A * X.
Namespace Tpetra contains the class and methods constituting the Tpetra library.