19 #ifndef AMESOS2_EPETRA_MULTIVEC_ADAPTER_DECL_HPP
20 #define AMESOS2_EPETRA_MULTIVEC_ADAPTER_DECL_HPP
22 #include <Teuchos_RCP.hpp>
23 #include <Teuchos_Array.hpp>
24 #include <Teuchos_as.hpp>
26 #include <Tpetra_Vector.hpp>
27 #include <Tpetra_Map.hpp>
29 #include <Epetra_MultiVector.h>
31 #include "Amesos2_MultiVecAdapter_decl.hpp"
47 typedef double scalar_t;
48 typedef int local_ordinal_t;
49 typedef Tpetra::Map<>::global_ordinal_type global_ordinal_t;
50 typedef size_t global_size_t;
51 typedef Tpetra::Map<>::node_type node_t;
52 typedef Epetra_MultiVector multivec_t;
54 friend Teuchos::RCP<MultiVecAdapter<multivec_t> > createMultiVecAdapter<>(Teuchos::RCP<multivec_t>);
55 friend Teuchos::RCP<const MultiVecAdapter<multivec_t> > createConstMultiVecAdapter<>(Teuchos::RCP<const multivec_t>);
58 static const char* name;
79 bool isLocallyIndexed()
const;
81 bool isGloballyIndexed()
const;
84 Teuchos::RCP<Epetra_MultiVector> clone()
const;
92 Teuchos::RCP<const Tpetra::Map<local_ordinal_t, global_ordinal_t, node_t> >
96 const Teuchos::RCP<const Teuchos::Comm<int> > getComm()
const;
100 size_t getLocalLength()
const;
104 size_t getLocalNumVectors()
const;
108 global_size_t getGlobalLength()
const;
112 size_t getGlobalNumVectors()
const;
116 size_t getStride()
const;
120 bool isConstantStride()
const;
124 Teuchos::RCP<const Tpetra::Vector<scalar_t,local_ordinal_t,global_ordinal_t,node_t> >
125 getVector(
size_t j )
const;
135 Teuchos::RCP<Tpetra::Vector<scalar_t,local_ordinal_t,global_ordinal_t,node_t> >
136 getVectorNonConst(
size_t j );
140 double * getMVPointer_impl()
const;
147 void get1dCopy(
const Teuchos::ArrayView<scalar_t>& A,
150 const Tpetra::Map<local_ordinal_t,
152 node_t> > distribution_map,
155 template<
typename KV>
156 bool get1dCopy_kokkos_view(
bool bInitialize, KV & A,
159 const Tpetra::Map<local_ordinal_t,
161 node_t> > distribution_map,
163 Kokkos::View<double**, Kokkos::LayoutLeft, Kokkos::HostSpace> host_new_data;
164 get1dCopy_kokkos_view_host(host_new_data, lda, distribution_map, distribution);
166 deep_copy_or_assign_view(bInitialize, A, host_new_data, bAssigned);
170 void get1dCopy_kokkos_view_host(
171 Kokkos::View<scalar_t**, Kokkos::LayoutLeft, Kokkos::HostSpace> & new_data,
174 const Tpetra::Map<local_ordinal_t,
176 node_t> > distribution_map,
196 Teuchos::ArrayRCP<scalar_t> get1dViewNonConst(
bool local =
false );
209 void put1dData(
const Teuchos::ArrayView<const scalar_t>& new_data,
212 const Tpetra::Map<local_ordinal_t,
214 node_t> > source_map,
217 template<
typename KV>
218 void put1dData_kokkos_view(
222 const Tpetra::Map<local_ordinal_t,
224 node_t> > source_map,
226 Kokkos::View<scalar_t**, Kokkos::LayoutLeft, Kokkos::HostSpace> host_new_data(
227 Kokkos::ViewAllocateWithoutInitializing(
"host_new_data"),
228 new_data.extent(0), new_data.extent(1));
229 Kokkos::deep_copy(host_new_data, new_data);
230 put1dData_kokkos_view_host(host_new_data, lda, source_map, distribution);
233 void put1dData_kokkos_view_host(
234 Kokkos::View<scalar_t**, Kokkos::LayoutLeft, Kokkos::HostSpace> & new_data,
237 const Tpetra::Map<local_ordinal_t,
239 node_t> > source_map,
243 std::string description()
const;
247 void describe( Teuchos::FancyOStream& os,
248 const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const;
254 Teuchos::RCP<multivec_t>
mv_;
256 mutable Teuchos::RCP<Epetra_Import> importer_;
257 mutable Teuchos::RCP<Epetra_Export> exporter_;
259 mutable Teuchos::RCP<const Epetra_BlockMap> mv_map_;
266 #endif // AMESOS2_EPETRA_MULTIVEC_ADAPTER_DECL_HPP
Teuchos::RCP< multivec_t > mv_
The multi-vector this adapter wraps.
Definition: Amesos2_EpetraMultiVecAdapter_decl.hpp:254
Copy or assign views based on memory spaces.
EDistribution
Definition: Amesos2_TypeDecl.hpp:89
A templated MultiVector class adapter for Amesos2.
Definition: Amesos2_MultiVecAdapter_decl.hpp:142