53 #ifndef AMESOS2_KOKKOS_MULTIVEC_ADAPTER_DEF_HPP
54 #define AMESOS2_KOKKOS_MULTIVEC_ADAPTER_DEF_HPP
56 #include <type_traits>
63 template <
typename Scalar,
typename ExecutionSpace >
65 Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >
::MultiVecAdapter(
const Teuchos::RCP<multivec_t>& m )
69 template <
typename Scalar,
typename ExecutionSpace >
70 Teuchos::RCP< Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >
72 Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >::clone()
const
74 using MV = Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace>;
75 MV Y(
"clonedY", mv_->extent(0), mv_->extent(1));
76 return Teuchos::rcp( &Y );
79 template <
typename Scalar,
typename ExecutionSpace >
82 Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >::getMVPointer_impl()
const
84 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::runtime_error,
"getMVPointer_impl not implemented.");
87 template <
typename Scalar,
typename ExecutionSpace >
90 Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >::get1dCopy(
const Teuchos::ArrayView<scalar_t>& av,
93 const Tpetra::Map<local_ordinal_t, global_ordinal_t,
94 MultiVecAdapter<Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace>>::node_t>> distribution_map,
97 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
"get1dCopy for kokkos not implemented.");
100 template <
typename Scalar,
typename ExecutionSpace >
101 Teuchos::ArrayRCP<Scalar>
103 Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >::get1dViewNonConst (
bool local)
105 TEUCHOS_TEST_FOR_EXCEPTION(
106 true, std::logic_error,
"Amesos2::MultiVecAdapter::get1dViewNonConst: "
110 template <
typename Scalar,
typename ExecutionSpace>
113 Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >::put1dData(
114 const Teuchos::ArrayView<const scalar_t>& new_data,
117 const Tpetra::Map<local_ordinal_t, global_ordinal_t,
118 MultiVecAdapter<Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace>>::node_t> > source_map,
121 TEUCHOS_TEST_FOR_EXCEPTION(
122 true, std::logic_error,
"Amesos2::MultiVecAdapter::put1dData: "
126 template <
typename Scalar,
typename ExecutionSpace >
129 Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >::description()
const
131 std::ostringstream oss;
132 oss <<
"Amesos2 adapter wrapping: ";
133 oss << mv_->description();
138 template <
typename Scalar,
typename ExecutionSpace >
141 Kokkos::View<Scalar**, Kokkos::LayoutLeft, ExecutionSpace> >::describe (Teuchos::FancyOStream& os,
142 const Teuchos::EVerbosityLevel verbLevel)
const
144 mv_->describe (os, verbLevel);
149 #endif // AMESOS2_KOKKOS_MULTIVEC_ADAPTER_DEF_HPP
Amesos2::MultiVecAdapter specialization for the Kokkos::View class.
Copy or assign views based on memory spaces.
EDistribution
Definition: Amesos2_TypeDecl.hpp:123
A templated MultiVector class adapter for Amesos2.
Definition: Amesos2_MultiVecAdapter_decl.hpp:176