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 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 
42 #ifndef TPETRA_CONFIGDEFS_HPP
43 #define TPETRA_CONFIGDEFS_HPP
44 
45 #include "Tpetra_Details_DefaultTypes.hpp"
46 #include "Teuchos_ConfigDefs.hpp"
47 
48 namespace Tpetra {
49  // Used in all Tpetra code that explicitly must a type (like a loop index)
50  // that is used with the Teuchos::Array[View,RCP] classes.
51 
53  typedef Teuchos_Ordinal Array_size_type;
54 }
55 
56 // these make some of the macros in Tpetra_Util.hpp much easier to describe
57 #ifdef HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS
58  #define TPETRA_THROWS_EFFICIENCY_WARNINGS 1
59 #else
60  #define TPETRA_THROWS_EFFICIENCY_WARNINGS 0
61 #endif
62 
63 #ifdef HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS
64  #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 1
65 #else
66  #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 0
67 #endif
68 
69 #ifdef HAVE_TPETRA_THROW_ABUSE_WARNINGS
70  #define TPETRA_THROWS_ABUSE_WARNINGS 1
71 #else
72  #define TPETRA_THROWS_ABUSE_WARNINGS 0
73 #endif
74 
75 #ifdef HAVE_TPETRA_PRINT_ABUSE_WARNINGS
76  #define TPETRA_PRINTS_ABUSE_WARNINGS 1
77 #else
78  #define TPETRA_PRINTS_ABUSE_WARNINGS 0
79 #endif
80 
81 
82 #include <functional>
83 
84 //#ifndef __CUDACC__
85 // mem management
86 #include "Teuchos_Array.hpp" // includes ArrayRCP
87 #include "Teuchos_RCP.hpp"
88 #include "Teuchos_Tuple.hpp" // includes ArrayView
89 // traits classes
90 #include "Teuchos_OrdinalTraits.hpp"
91 #include "Teuchos_ScalarTraits.hpp"
92 #include "Teuchos_TypeNameTraits.hpp"
93 #include "Teuchos_NullIteratorTraits.hpp"
94 #include "Teuchos_SerializationTraits.hpp"
95 // comm
96 #include "Teuchos_CommHelpers.hpp"
97 // misc
98 #include "Teuchos_ParameterList.hpp"
99 //#endif
100 
101 namespace Tpetra {
102 
109  typedef size_t global_size_t;
110 
118  enum LocalGlobal {
119  LocallyReplicated,
120  GloballyDistributed
121  };
122 
127  };
128 
130  enum ProfileType {
133  };
134 
139  };
140 
141  enum EPrivateComputeViewConstructor {
142  COMPUTE_VIEW_CONSTRUCTOR
143  };
144 
145  enum EPrivateHostViewConstructor {
146  HOST_VIEW_CONSTRUCTOR
147  };
148 
165  template<class Arg1, class Arg2>
166  class project1st : public std::binary_function<Arg1, Arg2, Arg1> {
167  public:
168  typedef Arg1 first_argument_type;
169  typedef Arg2 second_argument_type;
170  typedef Arg1 result_type;
171  Arg1 operator () (const Arg1& x, const Arg2& ) const {
172  return x;
173  }
174  };
175 
191  template<class Arg1, class Arg2>
192  class project2nd : public std::binary_function<Arg1, Arg2, Arg2> {
193  public:
194  typedef Arg1 first_argument_type;
195  typedef Arg2 second_argument_type;
196  typedef Arg2 result_type;
197  Arg2 operator () (const Arg1& , const Arg2& y) const {
198  return y;
199  }
200  };
201 
202 } // end of Tpetra namespace
203 
204 
205 // We include this after the above Tpetra namespace declaration,
206 // so that we don't interfere with Doxygen's ability to find the
207 // Tpetra namespace declaration.
208 #include "Tpetra_CombineMode.hpp"
209 
210 
212 namespace TpetraExamples {
213 }
214 
215 namespace Tpetra {
217  namespace RTI {
218  }
219 }
220 
221 namespace Tpetra {
223  namespace Ext {
224  }
225 
231  namespace MatrixMatrix {
232  }
233 
239  namespace TripleMatrixMultiply {
240  }
241 }
242 
243 namespace Tpetra {
246  Forward = 0,
247  Backward,
248  Symmetric
249  };
250 }
251 
252 // For backwards compatibility
253 namespace KokkosClassic {
254  using ::Tpetra::ESweepDirection;
255 }
256 
257 #if defined(HAVE_TPETRACORE_KOKKOSCORE) && defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(TPETRA_ENABLE_KOKKOS_DISTOBJECT)
258 #define TPETRA_USE_KOKKOS_DISTOBJECT 1
259 #else
260 #define TPETRA_USE_KOKKOS_DISTOBJECT 0
261 #endif
262 
263 #include <Kokkos_Complex.hpp>
264 
265 // Specializations of Teuchos::SerializationTraits for
266 // Kokkos::complex<{float,double}>.
267 
268 namespace Teuchos {
269  template<typename Ordinal>
270  class SerializationTraits<Ordinal, ::Kokkos::complex<float> >
271  : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<float> >
272  {};
273 
274  template<typename Ordinal>
275  class SerializationTraits<Ordinal, ::Kokkos::complex<double> >
276  : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<double> >
277  {};
278 } // namespace Teuchos
279 
280 #endif // TPETRA_CONFIGDEFS_HPP
Tpetra::ProfileType
ProfileType
Definition: Tpetra_ConfigDefs.hpp:130
Tpetra::IDNotPresent
Definition: Tpetra_ConfigDefs.hpp:126
Tpetra::ESweepDirection
ESweepDirection
Sweep direction for Gauss-Seidel or Successive Over-Relaxation (SOR).
Definition: Tpetra_ConfigDefs.hpp:245
Tpetra::StaticProfile
Definition: Tpetra_ConfigDefs.hpp:131
Tpetra_CombineMode.hpp
Declaration of Tpetra::CombineMode enum, and a function for setting a Tpetra::CombineMode parameter i...
Tpetra::OptimizeOption
OptimizeOption
Definition: Tpetra_ConfigDefs.hpp:136
Tpetra::DoOptimizeStorage
Definition: Tpetra_ConfigDefs.hpp:137
Tpetra::AllIDsPresent
Definition: Tpetra_ConfigDefs.hpp:125
Tpetra::LocalGlobal
LocalGlobal
Enum for local versus global allocation of Map entries.
Definition: Tpetra_ConfigDefs.hpp:118
Tpetra::DynamicProfile
Definition: Tpetra_ConfigDefs.hpp:132
Tpetra::LookupStatus
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).
Definition: Tpetra_ConfigDefs.hpp:124
Tpetra::project1st
Binary function that returns its first argument.
Definition: Tpetra_ConfigDefs.hpp:166
TpetraExamples
Namespace for Tpetra example classes and methods.
Definition: Tpetra_ConfigDefs.hpp:212
Tpetra::project2nd
Binary function that returns its second argument.
Definition: Tpetra_ConfigDefs.hpp:192
Tpetra::global_size_t
size_t global_size_t
Global size_t object.
Definition: Tpetra_ConfigDefs.hpp:109
Tpetra
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Tpetra::Array_size_type
Teuchos_Ordinal Array_size_type
Size type for Teuchos Array objects.
Definition: Tpetra_ConfigDefs.hpp:53
Tpetra::DoNotOptimizeStorage
Definition: Tpetra_ConfigDefs.hpp:138