Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef XPETRA_CONFIGDEFS_HPP
00047 #define XPETRA_CONFIGDEFS_HPP
00048
00049 #ifndef __cplusplus
00050 #define __cplusplus
00051 #endif // ifndef __cplusplus
00052
00053
00054
00055 #ifdef PACKAGE
00056 #undef PACKAGE
00057 #endif // ifdef PACKAGE
00058
00059 #ifdef PACKAGE_NAME
00060 #undef PACKAGE_NAME
00061 #endif // ifdef PACKAGE_NAME
00062
00063 #ifdef PACKAGE_BUGREPORT
00064 #undef PACKAGE_BUGREPORT
00065 #endif // ifdef PACKAGE_BUGREPORT
00066
00067 #ifdef PACKAGE_STRING
00068 #undef PACKAGE_STRING
00069 #endif // ifdef PACKAGE_STRING
00070
00071 #ifdef PACKAGE_TARNAME
00072 #undef PACKAGE_TARNAME
00073 #endif // ifdef PACKAGE_TARNAME
00074
00075 #ifdef PACKAGE_VERSION
00076 #undef PACKAGE_VERSION
00077 #endif // ifdef PACKAGE_VERSION
00078
00079 #ifdef VERSION
00080 #undef VERSION
00081 #endif // ifdef VERSION
00082
00083
00084
00085 #include <Xpetra_config.hpp>
00086 #include <Teuchos_ConfigDefs.hpp>
00087 #include <Kokkos_ConfigDefs.hpp>
00088
00090 namespace Xpetra {
00091
00092
00093
00095 typedef Teuchos_Ordinal Array_size_type;
00096 }
00097
00098
00099 #ifdef HAVE_XPETRA_THROW_EFFICIENCY_WARNINGS
00100 #define XPETRA_THROWS_EFFICIENCY_WARNINGS 1
00101 #else
00102 #define XPETRA_THROWS_EFFICIENCY_WARNINGS 0
00103 #endif
00104
00105 #ifdef HAVE_XPETRA_PRINT_EFFICIENCY_WARNINGS
00106 #define XPETRA_PRINTS_EFFICIENCY_WARNINGS 1
00107 #else
00108 #define XPETRA_PRINTS_EFFICIENCY_WARNINGS 0
00109 #endif
00110
00111 #ifdef HAVE_XPETRA_THROW_ABUSE_WARNINGS
00112 #define XPETRA_THROWS_ABUSE_WARNINGS 1
00113 #else
00114 #define XPETRA_THROWS_ABUSE_WARNINGS 0
00115 #endif
00116
00117 #ifdef HAVE_XPETRA_PRINT_ABUSE_WARNINGS
00118 #define XPETRA_PRINTS_ABUSE_WARNINGS 1
00119 #else
00120 #define XPETRA_PRINTS_ABUSE_WARNINGS 0
00121 #endif
00122
00123 #ifdef HAVE_XPETRA_PROFILING
00124 #include <string>
00125 #include <Teuchos_TimeMonitor.hpp>
00126 #define XPETRA_MONITOR(funcName) Teuchos::TimeMonitor(*Teuchos::TimeMonitor::getNewTimer(std::string("Xpetra: ") + funcName));
00127 #else
00128 #define XPETRA_MONITOR(funcName)
00129 #endif
00130
00131 #include <functional>
00132
00133 #ifndef __CUDACC__
00134
00135 #include <Teuchos_ArrayView.hpp>
00136 #include <Teuchos_ArrayRCP.hpp>
00137 #include <Teuchos_Array.hpp>
00138 #include <Teuchos_RCP.hpp>
00139
00140 #include <Teuchos_OrdinalTraits.hpp>
00141 #include <Teuchos_ScalarTraits.hpp>
00142 #include <Teuchos_TypeNameTraits.hpp>
00143 #include <Teuchos_NullIteratorTraits.hpp>
00144 #include <Teuchos_SerializationTraits.hpp>
00145
00146 #include <Teuchos_Comm.hpp>
00147 #include <Teuchos_CommHelpers.hpp>
00148
00149 #include <Teuchos_ParameterList.hpp>
00150 #endif
00151
00153 namespace Xpetra {
00161 typedef size_t global_size_t;
00162
00164 enum LocalGlobal {
00165 LocallyReplicated,
00166 GloballyDistributed
00167 };
00168
00170 enum LookupStatus {
00171 AllIDsPresent,
00172 IDNotPresent
00173 };
00174
00176 enum ProfileType {
00177 StaticProfile,
00178 DynamicProfile
00179 };
00180
00182 enum OptimizeOption {
00183 DoOptimizeStorage,
00184 DoNotOptimizeStorage
00185 };
00186
00199
00200
00201
00202
00203
00204
00205 enum CombineMode {
00206 ADD,
00207 INSERT,
00208 ABSMAX
00209 };
00210
00211
00212 #ifndef __CUDACC__
00213 using Teuchos::ArrayRCP;
00214 using Teuchos::ArrayView;
00215 using Teuchos::Array;
00216 using Teuchos::OrdinalTraits;
00217 using Teuchos::ScalarTraits;
00218 using Teuchos::RCP;
00219 using Teuchos::Comm;
00220 using Teuchos::null;
00221
00222 using Teuchos::outArg;
00223 using Teuchos::tuple;
00224 using Teuchos::arcp;
00225 using Teuchos::rcp;
00226 using Teuchos::rcpFromRef;
00227 using Teuchos::av_reinterpret_cast;
00228 using Teuchos::arcp_reinterpret_cast;
00229
00230 using Teuchos::typeName;
00231
00232 using Teuchos::ParameterList;
00233 using Teuchos::parameterList;
00234 using Teuchos::sublist;
00235 #endif
00236
00237
00238
00239 template <class Arg1, class Arg2>
00240 class firstArg : std::binary_function<Arg1,Arg2,Arg1> {
00241 public:
00242 typedef Arg1 first_argument_type;
00243 typedef Arg2 second_argument_type;
00244 typedef Arg1 result_type;
00245 inline Arg1 operator()(const Arg1 &arg1, const Arg2 &arg2) { return arg1;}
00246 };
00247
00248 template <class Arg1, class Arg2>
00249 class secondArg : std::binary_function<Arg1,Arg2,Arg2> {
00250 public:
00251 typedef Arg1 first_argument_type;
00252 typedef Arg2 second_argument_type;
00253 typedef Arg2 result_type;
00254 inline Arg2 operator()(const Arg1 &arg1, const Arg2 &arg2) { return arg2;}
00255 };
00256
00257 }
00258
00259
00261 namespace XpetraExamples {
00262 }
00263
00264 #define XPETRA_ERR_CHECK(arg) { int r = arg; if (r < 0) { std::cout << "r = " << r << std::endl; assert(r>=0); }; }; // TODO: throw exceptions
00265
00266 #endif // XPETRA_CONFIGDEFS_HPP