Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_EpetraIntVector.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
11 #include "Xpetra_EpetraImport.hpp"
12 #include "Xpetra_EpetraExport.hpp"
13 
14 namespace Xpetra {
15 
16 // TODO: move that elsewhere
17 template <class GlobalOrdinal, class Node>
20  return *tX.getEpetra_IntVector();
21 }
22 
23 template <class GlobalOrdinal, class Node>
24 const Epetra_IntVector &toEpetra(const Vector<int, int, GlobalOrdinal, Node> &x) {
26  return *tX.getEpetra_IntVector();
27 }
28 //
29 
30 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
31 #ifdef HAVE_XPETRA_TPETRA
32 #include "TpetraCore_config.h"
33 #if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
34  (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
35 template class EpetraIntVectorT<int, Xpetra::EpetraNode>;
36 template Epetra_IntVector &toEpetra<int, Xpetra::EpetraNode>(Vector<int, int, int, Xpetra::EpetraNode> &);
37 template const Epetra_IntVector &toEpetra<int, Xpetra::EpetraNode>(const Vector<int, int, int, Xpetra::EpetraNode> &);
38 #endif
39 #ifdef HAVE_TPETRA_INST_SERIAL
40 template class EpetraIntVectorT<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>;
41 template Epetra_IntVector &toEpetra<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(Vector<int, int, int, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
42 template const Epetra_IntVector &toEpetra<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(const Vector<int, int, int, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
43 #endif
44 #ifdef HAVE_TPETRA_INST_PTHREAD
45 template class EpetraIntVectorT<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>;
46 template Epetra_IntVector &toEpetra<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(Vector<int, int, int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
47 template const Epetra_IntVector &toEpetra<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(const Vector<int, int, int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
48 #endif
49 #ifdef HAVE_TPETRA_INST_OPENMP
50 template class EpetraIntVectorT<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>;
51 template Epetra_IntVector &toEpetra<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(Vector<int, int, int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
52 template const Epetra_IntVector &toEpetra<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(const Vector<int, int, int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
53 #endif
54 #ifdef HAVE_TPETRA_INST_CUDA
55 typedef Tpetra::KokkosCompat::KokkosCudaWrapperNode default_node_type;
56 template class EpetraIntVectorT<int, default_node_type>;
57 template Epetra_IntVector &toEpetra<int, default_node_type>(Vector<int, int, int, default_node_type> &);
58 template const Epetra_IntVector &toEpetra<int, default_node_type>(const Vector<int, int, int, default_node_type> &);
59 #endif
60 #ifdef HAVE_TPETRA_INST_HIP
61 typedef Tpetra::KokkosCompat::KokkosHIPWrapperNode default_node_type;
62 template class EpetraIntVectorT<int, default_node_type>;
63 template Epetra_IntVector &toEpetra<int, default_node_type>(Vector<int, int, int, default_node_type> &);
64 template const Epetra_IntVector &toEpetra<int, default_node_type>(const Vector<int, int, int, default_node_type> &);
65 #endif
66 #else
67 // Tpetra is disabled and Kokkos not available: use dummy node type
68 typedef Xpetra::EpetraNode default_node_type;
69 template class EpetraIntVectorT<int, default_node_type>;
70 template Epetra_IntVector &toEpetra<int, default_node_type>(Vector<int, int, int, default_node_type> &);
71 template const Epetra_IntVector &toEpetra<int, default_node_type>(const Vector<int, int, int, default_node_type> &);
72 #endif // HAVE_XPETRA_TPETRA
73 #endif
74 
75 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
76 #ifdef HAVE_XPETRA_TPETRA
77 #include "TpetraCore_config.h"
78 #if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
79  (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
80 template class EpetraIntVectorT<long long, Xpetra::EpetraNode>;
81 template Epetra_IntVector &toEpetra<long long, Xpetra::EpetraNode>(Vector<int, int, long long, Xpetra::EpetraNode> &);
82 template const Epetra_IntVector &toEpetra<long long, Xpetra::EpetraNode>(const Vector<int, int, long long, Xpetra::EpetraNode> &);
83 #endif
84 #ifdef HAVE_TPETRA_INST_SERIAL
85 template class EpetraIntVectorT<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>;
86 template Epetra_IntVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(Vector<int, int, long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
87 template const Epetra_IntVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(const Vector<int, int, long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
88 #endif
89 #ifdef HAVE_TPETRA_INST_PTHREAD
90 template class EpetraIntVectorT<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>;
91 template Epetra_IntVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(Vector<int, int, long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
92 template const Epetra_IntVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(const Vector<int, int, long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
93 #endif
94 #ifdef HAVE_TPETRA_INST_OPENMP
95 template class EpetraIntVectorT<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>;
96 template Epetra_IntVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(Vector<int, int, long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
97 template const Epetra_IntVector &toEpetra<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(const Vector<int, int, long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
98 #endif
99 #ifdef HAVE_TPETRA_INST_CUDA
100 typedef Tpetra::KokkosCompat::KokkosCudaWrapperNode default_node_type;
101 template class EpetraIntVectorT<long long, default_node_type>;
102 template Epetra_IntVector &toEpetra<long long, default_node_type>(Vector<int, int, long long, default_node_type> &);
103 template const Epetra_IntVector &toEpetra<long long, default_node_type>(const Vector<int, int, long long, default_node_type> &);
104 #endif
105 #ifdef HAVE_TPETRA_INST_HIP
106 typedef Tpetra::KokkosCompat::KokkosHIPWrapperNode default_node_type;
107 template class EpetraIntVectorT<long long, default_node_type>;
108 template Epetra_IntVector &toEpetra<long long, default_node_type>(Vector<int, int, long long, default_node_type> &);
109 template const Epetra_IntVector &toEpetra<long long, default_node_type>(const Vector<int, int, long long, default_node_type> &);
110 #endif
111 #else
112 // Tpetra is disabled and Kokkos not available: use dummy node type
113 typedef Xpetra::EpetraNode default_node_type;
114 template class EpetraIntVectorT<long long, default_node_type>;
115 template Epetra_IntVector &toEpetra<long long, default_node_type>(Vector<int, int, long long, default_node_type> &);
116 template const Epetra_IntVector &toEpetra<long long, default_node_type>(const Vector<int, int, long long, default_node_type> &);
117 #endif // HAVE_XPETRA_TPETRA
118 #endif
119 
120 } // namespace Xpetra
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)