Tpetra Matrix/Vector Services  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 <Tpetra_config.h>
82 #include <Teuchos_ConfigDefs.hpp>
83 #include <Kokkos_ConfigDefs.hpp>
84 
86 namespace Tpetra {
87  // Used in all Tpetra code that explicitly must a type (like a loop index)
88  // that is used with the Teuchos::Array[View,RCP] classes.
89 
91  typedef Teuchos_Ordinal Array_size_type;
92 }
93 
94 // these make some of the macros in Tpetra_Util.hpp much easier to describe
95 #ifdef HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS
96  #define TPETRA_THROWS_EFFICIENCY_WARNINGS 1
97 #else
98  #define TPETRA_THROWS_EFFICIENCY_WARNINGS 0
99 #endif
100 
101 #ifdef HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS
102  #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 1
103 #else
104  #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 0
105 #endif
106 
107 #ifdef HAVE_TPETRA_THROW_ABUSE_WARNINGS
108  #define TPETRA_THROWS_ABUSE_WARNINGS 1
109 #else
110  #define TPETRA_THROWS_ABUSE_WARNINGS 0
111 #endif
112 
113 #ifdef HAVE_TPETRA_PRINT_ABUSE_WARNINGS
114  #define TPETRA_PRINTS_ABUSE_WARNINGS 1
115 #else
116  #define TPETRA_PRINTS_ABUSE_WARNINGS 0
117 #endif
118 
119 
120 #include <functional>
121 
122 #ifndef __CUDACC__
123 // mem management
124 #include <Teuchos_ArrayView.hpp>
125 #include <Teuchos_ArrayRCP.hpp>
126 #include <Teuchos_Array.hpp>
127 #include <Teuchos_RCP.hpp>
128 #include <Teuchos_Tuple.hpp>
129 // traits classes
130 #include <Teuchos_OrdinalTraits.hpp>
131 #include <Teuchos_ScalarTraits.hpp>
133 #include <Teuchos_NullIteratorTraits.hpp>
135 // comm
136 #include <Teuchos_Comm.hpp>
137 #include <Teuchos_CommHelpers.hpp>
138 // misc
139 #include <Teuchos_ParameterList.hpp>
140 #endif
141 
143 namespace Tpetra {
144 
152  typedef size_t global_size_t;
153 
155  enum LocalGlobal {
158  };
159 
164  };
165 
167  enum ProfileType {
170  };
171 
176  };
177 
189  enum CombineMode {
190  ADD,
194  };
195 
196  enum EPrivateComputeViewConstructor {
197  COMPUTE_VIEW_CONSTRUCTOR
198  };
199 
200  enum EPrivateHostViewConstructor {
201  HOST_VIEW_CONSTRUCTOR
202  };
203 
204  // import Teuchos memory management classes into Tpetra
205 #ifndef __CUDACC__
206  using Teuchos::ArrayRCP;
207  using Teuchos::ArrayView;
208  using Teuchos::Array;
210  using Teuchos::ScalarTraits;
211  using Teuchos::RCP;
212  using Teuchos::Tuple;
213  using Teuchos::Comm;
214  using Teuchos::null;
215 
216  using Teuchos::outArg;
217  using Teuchos::tuple;
218  using Teuchos::arcp;
219  using Teuchos::rcp;
220  using Teuchos::rcpFromRef;
221  using Teuchos::rcp_const_cast;
222  using Teuchos::av_reinterpret_cast;
223  using Teuchos::arcp_reinterpret_cast;
224 
225  using Teuchos::typeName;
226 
228  using Teuchos::parameterList;
229  using Teuchos::sublist;
230 #endif
231 
248  template<class Arg1, class Arg2>
249  class project1st : public std::binary_function<Arg1, Arg2, Arg1> {
250  public:
251  typedef Arg1 first_argument_type;
252  typedef Arg2 second_argument_type;
253  typedef Arg1 result_type;
254  Arg1 operator () (const Arg1& x, const Arg2& ) const {
255  return x;
256  }
257  };
258 
274  template<class Arg1, class Arg2>
275  class project2nd : public std::binary_function<Arg1, Arg2, Arg2> {
276  public:
277  typedef Arg1 first_argument_type;
278  typedef Arg2 second_argument_type;
279  typedef Arg2 result_type;
280  Arg2 operator () (const Arg1& , const Arg2& y) const {
281  return y;
282  }
283  };
284 
287  template <class Arg1, class Arg2>
288  class TEUCHOS_DEPRECATED firstArg : std::binary_function<Arg1,Arg2,Arg1> {
289  public:
290  typedef Arg1 first_argument_type;
291  typedef Arg2 second_argument_type;
292  typedef Arg1 result_type;
293  inline Arg1 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg1;}
294  };
295 
298  template <class Arg1, class Arg2>
299  class TEUCHOS_DEPRECATED secondArg : std::binary_function<Arg1,Arg2,Arg2> {
300  public:
301  typedef Arg1 first_argument_type;
302  typedef Arg2 second_argument_type;
303  typedef Arg2 result_type;
304  inline Arg2 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg2;}
305  };
306 
307 } // end of Tpetra namespace
308 
309 
311 namespace TpetraExamples {
312 }
313 
314 namespace Tpetra {
316  namespace RTI {
317  }
318 }
319 
320 namespace Tpetra {
322  namespace Ext {
323  }
324 
331  namespace MatrixMatrix {
332  }
333 }
334 
335 namespace Tpetra {
338  Forward = 0,
339  Backward,
340  Symmetric
341  };
342 }
343 
344 #endif // TPETRA_CONFIGDEFS_HPP
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Namespace for Tpetra example classes and methods.
Teuchos_Ordinal Array_size_type
Size type for Teuchos Array objects.
size_t global_size_t
Global size_t object.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
ESweepDirection
Sweep direction for Gauss-Seidel or Successive Over-Relaxation (SOR).
CombineMode
Tpetra::Combine Mode enumerable type.
Distributed sparse matrix-matrix multiply and add.
DEPRECATED; please use project2nd instead.
Binary function that returns its second argument.
DEPRECATED; please use project1st instead.
Binary function that returns its first argument.
std::string typeName(const T &t)