Xpetra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
Xpetra_ConfigDefs.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Xpetra: A linear algebra interface package
4
//
5
// Copyright 2012 NTESS and the Xpetra contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef XPETRA_CONFIGDEFS_HPP
11
#define XPETRA_CONFIGDEFS_HPP
12
13
#ifndef __cplusplus
14
#define __cplusplus
15
#endif
// ifndef __cplusplus
16
17
/* this section undefines all the things autotools defines for us that we wish it didn't. */
18
19
#ifdef PACKAGE
20
#undef PACKAGE
21
#endif
// ifdef PACKAGE
22
23
#ifdef PACKAGE_NAME
24
#undef PACKAGE_NAME
25
#endif
// ifdef PACKAGE_NAME
26
27
#ifdef PACKAGE_BUGREPORT
28
#undef PACKAGE_BUGREPORT
29
#endif
// ifdef PACKAGE_BUGREPORT
30
31
#ifdef PACKAGE_STRING
32
#undef PACKAGE_STRING
33
#endif
// ifdef PACKAGE_STRING
34
35
#ifdef PACKAGE_TARNAME
36
#undef PACKAGE_TARNAME
37
#endif
// ifdef PACKAGE_TARNAME
38
39
#ifdef PACKAGE_VERSION
40
#undef PACKAGE_VERSION
41
#endif
// ifdef PACKAGE_VERSION
42
43
#ifdef VERSION
44
#undef VERSION
45
#endif
// ifdef VERSION
46
47
// end of undoing autoconf's work section
48
49
#include <Xpetra_config.hpp>
50
#include <
Teuchos_ConfigDefs.hpp
>
51
#include <TpetraCore_config.h>
52
53
#include <Tpetra_ConfigDefs.hpp>
54
56
namespace
Xpetra
{
57
// Used in all Xpetra code that explicitly must a type (like a loop index)
58
// that is used with the Teuchos::Array[View,RCP] classes.
59
61
typedef
Teuchos_Ordinal
Array_size_type
;
62
}
// namespace Xpetra
63
64
// these make some of the macros in Xpetra_Util.hpp much easier to describe
65
#ifdef HAVE_XPETRA_THROW_EFFICIENCY_WARNINGS
66
#define XPETRA_THROWS_EFFICIENCY_WARNINGS 1
67
#else
68
#define XPETRA_THROWS_EFFICIENCY_WARNINGS 0
69
#endif
70
71
#ifdef HAVE_XPETRA_PRINT_EFFICIENCY_WARNINGS
72
#define XPETRA_PRINTS_EFFICIENCY_WARNINGS 1
73
#else
74
#define XPETRA_PRINTS_EFFICIENCY_WARNINGS 0
75
#endif
76
77
#ifdef HAVE_XPETRA_THROW_ABUSE_WARNINGS
78
#define XPETRA_THROWS_ABUSE_WARNINGS 1
79
#else
80
#define XPETRA_THROWS_ABUSE_WARNINGS 0
81
#endif
82
83
#ifdef HAVE_XPETRA_PRINT_ABUSE_WARNINGS
84
#define XPETRA_PRINTS_ABUSE_WARNINGS 1
85
#else
86
#define XPETRA_PRINTS_ABUSE_WARNINGS 0
87
#endif
88
89
#ifdef HAVE_XPETRA_PROFILING
90
#include <string>
91
#include <
Teuchos_TimeMonitor.hpp
>
92
#define XPETRA_MONITOR(funcName) Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("Xpetra: ") + funcName));
93
#else
94
#define XPETRA_MONITOR(funcName)
95
#endif
96
97
// Special macro for exception testing
98
// XPETRA_TEST_FOR_EXCEPTION is only active if Xpetra is configured with Xpetra_ENABLE_DEBUG:BOOL=ON
99
// If you want an exception test both in the release and debug version of Xpetra you still can use directly
100
// TEUCHOS_TEST_FOR_EXCEPTION
101
#ifdef HAVE_XPETRA_DEBUG
102
#define XPETRA_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg) \
103
TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg);
104
#else
105
#define XPETRA_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
106
#endif
107
108
#include <functional>
109
110
// mem management
111
#include <Teuchos_ArrayView.hpp>
112
#include <Teuchos_ArrayRCP.hpp>
113
#include <
Teuchos_Array.hpp
>
114
#include <
Teuchos_RCP.hpp
>
115
// traits classes
116
#include <
Teuchos_OrdinalTraits.hpp
>
117
#include <
Teuchos_ScalarTraits.hpp
>
118
#include <
Teuchos_TypeNameTraits.hpp
>
119
#include <Teuchos_NullIteratorTraits.hpp>
120
#include <
Teuchos_SerializationTraits.hpp
>
121
// comm
122
#include <Teuchos_Comm.hpp>
123
#include <Teuchos_CommHelpers.hpp>
124
// misc
125
#include <
Teuchos_ParameterList.hpp
>
126
128
namespace
Xpetra
{
135
136
typedef
size_t
global_size_t
;
137
139
enum
LocalGlobal
{
140
LocallyReplicated
,
141
GloballyDistributed
142
};
143
145
enum
LookupStatus
{
146
AllIDsPresent
,
147
IDNotPresent
148
};
149
151
enum
OptimizeOption
{
152
DoOptimizeStorage
,
153
DoNotOptimizeStorage
154
};
155
167
168
// enum CombineMode {
169
// ADD, /*!< Existing values will be summed with new values. */
170
// INSERT, /*!< Insert new values that don't currently exist. */
171
// REPLACE, /*!< Existing values will be replaced with new values. */
172
// };
173
174
enum
CombineMode
{
175
ADD
,
176
INSERT
,
177
ABSMAX
178
};
179
180
// import Teuchos memory management classes into Xpetra
181
using
Teuchos::Array
;
182
using
Teuchos::ArrayRCP
;
183
using
Teuchos::ArrayView
;
184
using
Teuchos::Comm
;
185
using
Teuchos::null;
186
using
Teuchos::OrdinalTraits
;
187
using
Teuchos::RCP
;
188
using
Teuchos::ScalarTraits
;
189
190
using
Teuchos::arcp;
191
using
Teuchos::arcp_reinterpret_cast;
192
using
Teuchos::av_reinterpret_cast;
193
using
Teuchos::outArg;
194
using
Teuchos::rcp
;
195
using
Teuchos::rcpFromRef;
196
using
Teuchos::tuple;
197
198
using
Teuchos::typeName
;
199
200
using
Teuchos::ParameterList
;
201
using
Teuchos::parameterList;
202
using
Teuchos::sublist;
203
204
// Xpetra functor objects
205
// inspired by SGI-specific project2nd, project1st
206
template
<
class
Arg1,
class
Arg2>
207
class
firstArg
{
208
public
:
209
typedef
Arg1
first_argument_type
;
210
typedef
Arg2
second_argument_type
;
211
typedef
Arg1
result_type
;
212
inline
Arg1
operator()
(
const
Arg1 &arg1,
const
Arg2 &arg2) {
return
arg1; }
213
};
214
215
template
<
class
Arg1,
class
Arg2>
216
class
secondArg
{
217
public
:
218
typedef
Arg1
first_argument_type
;
219
typedef
Arg2
second_argument_type
;
220
typedef
Arg2
result_type
;
221
inline
Arg2
operator()
(
const
Arg1 &arg1,
const
Arg2 &arg2) {
return
arg2; }
222
};
223
224
}
// namespace Xpetra
225
227
namespace
XpetraExamples
{
228
}
229
230
#define XPETRA_ERR_CHECK(arg) \
231
{ \
232
int r = arg; \
233
if (r < 0) { \
234
std::cout << "r = " << r << std::endl; \
235
assert(r >= 0); \
236
}; \
237
};
// TODO: throw exceptions
238
239
// This include file defines macros to avoid warnings under CUDA. See github issue #1133.
240
#include "Teuchos_CompilerCodeTweakMacros.hpp"
241
242
#endif
// XPETRA_CONFIGDEFS_HPP
Teuchos_Array.hpp
Teuchos_ConfigDefs.hpp
Teuchos_OrdinalTraits.hpp
Teuchos_ParameterList.hpp
Teuchos_RCP.hpp
Teuchos_ScalarTraits.hpp
Teuchos_SerializationTraits.hpp
Teuchos_TimeMonitor.hpp
Teuchos_TypeNameTraits.hpp
Teuchos::Array
Teuchos::ArrayRCP
Teuchos::ArrayView
Teuchos::Comm
Teuchos::ParameterList
Teuchos::RCP
Xpetra::firstArg
Definition
Xpetra_ConfigDefs.hpp:207
Xpetra::firstArg::operator()
Arg1 operator()(const Arg1 &arg1, const Arg2 &arg2)
Definition
Xpetra_ConfigDefs.hpp:212
Xpetra::firstArg::second_argument_type
Arg2 second_argument_type
Definition
Xpetra_ConfigDefs.hpp:210
Xpetra::firstArg::result_type
Arg1 result_type
Definition
Xpetra_ConfigDefs.hpp:211
Xpetra::firstArg::first_argument_type
Arg1 first_argument_type
Definition
Xpetra_ConfigDefs.hpp:209
Xpetra::secondArg
Definition
Xpetra_ConfigDefs.hpp:216
Xpetra::secondArg::first_argument_type
Arg1 first_argument_type
Definition
Xpetra_ConfigDefs.hpp:218
Xpetra::secondArg::operator()
Arg2 operator()(const Arg1 &arg1, const Arg2 &arg2)
Definition
Xpetra_ConfigDefs.hpp:221
Xpetra::secondArg::result_type
Arg2 result_type
Definition
Xpetra_ConfigDefs.hpp:220
Xpetra::secondArg::second_argument_type
Arg2 second_argument_type
Definition
Xpetra_ConfigDefs.hpp:219
Teuchos::typeName
std::string typeName(const T &t)
Teuchos::rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
XpetraExamples
Namespace for Xpetra example classes and methods.
Definition
Xpetra_ConfigDefs.hpp:227
Xpetra
Xpetra namespace
Definition
Xpetra_BlockedCrsMatrix_decl.hpp:52
Xpetra::global_size_t
size_t global_size_t
Global size_t object.
Definition
Xpetra_ConfigDefs.hpp:136
Xpetra::LocalGlobal
LocalGlobal
Definition
Xpetra_ConfigDefs.hpp:139
Xpetra::LocallyReplicated
@ LocallyReplicated
Definition
Xpetra_ConfigDefs.hpp:140
Xpetra::GloballyDistributed
@ GloballyDistributed
Definition
Xpetra_ConfigDefs.hpp:141
Xpetra::Array_size_type
Teuchos_Ordinal Array_size_type
Size type for Teuchos Array objects.
Definition
Xpetra_ConfigDefs.hpp:61
Xpetra::LookupStatus
LookupStatus
Definition
Xpetra_ConfigDefs.hpp:145
Xpetra::AllIDsPresent
@ AllIDsPresent
Definition
Xpetra_ConfigDefs.hpp:146
Xpetra::IDNotPresent
@ IDNotPresent
Definition
Xpetra_ConfigDefs.hpp:147
Xpetra::OptimizeOption
OptimizeOption
Definition
Xpetra_ConfigDefs.hpp:151
Xpetra::DoOptimizeStorage
@ DoOptimizeStorage
Definition
Xpetra_ConfigDefs.hpp:152
Xpetra::DoNotOptimizeStorage
@ DoNotOptimizeStorage
Definition
Xpetra_ConfigDefs.hpp:153
Xpetra::CombineMode
CombineMode
Xpetra::Combine Mode enumerable type.
Definition
Xpetra_ConfigDefs.hpp:174
Xpetra::ADD
@ ADD
Definition
Xpetra_ConfigDefs.hpp:175
Xpetra::ABSMAX
@ ABSMAX
Definition
Xpetra_ConfigDefs.hpp:177
Xpetra::INSERT
@ INSERT
Definition
Xpetra_ConfigDefs.hpp:176
Teuchos::OrdinalTraits
Teuchos::ScalarTraits
src
Headers
Xpetra_ConfigDefs.hpp
Generated by
1.17.0