Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_EpetraExport.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 
10 #include "Xpetra_EpetraExport.hpp"
11 #include "Xpetra_Exceptions.hpp"
12 
13 namespace Xpetra {
14 
15 template <class GlobalOrdinal, class Node>
16 RCP<const Export<int, GlobalOrdinal, Node> > toXpetra(const Epetra_Export *exp) {
17  if (exp != NULL) {
18  RCP<const Epetra_Export> eexp = rcp(new Epetra_Export(*exp)); // NOTE: non consitent: return pointer, take ref
19  return rcp(new Xpetra::EpetraExportT<GlobalOrdinal, Node>(eexp));
20  }
21 
22  return Teuchos::null;
23 }
24 
25 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
26 #ifdef HAVE_XPETRA_TPETRA
27 #include "TpetraCore_config.h"
28 #if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
29  (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
30 template class EpetraExportT<int, Xpetra::EpetraNode>;
31 template RCP<const Export<int, int, Xpetra::EpetraNode> > toXpetra<int, Xpetra::EpetraNode>(const Epetra_Export *);
32 #endif
33 
34 #ifdef HAVE_TPETRA_INST_SERIAL
35 template class EpetraExportT<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>;
36 template RCP<const Export<int, int, Tpetra::KokkosCompat::KokkosSerialWrapperNode> > toXpetra<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(const Epetra_Export *);
37 #endif
38 #ifdef HAVE_TPETRA_INST_PTHREAD
39 template class EpetraExportT<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>;
40 template RCP<const Export<int, int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> > toXpetra<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(const Epetra_Export *);
41 #endif
42 #ifdef HAVE_TPETRA_INST_OPENMP
43 template class EpetraExportT<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>;
44 template RCP<const Export<int, int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > toXpetra<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(const Epetra_Export *);
45 #endif
46 #ifdef HAVE_TPETRA_INST_CUDA
47 typedef Tpetra::KokkosCompat::KokkosCudaWrapperNode default_node_type;
48 template class EpetraExportT<int, default_node_type>;
49 template RCP<const Export<int, int, default_node_type> > toXpetra<int, default_node_type>(const Epetra_Export *);
50 #endif
51 #ifdef HAVE_TPETRA_INST_HIP
52 typedef Tpetra::KokkosCompat::KokkosHIPWrapperNode default_node_type;
53 template class EpetraExportT<int, default_node_type>;
54 template RCP<const Export<int, int, default_node_type> > toXpetra<int, default_node_type>(const Epetra_Export *);
55 #endif
56 #else
57 // Tpetra is disabled and Kokkos not available: use dummy node type
58 typedef Xpetra::EpetraNode default_node_type;
59 template class EpetraExportT<int, default_node_type>;
60 template RCP<const Export<int, int, default_node_type> > toXpetra<int, default_node_type>(const Epetra_Export *);
61 #endif // HAVE_XPETRA_TPETRA
62 #endif
63 
64 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
65 #ifdef HAVE_XPETRA_TPETRA
66 #include "TpetraCore_config.h"
67 #if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
68  (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
69 template class EpetraExportT<long long, Xpetra::EpetraNode>;
70 template RCP<const Export<int, long long, Xpetra::EpetraNode> > toXpetra<long long, Xpetra::EpetraNode>(const Epetra_Export *);
71 #endif
72 
73 #ifdef HAVE_TPETRA_INST_SERIAL
74 template class EpetraExportT<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>;
75 template RCP<const Export<int, long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode> > toXpetra<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(const Epetra_Export *);
76 #endif
77 #ifdef HAVE_TPETRA_INST_PTHREAD
78 template class EpetraExportT<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>;
79 template RCP<const Export<int, long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> > toXpetra<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(const Epetra_Export *);
80 #endif
81 #ifdef HAVE_TPETRA_INST_OPENMP
82 template class EpetraExportT<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>;
83 template RCP<const Export<int, long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > toXpetra<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(const Epetra_Export *);
84 #endif
85 #ifdef HAVE_TPETRA_INST_CUDA
86 typedef Tpetra::KokkosCompat::KokkosCudaWrapperNode default_node_type;
87 template class EpetraExportT<long long, default_node_type>;
88 template RCP<const Export<int, long long, default_node_type> > toXpetra<long long, default_node_type>(const Epetra_Export *);
89 #endif
90 #ifdef HAVE_TPETRA_INST_HIP
91 typedef Tpetra::KokkosCompat::KokkosHIPWrapperNode default_node_type;
92 template class EpetraExportT<long long, default_node_type>;
93 template RCP<const Export<int, long long, default_node_type> > toXpetra<long long, default_node_type>(const Epetra_Export *);
94 #endif
95 #else
96 // Tpetra is disabled and Kokkos not available: use dummy node type
97 typedef Xpetra::EpetraNode default_node_type;
98 template class EpetraExportT<long long, default_node_type>;
99 template RCP<const Export<int, long long, default_node_type> > toXpetra<long long, default_node_type>(const Epetra_Export *);
100 #endif // HAVE_XPETRA_TPETRA
101 #endif
102 
103 } // namespace Xpetra
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)