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 "TpetraCore_config.h"
46 #include "Kokkos_DefaultNode.hpp"
47 
49 namespace Tpetra {
50  // Used in all Tpetra code that explicitly must a type (like a loop index)
51  // that is used with the Teuchos::Array[View,RCP] classes.
52 
54  typedef Teuchos_Ordinal Array_size_type;
55 }
56 
57 // these make some of the macros in Tpetra_Util.hpp much easier to describe
58 #ifdef HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS
59  #define TPETRA_THROWS_EFFICIENCY_WARNINGS 1
60 #else
61  #define TPETRA_THROWS_EFFICIENCY_WARNINGS 0
62 #endif
63 
64 #ifdef HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS
65  #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 1
66 #else
67  #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 0
68 #endif
69 
70 #ifdef HAVE_TPETRA_THROW_ABUSE_WARNINGS
71  #define TPETRA_THROWS_ABUSE_WARNINGS 1
72 #else
73  #define TPETRA_THROWS_ABUSE_WARNINGS 0
74 #endif
75 
76 #ifdef HAVE_TPETRA_PRINT_ABUSE_WARNINGS
77  #define TPETRA_PRINTS_ABUSE_WARNINGS 1
78 #else
79  #define TPETRA_PRINTS_ABUSE_WARNINGS 0
80 #endif
81 
82 
83 #include <functional>
84 
85 //#ifndef __CUDACC__
86 // mem management
87 #include "Teuchos_Array.hpp" // includes ArrayRCP
88 #include "Teuchos_RCP.hpp"
89 #include "Teuchos_Tuple.hpp" // includes ArrayView
90 // traits classes
91 #include "Teuchos_OrdinalTraits.hpp"
92 #include "Teuchos_ScalarTraits.hpp"
93 #include "Teuchos_TypeNameTraits.hpp"
94 #include "Teuchos_NullIteratorTraits.hpp"
95 #include "Teuchos_SerializationTraits.hpp"
96 // comm
97 #include "Teuchos_CommHelpers.hpp"
98 // misc
99 #include "Teuchos_ParameterList.hpp"
100 //#endif
101 
103 namespace Tpetra {
104 
111  typedef size_t global_size_t;
112 
120  enum LocalGlobal {
121  LocallyReplicated,
122  GloballyDistributed
123  };
124 
129  };
130 
132  enum ProfileType {
135  };
136 
141  };
142 
143 
146  namespace Details {
147 
149  namespace DefaultTypes {
151  typedef double scalar_type;
153  typedef int local_ordinal_type;
154 
157 #if defined(HAVE_TPETRA_INST_INT_INT)
158  typedef int global_ordinal_type;
159 #elif defined(HAVE_TPETRA_INST_INT_LONG_LONG)
160  typedef long long global_ordinal_type;
161 #elif defined(HAVE_TPETRA_INST_INT_LONG)
162  typedef long global_ordinal_type;
163 #elif defined(HAVE_TPETRA_INST_INT_UNSIGNED_LONG)
164  typedef unsigned long global_ordinal_type;
165 #elif defined(HAVE_TPETRA_INST_INT_UNSIGNED)
166  typedef unsigned global_ordinal_type;
167 #else
168 # error "Tpetra: No global ordinal types in the set {int, long long, long, unsigned long, unsigned} have been enabled."
169 #endif
170  typedef KokkosClassic::DefaultNode::DefaultNodeType node_type;
172  } // namespace DefaultTypes
173 
174  } // namespace Details
175 
176  enum EPrivateComputeViewConstructor {
177  COMPUTE_VIEW_CONSTRUCTOR
178  };
179 
180  enum EPrivateHostViewConstructor {
181  HOST_VIEW_CONSTRUCTOR
182  };
183 
200  template<class Arg1, class Arg2>
201  class project1st : public std::binary_function<Arg1, Arg2, Arg1> {
202  public:
203  typedef Arg1 first_argument_type;
204  typedef Arg2 second_argument_type;
205  typedef Arg1 result_type;
206  Arg1 operator () (const Arg1& x, const Arg2& ) const {
207  return x;
208  }
209  };
210 
226  template<class Arg1, class Arg2>
227  class project2nd : public std::binary_function<Arg1, Arg2, Arg2> {
228  public:
229  typedef Arg1 first_argument_type;
230  typedef Arg2 second_argument_type;
231  typedef Arg2 result_type;
232  Arg2 operator () (const Arg1& , const Arg2& y) const {
233  return y;
234  }
235  };
236 
237 } // end of Tpetra namespace
238 
239 
240 // We include this after the above Tpetra namespace declaration,
241 // so that we don't interfere with Doxygen's ability to find the
242 // Tpetra namespace declaration.
243 #include <Tpetra_CombineMode.hpp>
244 
245 
247 namespace TpetraExamples {
248 }
249 
250 namespace Tpetra {
252  namespace RTI {
253  }
254 }
255 
256 namespace Tpetra {
258  namespace Ext {
259  }
260 
266  namespace MatrixMatrix {
267  }
268 }
269 
270 namespace Tpetra {
273  Forward = 0,
274  Backward,
275  Symmetric
276  };
277 }
278 
279 #if defined(HAVE_TPETRACORE_KOKKOSCORE) && defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(TPETRA_ENABLE_KOKKOS_DISTOBJECT)
280 #define TPETRA_USE_KOKKOS_DISTOBJECT 1
281 #else
282 #define TPETRA_USE_KOKKOS_DISTOBJECT 0
283 #endif
284 
285 #include <Kokkos_Complex.hpp>
286 
287 // Specializations of Teuchos::SerializationTraits for
288 // Kokkos::complex<{float,double}>.
289 
290 namespace Teuchos {
291  template<typename Ordinal>
292  class SerializationTraits<Ordinal, ::Kokkos::complex<float> >
293  : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<float> >
294  {};
295 
296  template<typename Ordinal>
297  class SerializationTraits<Ordinal, ::Kokkos::complex<double> >
298  : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<double> >
299  {};
300 } // namespace Teuchos
301 
302 #endif // TPETRA_CONFIGDEFS_HPP
Namespace Tpetra contains the class and methods constituting the Tpetra library.
KokkosClassic::DefaultNode::DefaultNodeType node_type
Default value of Node template parameter.
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).
Namespace for Tpetra example classes and methods.
int local_ordinal_type
Default value of LocalOrdinal template parameter.
Teuchos_Ordinal Array_size_type
Size type for Teuchos Array objects.
Implementation details of Tpetra.
size_t global_size_t
Global size_t object.
Declaration of Tpetra::CombineMode enum, and a function for setting a Tpetra::CombineMode parameter i...
ESweepDirection
Sweep direction for Gauss-Seidel or Successive Over-Relaxation (SOR).
double scalar_type
Default value of Scalar template parameter.
Binary function that returns its second argument.
LocalGlobal
Enum for local versus global allocation of Map entries.
Binary function that returns its first argument.