|
Tpetra Matrix/Vector Services Version of the Day
|
00001 // @HEADER 00002 // *********************************************************************** 00003 // 00004 // Tpetra: Templated Linear Algebra Services Package 00005 // Copyright (2008) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 // @HEADER 00028 00029 #ifndef TPETRA_CONFIGDEFS_HPP 00030 #define TPETRA_CONFIGDEFS_HPP 00031 00032 #ifndef __cplusplus 00033 #define __cplusplus 00034 #endif // ifndef __cplusplus 00035 00036 /* this section undefines all the things autotools defines for us that we wish it didn't. */ 00037 00038 #ifdef PACKAGE 00039 #undef PACKAGE 00040 #endif // ifdef PACKAGE 00041 00042 #ifdef PACKAGE_NAME 00043 #undef PACKAGE_NAME 00044 #endif // ifdef PACKAGE_NAME 00045 00046 #ifdef PACKAGE_BUGREPORT 00047 #undef PACKAGE_BUGREPORT 00048 #endif // ifdef PACKAGE_BUGREPORT 00049 00050 #ifdef PACKAGE_STRING 00051 #undef PACKAGE_STRING 00052 #endif // ifdef PACKAGE_STRING 00053 00054 #ifdef PACKAGE_TARNAME 00055 #undef PACKAGE_TARNAME 00056 #endif // ifdef PACKAGE_TARNAME 00057 00058 #ifdef PACKAGE_VERSION 00059 #undef PACKAGE_VERSION 00060 #endif // ifdef PACKAGE_VERSION 00061 00062 #ifdef VERSION 00063 #undef VERSION 00064 #endif // ifdef VERSION 00065 00066 // end of undoing autoconf's work section 00067 00068 #include <Tpetra_config.h> 00069 #include <Teuchos_ConfigDefs.hpp> 00070 #include <Kokkos_ConfigDefs.hpp> 00071 00073 namespace Tpetra { 00074 // Used in all Tpetra code that explicitly must a type (like a loop index) 00075 // that is used with the Teuchos::Array[View,RCP] classes. 00076 00078 typedef Teuchos_Ordinal Array_size_type; 00079 } 00080 00081 // these make some of the macros in Tpetra_Util.hpp much easier to describe 00082 #ifdef HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS 00083 #define TPETRA_THROWS_EFFICIENCY_WARNINGS 1 00084 #else 00085 #define TPETRA_THROWS_EFFICIENCY_WARNINGS 0 00086 #endif 00087 00088 #ifdef HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS 00089 #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 1 00090 #else 00091 #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 0 00092 #endif 00093 00094 #ifdef HAVE_TPETRA_THROW_ABUSE_WARNINGS 00095 #define TPETRA_THROWS_ABUSE_WARNINGS 1 00096 #else 00097 #define TPETRA_THROWS_ABUSE_WARNINGS 0 00098 #endif 00099 00100 #ifdef HAVE_TPETRA_PRINT_ABUSE_WARNINGS 00101 #define TPETRA_PRINTS_ABUSE_WARNINGS 1 00102 #else 00103 #define TPETRA_PRINTS_ABUSE_WARNINGS 0 00104 #endif 00105 00106 #include <functional> 00107 00108 #ifndef __CUDACC__ 00109 // mem management 00110 #include <Teuchos_ArrayView.hpp> 00111 #include <Teuchos_ArrayRCP.hpp> 00112 #include <Teuchos_Array.hpp> 00113 #include <Teuchos_RCP.hpp> 00114 // traits classes 00115 #include <Teuchos_OrdinalTraits.hpp> 00116 #include <Teuchos_ScalarTraits.hpp> 00117 #include <Teuchos_TypeNameTraits.hpp> 00118 #include <Teuchos_NullIteratorTraits.hpp> 00119 #include <Teuchos_SerializationTraits.hpp> 00120 // comm 00121 #include <Teuchos_Comm.hpp> 00122 #include <Teuchos_CommHelpers.hpp> 00123 #endif 00124 00126 namespace Tpetra { 00134 typedef size_t global_size_t; 00135 00137 enum LocalGlobal { 00138 LocallyReplicated, 00139 GloballyDistributed 00140 }; 00141 00143 enum LookupStatus { 00144 AllIDsPresent, 00145 IDNotPresent 00146 }; 00147 00149 enum ProfileType { 00150 StaticProfile, 00151 DynamicProfile 00152 }; 00153 00155 enum OptimizeOption { 00156 DoOptimizeStorage, 00157 DoNotOptimizeStorage 00158 }; 00159 00171 enum CombineMode { 00172 ADD, 00173 INSERT, 00174 REPLACE 00175 }; 00176 00177 // import Teuchos memory management classes into Tpetra 00178 #ifndef __CUDACC__ 00179 using Teuchos::ArrayRCP; 00180 using Teuchos::ArrayView; 00181 using Teuchos::Array; 00182 using Teuchos::OrdinalTraits; 00183 using Teuchos::ScalarTraits; 00184 using Teuchos::RCP; 00185 using Teuchos::Comm; 00186 using Teuchos::null; 00187 00188 using Teuchos::outArg; 00189 using Teuchos::tuple; 00190 using Teuchos::arcp; 00191 using Teuchos::rcp; 00192 using Teuchos::rcpFromRef; 00193 using Teuchos::av_reinterpret_cast; 00194 using Teuchos::arcp_reinterpret_cast; 00195 00196 using Teuchos::typeName; 00197 #endif 00198 00199 // Tpetra functor objects 00200 // inspired by SGI-specific project2nd, project1st 00201 template <class Arg1, class Arg2> 00202 class firstArg : std::binary_function<Arg1,Arg2,Arg1> { 00203 public: 00204 typedef Arg1 first_argument_type; 00205 typedef Arg2 second_argument_type; 00206 typedef Arg1 result_type; 00207 inline Arg1 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg1;} 00208 }; 00209 00210 template <class Arg1, class Arg2> 00211 class secondArg : std::binary_function<Arg1,Arg2,Arg2> { 00212 public: 00213 typedef Arg1 first_argument_type; 00214 typedef Arg2 second_argument_type; 00215 typedef Arg2 result_type; 00216 inline Arg2 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg2;} 00217 }; 00218 00219 } // end of Tpetra namespace 00220 00221 00223 namespace TpetraExamples { 00224 } 00225 00226 00227 #endif // TPETRA_CONFIGDEFS_HPP
1.7.4