Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra_ConfigDefs.hpp
1// @HEADER
2// *****************************************************************************
3// Tpetra: Templated Linear Algebra Services Package
4//
5// Copyright 2008 NTESS and the Tpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TPETRA_CONFIGDEFS_HPP
11#define TPETRA_CONFIGDEFS_HPP
12
13#include "Tpetra_Details_DefaultTypes.hpp"
14#include "Teuchos_ConfigDefs.hpp"
15
16#if defined(__GNUC__) && !defined(__clang__) && \
17 !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER) && \
18 (__GNUC__ == 12)
19// GCC 12 can emit false-positive -Wnonnull diagnostics.
20#define TPETRA_IMPL_GCC_12_NONNULL_WORKAROUND
21#endif
22
23namespace Tpetra {
24// Used in all Tpetra code that explicitly must a type (like a loop index)
25// that is used with the Teuchos::Array[View,RCP] classes.
26
29} // namespace Tpetra
30
31// these make some of the macros in Tpetra_Util.hpp much easier to describe
32#ifdef HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS
33#define TPETRA_PRINTS_EFFICIENCY_WARNINGS 1
34#else
35#define TPETRA_PRINTS_EFFICIENCY_WARNINGS 0
36#endif
37
38#ifdef HAVE_TPETRA_THROW_ABUSE_WARNINGS
39#define TPETRA_THROWS_ABUSE_WARNINGS 1
40#else
41#define TPETRA_THROWS_ABUSE_WARNINGS 0
42#endif
43
44#ifdef HAVE_TPETRA_PRINT_ABUSE_WARNINGS
45#define TPETRA_PRINTS_ABUSE_WARNINGS 1
46#else
47#define TPETRA_PRINTS_ABUSE_WARNINGS 0
48#endif
49
50#include <functional>
51
52// #ifndef __CUDACC__
53// mem management
54#include "Teuchos_Array.hpp" // includes ArrayRCP
55#include "Teuchos_RCP.hpp"
56#include "Teuchos_Tuple.hpp" // includes ArrayView
57// traits classes
58#include "Teuchos_OrdinalTraits.hpp"
59#include "Teuchos_ScalarTraits.hpp"
60#include "Teuchos_TypeNameTraits.hpp"
61#include "Teuchos_NullIteratorTraits.hpp"
62#include "Teuchos_SerializationTraits.hpp"
63// comm
64#include "Teuchos_CommHelpers.hpp"
65// misc
66#include "Teuchos_ParameterList.hpp"
67// #endif
68
69namespace Tpetra {
70
77typedef size_t global_size_t;
78
87 LocallyReplicated,
88 GloballyDistributed
89};
90
96
102
103enum EPrivateComputeViewConstructor {
104 COMPUTE_VIEW_CONSTRUCTOR
105};
106
107enum EPrivateHostViewConstructor {
108 HOST_VIEW_CONSTRUCTOR
109};
110
127template <class Arg1, class Arg2>
129 public:
132 typedef Arg1 result_type;
133 Arg1 operator()(const Arg1& x, const Arg2&) const {
134 return x;
135 }
136};
137
153template <class Arg1, class Arg2>
155 public:
158 typedef Arg2 result_type;
159 Arg2 operator()(const Arg1&, const Arg2& y) const {
160 return y;
161 }
162};
163
164} // namespace Tpetra
165
166// We include this after the above Tpetra namespace declaration,
167// so that we don't interfere with Doxygen's ability to find the
168// Tpetra namespace declaration.
169#include "Tpetra_CombineMode.hpp"
170
172namespace TpetraExamples {
173}
174
175namespace Tpetra {
177namespace Ext {
178}
179
185namespace MatrixMatrix {
186}
187
193namespace TripleMatrixMultiply {
194}
195} // namespace Tpetra
196
197namespace Tpetra {
200 Forward = 0,
201 Backward,
202 Symmetric
203};
204
205// FE* enums
206namespace FE {
207
208// Enum for activity
209enum WhichActive {
210 ACTIVE_OWNED,
211 ACTIVE_OWNED_PLUS_SHARED
212};
213
214enum class FillState {
215 open, // matrix is "open". Values can freely summed in to and replaced
216 modify, // matrix is open for modification. *local* values can be replaced
217 closed
218};
219} // namespace FE
220} // namespace Tpetra
221
222// For backwards compatibility
223namespace KokkosClassic {
224using ::Tpetra::ESweepDirection;
225}
226
227#include <Kokkos_Complex.hpp>
228
229// Specializations of Teuchos::SerializationTraits for
230// Kokkos::complex<{float,double}>.
231
232namespace Teuchos {
233template <typename Ordinal>
234class SerializationTraits<Ordinal, ::Kokkos::complex<float> >
235 : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<float> > {};
236
237template <typename Ordinal>
238class SerializationTraits<Ordinal, ::Kokkos::complex<double> >
239 : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<double> > {};
240} // namespace Teuchos
241
242#endif // TPETRA_CONFIGDEFS_HPP
Declaration of Tpetra::CombineMode enum, and a function for setting a Tpetra::CombineMode parameter i...
Struct that holds views of the contents of a CrsMatrix.
Binary function that returns its first argument.
Binary function that returns its second argument.
Namespace for Tpetra example classes and methods.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
ESweepDirection
Sweep direction for Gauss-Seidel or Successive Over-Relaxation (SOR).
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).
Teuchos_Ordinal Array_size_type
Size type for Teuchos Array objects.
size_t global_size_t
Global size_t object.
LocalGlobal
Enum for local versus global allocation of Map entries.