Tpetra parallel linear algebra Version of the Day
Tpetra_ConfigDefs.hpp
1// @HEADER
2// ***********************************************************************
3//
4// Tpetra: Templated Linear Algebra Services Package
5// Copyright (2008) Sandia Corporation
6//
7// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8// the U.S. Government retains certain rights in this software.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// ************************************************************************
38// @HEADER
39
40#ifndef TPETRA_CONFIGDEFS_HPP
41#define TPETRA_CONFIGDEFS_HPP
42
43#include "Tpetra_Details_DefaultTypes.hpp"
44#include "Teuchos_ConfigDefs.hpp"
45
46namespace Tpetra {
47 // Used in all Tpetra code that explicitly must a type (like a loop index)
48 // that is used with the Teuchos::Array[View,RCP] classes.
49
51 typedef Teuchos_Ordinal Array_size_type;
52}
53
54// these make some of the macros in Tpetra_Util.hpp much easier to describe
55#ifdef HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS
56 #define TPETRA_THROWS_EFFICIENCY_WARNINGS 1
57#else
58 #define TPETRA_THROWS_EFFICIENCY_WARNINGS 0
59#endif
60
61#ifdef HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS
62 #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 1
63#else
64 #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 0
65#endif
66
67#ifdef HAVE_TPETRA_THROW_ABUSE_WARNINGS
68 #define TPETRA_THROWS_ABUSE_WARNINGS 1
69#else
70 #define TPETRA_THROWS_ABUSE_WARNINGS 0
71#endif
72
73#ifdef HAVE_TPETRA_PRINT_ABUSE_WARNINGS
74 #define TPETRA_PRINTS_ABUSE_WARNINGS 1
75#else
76 #define TPETRA_PRINTS_ABUSE_WARNINGS 0
77#endif
78
79
80#include <functional>
81
82//#ifndef __CUDACC__
83// mem management
84#include "Teuchos_Array.hpp" // includes ArrayRCP
85#include "Teuchos_RCP.hpp"
86#include "Teuchos_Tuple.hpp" // includes ArrayView
87// traits classes
88#include "Teuchos_OrdinalTraits.hpp"
89#include "Teuchos_ScalarTraits.hpp"
90#include "Teuchos_TypeNameTraits.hpp"
91#include "Teuchos_NullIteratorTraits.hpp"
92#include "Teuchos_SerializationTraits.hpp"
93// comm
94#include "Teuchos_CommHelpers.hpp"
95// misc
96#include "Teuchos_ParameterList.hpp"
97//#endif
98
99namespace Tpetra {
100
107 typedef size_t global_size_t;
108
117 LocallyReplicated,
118 GloballyDistributed
119 };
120
125 };
126
129 StaticProfile
130 };
131
132#define TPETRA_DEFAULT_PROFILE_TYPE Tpetra::StaticProfile
137 };
138
139 enum EPrivateComputeViewConstructor {
140 COMPUTE_VIEW_CONSTRUCTOR
141 };
142
143 enum EPrivateHostViewConstructor {
144 HOST_VIEW_CONSTRUCTOR
145 };
146
163 template<class Arg1, class Arg2>
164 class project1st : public std::binary_function<Arg1, Arg2, Arg1> {
165 public:
166 typedef Arg1 first_argument_type;
167 typedef Arg2 second_argument_type;
168 typedef Arg1 result_type;
169 Arg1 operator () (const Arg1& x, const Arg2& ) const {
170 return x;
171 }
172 };
173
189 template<class Arg1, class Arg2>
190 class project2nd : public std::binary_function<Arg1, Arg2, Arg2> {
191 public:
192 typedef Arg1 first_argument_type;
193 typedef Arg2 second_argument_type;
194 typedef Arg2 result_type;
195 Arg2 operator () (const Arg1& , const Arg2& y) const {
196 return y;
197 }
198 };
199
200} // end of Tpetra namespace
201
202
203// We include this after the above Tpetra namespace declaration,
204// so that we don't interfere with Doxygen's ability to find the
205// Tpetra namespace declaration.
206#include "Tpetra_CombineMode.hpp"
207
208
210namespace TpetraExamples {
211}
212
213namespace Tpetra {
215 namespace Ext {
216 }
217
223 namespace MatrixMatrix {
224 }
225
231 namespace TripleMatrixMultiply {
232 }
233}
234
235namespace Tpetra {
238 Forward = 0,
239 Backward,
240 Symmetric
241 };
242}
243
244// For backwards compatibility
245namespace KokkosClassic {
246 using ::Tpetra::ESweepDirection;
247}
248
249#if defined(HAVE_TPETRACORE_KOKKOSCORE) && defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(TPETRA_ENABLE_KOKKOS_DISTOBJECT)
250#define TPETRA_USE_KOKKOS_DISTOBJECT 1
251#else
252#define TPETRA_USE_KOKKOS_DISTOBJECT 0
253#endif
254
255#include <Kokkos_Complex.hpp>
256
257// Specializations of Teuchos::SerializationTraits for
258// Kokkos::complex<{float,double}>.
259
260namespace Teuchos {
261 template<typename Ordinal>
262 class SerializationTraits<Ordinal, ::Kokkos::complex<float> >
263 : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<float> >
264 {};
265
266 template<typename Ordinal>
267 class SerializationTraits<Ordinal, ::Kokkos::complex<double> >
268 : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<double> >
269 {};
270} // namespace Teuchos
271
272#endif // TPETRA_CONFIGDEFS_HPP
Declaration of Tpetra::CombineMode enum, and a function for setting a Tpetra::CombineMode parameter i...
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.