Tpetra Matrix/Vector Services Version of the Day
Tpetra_ConfigDefs.hpp
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 
00107 #include <functional>
00108 
00109 #ifndef __CUDACC__
00110 // mem management
00111 #include <Teuchos_ArrayView.hpp>
00112 #include <Teuchos_ArrayRCP.hpp>
00113 #include <Teuchos_Array.hpp>
00114 #include <Teuchos_RCP.hpp>
00115 #include <Teuchos_Tuple.hpp>
00116 // traits classes
00117 #include <Teuchos_OrdinalTraits.hpp>
00118 #include <Teuchos_ScalarTraits.hpp>
00119 #include <Teuchos_TypeNameTraits.hpp>
00120 #include <Teuchos_NullIteratorTraits.hpp>
00121 #include <Teuchos_SerializationTraits.hpp>
00122 // comm
00123 #include <Teuchos_Comm.hpp>
00124 #include <Teuchos_CommHelpers.hpp>
00125 #endif
00126 
00128 namespace Tpetra {
00129 
00137   typedef size_t global_size_t;
00138 
00140   enum LocalGlobal {
00141     LocallyReplicated,  
00142     GloballyDistributed 
00143   };
00144 
00146   enum LookupStatus {
00147     AllIDsPresent, 
00148     IDNotPresent   
00149   };
00150 
00152   enum ProfileType {
00153     StaticProfile,  
00154     DynamicProfile  
00155   };
00156 
00158   enum OptimizeOption {
00159     DoOptimizeStorage,   
00160     DoNotOptimizeStorage 
00161   };
00162 
00174   enum CombineMode {
00175     ADD,     
00176     INSERT,  
00177     REPLACE, 
00178     ABSMAX   
00179   };
00180 
00181   // import Teuchos memory management classes into Tpetra
00182 #ifndef __CUDACC__
00183   using Teuchos::ArrayRCP;
00184   using Teuchos::ArrayView;
00185   using Teuchos::Array;
00186   using Teuchos::OrdinalTraits;
00187   using Teuchos::ScalarTraits;
00188   using Teuchos::RCP;
00189   using Teuchos::Tuple;
00190   using Teuchos::Comm;
00191   using Teuchos::null;
00192 
00193   using Teuchos::outArg;
00194   using Teuchos::tuple;
00195   using Teuchos::arcp;
00196   using Teuchos::rcp;
00197   using Teuchos::rcpFromRef;
00198   using Teuchos::av_reinterpret_cast;
00199   using Teuchos::arcp_reinterpret_cast;
00200 
00201   using Teuchos::typeName;
00202 #endif
00203 
00204   // Tpetra functor objects
00205   // inspired by SGI-specific project2nd, project1st
00206   template <class Arg1, class Arg2>
00207   class firstArg : std::binary_function<Arg1,Arg2,Arg1> {
00208     public:
00209     typedef Arg1 first_argument_type;
00210     typedef Arg2 second_argument_type;
00211     typedef Arg1 result_type;
00212     inline Arg1 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg1;}
00213   };
00214 
00215   template <class Arg1, class Arg2>
00216   class secondArg : std::binary_function<Arg1,Arg2,Arg2> {
00217     public:
00218     typedef Arg1 first_argument_type;
00219     typedef Arg2 second_argument_type;
00220     typedef Arg2 result_type;
00221     inline Arg2 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg2;}
00222   };
00223 
00224 } // end of Tpetra namespace
00225 
00226 
00228 namespace TpetraExamples {
00229 }
00230 
00231 namespace Tpetra {
00233   namespace RTI {
00234   }
00235 }
00236 
00237 namespace Tpetra {
00239   namespace Ext {
00240   }
00242   namespace MatrixMatrix {
00243   }
00244 }
00245 
00246 #endif // TPETRA_CONFIGDEFS_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines