18 #include "Epetra_SerialComm.h"
23 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
37 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
51 template <
class GlobalOrdinal,
class Node>
54 return *tX.getEpetra_MultiVector();
57 template <
class GlobalOrdinal,
class Node>
60 return *tX.getEpetra_MultiVector();
64 template <
class GlobalOrdinal,
class Node>
65 RCP<MultiVector<double, int, GlobalOrdinal, Node> >
toXpetra(RCP<Epetra_MultiVector> vec) {
72 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
73 #ifdef HAVE_XPETRA_TPETRA
74 #include "TpetraCore_config.h"
75 #if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
76 (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
77 template class EpetraMultiVectorT<int, Xpetra::EpetraNode>;
78 template RCP<MultiVector<double, int, int, Xpetra::EpetraNode> > toXpetra<int, Xpetra::EpetraNode>(RCP<Epetra_MultiVector>);
79 template Epetra_MultiVector &toEpetra<int, Xpetra::EpetraNode>(MultiVector<double, int, int, Xpetra::EpetraNode> &);
80 template const Epetra_MultiVector &toEpetra<int, Xpetra::EpetraNode>(
const MultiVector<double, int, int, Xpetra::EpetraNode> &);
83 #ifdef HAVE_TPETRA_INST_SERIAL
84 template class EpetraMultiVectorT<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>;
85 template RCP<MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosSerialWrapperNode> > toXpetra<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(RCP<Epetra_MultiVector>);
86 template Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
87 template const Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(
const MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
89 #ifdef HAVE_TPETRA_INST_PTHREAD
90 template class EpetraMultiVectorT<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>;
91 template RCP<MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> > toXpetra<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(RCP<Epetra_MultiVector>);
92 template Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
93 template const Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(
const MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
95 #ifdef HAVE_TPETRA_INST_OPENMP
96 template class EpetraMultiVectorT<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>;
97 template RCP<MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > toXpetra<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(RCP<Epetra_MultiVector>);
98 template Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
99 template const Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(
const MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
101 #ifdef HAVE_TPETRA_INST_CUDA
102 template class EpetraMultiVectorT<int, Tpetra::KokkosCompat::KokkosCudaWrapperNode>;
103 template RCP<MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosCudaWrapperNode> > toXpetra<int, Tpetra::KokkosCompat::KokkosCudaWrapperNode>(RCP<Epetra_MultiVector>);
104 template Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosCudaWrapperNode>(MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosCudaWrapperNode> &);
105 template const Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosCudaWrapperNode>(
const MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosCudaWrapperNode> &);
107 #ifdef HAVE_TPETRA_INST_HIP
108 template class EpetraMultiVectorT<int, Tpetra::KokkosCompat::KokkosHIPWrapperNode>;
109 template RCP<MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosHIPWrapperNode> > toXpetra<int, Tpetra::KokkosCompat::KokkosHIPWrapperNode>(RCP<Epetra_MultiVector>);
110 template Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosHIPWrapperNode>(MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosHIPWrapperNode> &);
111 template const Epetra_MultiVector &toEpetra<int, Tpetra::KokkosCompat::KokkosHIPWrapperNode>(
const MultiVector<double, int, int, Tpetra::KokkosCompat::KokkosHIPWrapperNode> &);
113 #else // Tpetra is disabled
115 template class EpetraMultiVectorT<int, default_node_type>;
116 template RCP<MultiVector<double, int, int, default_node_type> > toXpetra<int, default_node_type>(RCP<Epetra_MultiVector>);
117 template Epetra_MultiVector &toEpetra<int, default_node_type>(MultiVector<double, int, int, default_node_type> &);
118 template const Epetra_MultiVector &toEpetra<int, default_node_type>(
const MultiVector<double, int, int, default_node_type> &);
122 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
123 #ifdef HAVE_XPETRA_TPETRA
124 #include "TpetraCore_config.h"
125 #if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
126 (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
127 template class EpetraMultiVectorT<long long, Xpetra::EpetraNode>;
128 template RCP<MultiVector<double, int, long long, Xpetra::EpetraNode> > toXpetra<long long, Xpetra::EpetraNode>(RCP<Epetra_MultiVector>);
129 template Epetra_MultiVector &toEpetra<long long, Xpetra::EpetraNode>(MultiVector<double, int, long long, Xpetra::EpetraNode> &);
130 template const Epetra_MultiVector &toEpetra<long long, Xpetra::EpetraNode>(
const MultiVector<double, int, long long, Xpetra::EpetraNode> &);
133 #ifdef HAVE_TPETRA_INST_SERIAL
134 template class EpetraMultiVectorT<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>;
135 template RCP<MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode> > toXpetra<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(RCP<Epetra_MultiVector>);
136 template Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
137 template const Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(
const MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
139 #ifdef HAVE_TPETRA_INST_PTHREAD
140 template class EpetraMultiVectorT<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>;
141 template RCP<MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> > toXpetra<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(RCP<Epetra_MultiVector>);
142 template Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
143 template const Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(
const MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
145 #ifdef HAVE_TPETRA_INST_OPENMP
146 template class EpetraMultiVectorT<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>;
147 template RCP<MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > toXpetra<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(RCP<Epetra_MultiVector>);
148 template Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
149 template const Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(
const MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
151 #ifdef HAVE_TPETRA_INST_CUDA
152 template class EpetraMultiVectorT<long long, Tpetra::KokkosCompat::KokkosCudaWrapperNode>;
153 template RCP<MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosCudaWrapperNode> > toXpetra<long long, Tpetra::KokkosCompat::KokkosCudaWrapperNode>(RCP<Epetra_MultiVector>);
154 template Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosCudaWrapperNode>(MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosCudaWrapperNode> &);
155 template const Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosCudaWrapperNode>(
const MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosCudaWrapperNode> &);
157 #ifdef HAVE_TPETRA_INST_HIP
158 template class EpetraMultiVectorT<long long, Tpetra::KokkosCompat::KokkosHIPWrapperNode>;
159 template RCP<MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosHIPWrapperNode> > toXpetra<long long, Tpetra::KokkosCompat::KokkosHIPWrapperNode>(RCP<Epetra_MultiVector>);
160 template Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosHIPWrapperNode>(MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosHIPWrapperNode> &);
161 template const Epetra_MultiVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosHIPWrapperNode>(
const MultiVector<double, int, long long, Tpetra::KokkosCompat::KokkosHIPWrapperNode> &);
163 #else // Tpetra is disabled
165 template class EpetraMultiVectorT<long long, default_node_type>;
166 template RCP<MultiVector<double, int, long long, default_node_type> > toXpetra<long long, default_node_type>(RCP<Epetra_MultiVector>);
167 template Epetra_MultiVector &toEpetra<long long, default_node_type>(MultiVector<double, int, long long, default_node_type> &);
168 template const Epetra_MultiVector &toEpetra<long long, default_node_type>(
const MultiVector<double, int, long long, default_node_type> &);
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
Teuchos::RCP< const Vector< double, int, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
#define XPETRA_MONITOR(funcName)
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
Teuchos::RCP< Vector< double, int, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)