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 #ifndef __cplusplus
46 #define __cplusplus
47 #endif // ifndef __cplusplus
48 
49 /* this section undefines all the things autotools defines for us that we wish it didn't. */
50 
51 #ifdef PACKAGE
52 #undef PACKAGE
53 #endif // ifdef PACKAGE
54 
55 #ifdef PACKAGE_NAME
56 #undef PACKAGE_NAME
57 #endif // ifdef PACKAGE_NAME
58 
59 #ifdef PACKAGE_BUGREPORT
60 #undef PACKAGE_BUGREPORT
61 #endif // ifdef PACKAGE_BUGREPORT
62 
63 #ifdef PACKAGE_STRING
64 #undef PACKAGE_STRING
65 #endif // ifdef PACKAGE_STRING
66 
67 #ifdef PACKAGE_TARNAME
68 #undef PACKAGE_TARNAME
69 #endif // ifdef PACKAGE_TARNAME
70 
71 #ifdef PACKAGE_VERSION
72 #undef PACKAGE_VERSION
73 #endif // ifdef PACKAGE_VERSION
74 
75 #ifdef VERSION
76 #undef VERSION
77 #endif // ifdef VERSION
78 
79 // end of undoing autoconf's work section
80 
81 #include <TpetraCore_config.h>
82 #include <Teuchos_ConfigDefs.hpp>
83 #include <Kokkos_ConfigDefs.hpp>
84 #include <Kokkos_DefaultNode.hpp>
85 
87 namespace Tpetra {
88  // Used in all Tpetra code that explicitly must a type (like a loop index)
89  // that is used with the Teuchos::Array[View,RCP] classes.
90 
92  typedef Teuchos_Ordinal Array_size_type;
93 }
94 
95 // these make some of the macros in Tpetra_Util.hpp much easier to describe
96 #ifdef HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS
97  #define TPETRA_THROWS_EFFICIENCY_WARNINGS 1
98 #else
99  #define TPETRA_THROWS_EFFICIENCY_WARNINGS 0
100 #endif
101 
102 #ifdef HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS
103  #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 1
104 #else
105  #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 0
106 #endif
107 
108 #ifdef HAVE_TPETRA_THROW_ABUSE_WARNINGS
109  #define TPETRA_THROWS_ABUSE_WARNINGS 1
110 #else
111  #define TPETRA_THROWS_ABUSE_WARNINGS 0
112 #endif
113 
114 #ifdef HAVE_TPETRA_PRINT_ABUSE_WARNINGS
115  #define TPETRA_PRINTS_ABUSE_WARNINGS 1
116 #else
117  #define TPETRA_PRINTS_ABUSE_WARNINGS 0
118 #endif
119 
120 
121 #include <functional>
122 
123 //#ifndef __CUDACC__
124 // mem management
125 #include <Teuchos_ArrayView.hpp>
126 #include <Teuchos_ArrayRCP.hpp>
127 #include <Teuchos_Array.hpp>
128 #include <Teuchos_RCP.hpp>
129 #include <Teuchos_Tuple.hpp>
130 // traits classes
131 #include <Teuchos_OrdinalTraits.hpp>
132 #include <Teuchos_ScalarTraits.hpp>
133 #include <Teuchos_TypeNameTraits.hpp>
134 #include <Teuchos_NullIteratorTraits.hpp>
135 #include <Teuchos_SerializationTraits.hpp>
136 // comm
137 #include <Teuchos_Comm.hpp>
138 #include <Teuchos_CommHelpers.hpp>
139 // misc
140 #include <Teuchos_ParameterList.hpp>
141 //#endif
142 
144 namespace Tpetra {
145 
152  typedef size_t global_size_t;
153 
161  enum LocalGlobal {
162  LocallyReplicated,
163  GloballyDistributed
164  };
165 
170  };
171 
173  enum ProfileType {
176  };
177 
182  };
183 
184 
187  namespace Details {
188 
190  namespace DefaultTypes {
192  typedef double scalar_type;
194  typedef int local_ordinal_type;
195 
198 #if defined(HAVE_TPETRA_INST_INT_INT)
199  typedef int global_ordinal_type;
200 #elif defined(HAVE_TPETRA_INST_INT_LONG_LONG)
201  typedef long long global_ordinal_type;
202 #elif defined(HAVE_TPETRA_INST_INT_LONG)
203  typedef long global_ordinal_type;
204 #elif defined(HAVE_TPETRA_INST_INT_UNSIGNED_LONG)
205  typedef unsigned long global_ordinal_type;
206 #elif defined(HAVE_TPETRA_INST_INT_UNSIGNED)
207  typedef unsigned global_ordinal_type;
208 #else
209 # error "Tpetra: No global ordinal types in the set {int, long long, long, unsigned long, unsigned} have been enabled."
210 #endif
211  typedef KokkosClassic::DefaultNode::DefaultNodeType node_type;
213  } // namespace DefaultTypes
214 
215  } // namespace Details
216 
217  enum EPrivateComputeViewConstructor {
218  COMPUTE_VIEW_CONSTRUCTOR
219  };
220 
221  enum EPrivateHostViewConstructor {
222  HOST_VIEW_CONSTRUCTOR
223  };
224 
225  // import Teuchos memory management classes into Tpetra
226 //#ifndef __CUDACC__
227  using Teuchos::ArrayRCP;
228  using Teuchos::ArrayView;
229  using Teuchos::Array;
230  using Teuchos::OrdinalTraits;
231  using Teuchos::ScalarTraits;
232  using Teuchos::RCP;
233  using Teuchos::Tuple;
234  using Teuchos::Comm;
235  using Teuchos::null;
236 
237  using Teuchos::outArg;
238  using Teuchos::tuple;
239  using Teuchos::arcp;
240  using Teuchos::rcp;
241  using Teuchos::rcpFromRef;
242  using Teuchos::rcp_const_cast;
243  using Teuchos::av_reinterpret_cast;
244  using Teuchos::arcp_reinterpret_cast;
245 
246  using Teuchos::typeName;
247 
248  using Teuchos::ParameterList;
249  using Teuchos::parameterList;
250  using Teuchos::sublist;
251 //#endif
252 
269  template<class Arg1, class Arg2>
270  class project1st : public std::binary_function<Arg1, Arg2, Arg1> {
271  public:
272  typedef Arg1 first_argument_type;
273  typedef Arg2 second_argument_type;
274  typedef Arg1 result_type;
275  Arg1 operator () (const Arg1& x, const Arg2& ) const {
276  return x;
277  }
278  };
279 
295  template<class Arg1, class Arg2>
296  class project2nd : public std::binary_function<Arg1, Arg2, Arg2> {
297  public:
298  typedef Arg1 first_argument_type;
299  typedef Arg2 second_argument_type;
300  typedef Arg2 result_type;
301  Arg2 operator () (const Arg1& , const Arg2& y) const {
302  return y;
303  }
304  };
305 
306 } // end of Tpetra namespace
307 
308 
309 // We include this after the above Tpetra namespace declaration,
310 // so that we don't interfere with Doxygen's ability to find the
311 // Tpetra namespace declaration.
312 #include <Tpetra_CombineMode.hpp>
313 
314 
316 namespace TpetraExamples {
317 }
318 
319 namespace Tpetra {
321  namespace RTI {
322  }
323 }
324 
325 namespace Tpetra {
327  namespace Ext {
328  }
329 
335  namespace MatrixMatrix {
336  }
337 }
338 
339 namespace Tpetra {
342  Forward = 0,
343  Backward,
344  Symmetric
345  };
346 }
347 
348 #if defined(HAVE_TPETRACORE_KOKKOSCORE) && defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(TPETRA_ENABLE_KOKKOS_DISTOBJECT)
349 #define TPETRA_USE_KOKKOS_DISTOBJECT 1
350 #else
351 #define TPETRA_USE_KOKKOS_DISTOBJECT 0
352 #endif
353 
354 #include <Kokkos_Complex.hpp>
355 
356 // Specializations of Teuchos::SerializationTraits for
357 // Kokkos::complex<{float,double}>.
358 
359 namespace Teuchos {
360  template<typename Ordinal>
361  class SerializationTraits<Ordinal, ::Kokkos::complex<float> >
362  : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<float> >
363  {};
364 
365  template<typename Ordinal>
366  class SerializationTraits<Ordinal, ::Kokkos::complex<double> >
367  : public DirectSerializationTraits<Ordinal, ::Kokkos::complex<double> >
368  {};
369 } // namespace Teuchos
370 
371 #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.