53 #ifndef AMESOS2_EPETRA_MULTIVEC_ADAPTER_DECL_HPP
54 #define AMESOS2_EPETRA_MULTIVEC_ADAPTER_DECL_HPP
56 #include <Teuchos_RCP.hpp>
57 #include <Teuchos_Array.hpp>
58 #include <Teuchos_as.hpp>
60 #include <Tpetra_Vector.hpp>
61 #include <Tpetra_Map.hpp>
63 #include <Epetra_MultiVector.h>
65 #include "Amesos2_MultiVecAdapter_decl.hpp"
81 typedef double scalar_t;
82 typedef int local_ordinal_t;
83 typedef Tpetra::Map<>::global_ordinal_type global_ordinal_t;
84 typedef size_t global_size_t;
85 typedef Tpetra::Map<>::node_type node_t;
86 typedef Epetra_MultiVector multivec_t;
88 friend Teuchos::RCP<MultiVecAdapter<multivec_t> > createMultiVecAdapter<>(Teuchos::RCP<multivec_t>);
89 friend Teuchos::RCP<const MultiVecAdapter<multivec_t> > createConstMultiVecAdapter<>(Teuchos::RCP<const multivec_t>);
92 static const char* name;
113 bool isLocallyIndexed()
const;
115 bool isGloballyIndexed()
const;
124 Teuchos::RCP<const Tpetra::Map<local_ordinal_t, global_ordinal_t, node_t> >
128 const Teuchos::RCP<const Teuchos::Comm<int> > getComm()
const;
132 size_t getLocalLength()
const;
136 size_t getLocalNumVectors()
const;
140 global_size_t getGlobalLength()
const;
144 size_t getGlobalNumVectors()
const;
148 size_t getStride()
const;
152 bool isConstantStride()
const;
156 Teuchos::RCP<const Tpetra::Vector<scalar_t,local_ordinal_t,global_ordinal_t,node_t> >
157 getVector(
size_t j )
const;
167 Teuchos::RCP<Tpetra::Vector<scalar_t,local_ordinal_t,global_ordinal_t,node_t> >
168 getVectorNonConst(
size_t j );
172 double * getMVPointer_impl()
const;
179 void get1dCopy(
const Teuchos::ArrayView<scalar_t>& A,
182 const Tpetra::Map<local_ordinal_t,
184 node_t> > distribution_map,
187 template<
typename KV>
188 void get1dCopy_kokkos_view( KV & A,
191 const Tpetra::Map<local_ordinal_t,
193 node_t> > distribution_map,
195 Kokkos::View<double**, Kokkos::LayoutLeft, Kokkos::HostSpace> host_new_data;
196 get1dCopy_kokkos_view_host(host_new_data, lda, distribution_map, distribution);
197 deep_copy_or_assign_view(A, host_new_data);
200 void get1dCopy_kokkos_view_host(
201 Kokkos::View<scalar_t**, Kokkos::LayoutLeft, Kokkos::HostSpace> & new_data,
204 const Tpetra::Map<local_ordinal_t,
206 node_t> > distribution_map,
226 Teuchos::ArrayRCP<scalar_t> get1dViewNonConst(
bool local =
false );
239 void put1dData(
const Teuchos::ArrayView<const scalar_t>& new_data,
242 const Tpetra::Map<local_ordinal_t,
244 node_t> > source_map,
247 template<
typename KV>
248 void put1dData_kokkos_view(
252 const Tpetra::Map<local_ordinal_t,
254 node_t> > source_map,
256 Kokkos::View<scalar_t**, Kokkos::LayoutLeft, Kokkos::HostSpace> host_new_data(
257 Kokkos::ViewAllocateWithoutInitializing(
"host_new_data"),
258 new_data.extent(0), new_data.extent(1));
259 Kokkos::deep_copy(host_new_data, new_data);
260 put1dData_kokkos_view_host(host_new_data, lda, source_map, distribution);
263 void put1dData_kokkos_view_host(
264 Kokkos::View<scalar_t**, Kokkos::LayoutLeft, Kokkos::HostSpace> & new_data,
267 const Tpetra::Map<local_ordinal_t,
269 node_t> > source_map,
273 std::string description()
const;
277 void describe( Teuchos::FancyOStream& os,
278 const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const;
284 Teuchos::RCP<multivec_t>
mv_;
286 mutable Teuchos::RCP<Epetra_Import> importer_;
287 mutable Teuchos::RCP<Epetra_Export> exporter_;
289 mutable Teuchos::RCP<const Epetra_BlockMap> mv_map_;
296 #endif // AMESOS2_EPETRA_MULTIVEC_ADAPTER_DECL_HPP
Teuchos::RCP< multivec_t > mv_
The multi-vector this adapter wraps.
Definition: Amesos2_EpetraMultiVecAdapter_decl.hpp:284
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