Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_EpetraVector.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
12// TODO: replace double -> Scalar etc.
13
14namespace Xpetra {
15
16// TODO: move that elsewhere
17template <class GlobalOrdinal, class Node>
22
23template <class GlobalOrdinal, class Node>
26 return *tX.getEpetra_Vector();
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)))
35template class EpetraVectorT<int, Xpetra::EpetraNode>;
38#endif
39
40#ifdef HAVE_TPETRA_INST_SERIAL
42template Epetra_Vector &toEpetra<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(Vector<double, int, int, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
43template const Epetra_Vector &toEpetra<int, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(const Vector<double, int, int, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
44#endif
45#ifdef HAVE_TPETRA_INST_PTHREAD
47template Epetra_Vector &toEpetra<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(Vector<double, int, int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
48template const Epetra_Vector &toEpetra<int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(const Vector<double, int, int, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
49#endif
50#ifdef HAVE_TPETRA_INST_OPENMP
52template Epetra_Vector &toEpetra<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(Vector<double, int, int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
53template const Epetra_Vector &toEpetra<int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(const Vector<double, int, int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
54#endif
55#ifdef HAVE_TPETRA_INST_CUDA
56typedef Tpetra::KokkosCompat::KokkosCudaWrapperNode default_node_type;
58template Epetra_Vector &toEpetra<int, default_node_type>(Vector<double, int, int, default_node_type> &);
59template const Epetra_Vector &toEpetra<int, default_node_type>(const Vector<double, int, int, default_node_type> &);
60#endif
61#ifdef HAVE_TPETRA_INST_HIP
62typedef Tpetra::KokkosCompat::KokkosHIPWrapperNode default_node_type;
64template Epetra_Vector &toEpetra<int, default_node_type>(Vector<double, int, int, default_node_type> &);
65template const Epetra_Vector &toEpetra<int, default_node_type>(const Vector<double, int, int, default_node_type> &);
66#endif
67#else
68// Tpetra is disabled and Kokkos not available: use dummy node type
69typedef Xpetra::EpetraNode default_node_type;
71template Epetra_Vector &toEpetra<int, default_node_type>(Vector<double, int, int, default_node_type> &);
72template const Epetra_Vector &toEpetra<int, default_node_type>(const Vector<double, int, int, default_node_type> &);
73#endif // HAVE_XPETRA_TPETRA
74#endif
75
76#ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
77#ifdef HAVE_XPETRA_TPETRA
78#include "TpetraCore_config.h"
79#if ((defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_OPENMP)) || \
80 (!defined(EPETRA_HAVE_OMP) && !defined(HAVE_TPETRA_INST_SERIAL)))
84#endif
85
86#ifdef HAVE_TPETRA_INST_SERIAL
88template Epetra_Vector &toEpetra<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(Vector<double, int, long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
89template const Epetra_Vector &toEpetra<long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode>(const Vector<double, int, long long, Tpetra::KokkosCompat::KokkosSerialWrapperNode> &);
90#endif
91#ifdef HAVE_TPETRA_INST_PTHREAD
93template Epetra_Vector &toEpetra<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(Vector<double, int, long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
94template const Epetra_Vector &toEpetra<long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode>(const Vector<double, int, long long, Tpetra::KokkosCompat::KokkosThreadsWrapperNode> &);
95#endif
96#ifdef HAVE_TPETRA_INST_OPENMP
98template Epetra_Vector &toEpetra<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(Vector<double, int, long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
99template const Epetra_Vector &toEpetra<long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>(const Vector<double, int, long long, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> &);
100#endif
101#ifdef HAVE_TPETRA_INST_CUDA
102typedef Tpetra::KokkosCompat::KokkosCudaWrapperNode default_node_type;
104template Epetra_Vector &toEpetra<long long, default_node_type>(Vector<double, int, long long, default_node_type> &);
105template const Epetra_Vector &toEpetra<long long, default_node_type>(const Vector<double, int, long long, default_node_type> &);
106#endif
107#ifdef HAVE_TPETRA_INST_HIP
108typedef Tpetra::KokkosCompat::KokkosHIPWrapperNode default_node_type;
110template Epetra_Vector &toEpetra<long long, default_node_type>(Vector<double, int, long long, default_node_type> &);
111template const Epetra_Vector &toEpetra<long long, default_node_type>(const Vector<double, int, long long, default_node_type> &);
112#endif
113#else
114// Tpetra is disabled and Kokkos not available: use dummy node type
115typedef Xpetra::EpetraNode default_node_type;
117template Epetra_Vector &toEpetra<long long, default_node_type>(Vector<double, int, long long, default_node_type> &);
118template const Epetra_Vector &toEpetra<long long, default_node_type>(const Vector<double, int, long long, default_node_type> &);
119#endif // HAVE_XPETRA_TPETRA
120#endif
121
122} // 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)
template const Epetra_CrsGraph & toEpetra< long long, Xpetra::EpetraNode >(const RCP< const CrsGraph< int, long long, Xpetra::EpetraNode > > &graph)
template const Epetra_CrsGraph & toEpetra< int, Xpetra::EpetraNode >(const RCP< const CrsGraph< int, int, Xpetra::EpetraNode > > &graph)