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 the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 // 
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00038 // 
00039 // ************************************************************************
00040 // @HEADER
00041 
00042 #ifndef TPETRA_CONFIGDEFS_HPP
00043 #define TPETRA_CONFIGDEFS_HPP
00044 
00045 #ifndef __cplusplus
00046 #define __cplusplus
00047 #endif // ifndef __cplusplus
00048 
00049 /* this section undefines all the things autotools defines for us that we wish it didn't. */
00050 
00051 #ifdef PACKAGE
00052 #undef PACKAGE
00053 #endif // ifdef PACKAGE
00054 
00055 #ifdef PACKAGE_NAME
00056 #undef PACKAGE_NAME
00057 #endif // ifdef PACKAGE_NAME
00058 
00059 #ifdef PACKAGE_BUGREPORT
00060 #undef PACKAGE_BUGREPORT
00061 #endif // ifdef PACKAGE_BUGREPORT
00062 
00063 #ifdef PACKAGE_STRING
00064 #undef PACKAGE_STRING
00065 #endif // ifdef PACKAGE_STRING
00066 
00067 #ifdef PACKAGE_TARNAME
00068 #undef PACKAGE_TARNAME
00069 #endif // ifdef PACKAGE_TARNAME
00070 
00071 #ifdef PACKAGE_VERSION
00072 #undef PACKAGE_VERSION
00073 #endif // ifdef PACKAGE_VERSION
00074 
00075 #ifdef VERSION
00076 #undef VERSION
00077 #endif // ifdef VERSION
00078 
00079 // end of undoing autoconf's work section
00080 
00081 #include <Tpetra_config.h>
00082 #include <Teuchos_ConfigDefs.hpp>
00083 #include <Kokkos_ConfigDefs.hpp>
00084 
00086 namespace Tpetra { 
00087   // Used in all Tpetra code that explicitly must a type (like a loop index)
00088   // that is used with the Teuchos::Array[View,RCP] classes.
00089 
00091   typedef Teuchos_Ordinal Array_size_type; 
00092 }
00093 
00094 // these make some of the macros in Tpetra_Util.hpp much easier to describe
00095 #ifdef HAVE_TPETRA_THROW_EFFICIENCY_WARNINGS
00096   #define TPETRA_THROWS_EFFICIENCY_WARNINGS 1
00097 #else
00098   #define TPETRA_THROWS_EFFICIENCY_WARNINGS 0
00099 #endif
00100 
00101 #ifdef HAVE_TPETRA_PRINT_EFFICIENCY_WARNINGS
00102   #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 1
00103 #else
00104   #define TPETRA_PRINTS_EFFICIENCY_WARNINGS 0
00105 #endif
00106 
00107 #ifdef HAVE_TPETRA_THROW_ABUSE_WARNINGS
00108   #define TPETRA_THROWS_ABUSE_WARNINGS 1
00109 #else
00110   #define TPETRA_THROWS_ABUSE_WARNINGS 0
00111 #endif
00112 
00113 #ifdef HAVE_TPETRA_PRINT_ABUSE_WARNINGS
00114   #define TPETRA_PRINTS_ABUSE_WARNINGS 1
00115 #else
00116   #define TPETRA_PRINTS_ABUSE_WARNINGS 0
00117 #endif
00118 
00119 
00120 #include <functional>
00121 
00122 #ifndef __CUDACC__
00123 // mem management
00124 #include <Teuchos_ArrayView.hpp>
00125 #include <Teuchos_ArrayRCP.hpp>
00126 #include <Teuchos_Array.hpp>
00127 #include <Teuchos_RCP.hpp>
00128 #include <Teuchos_Tuple.hpp>
00129 // traits classes
00130 #include <Teuchos_OrdinalTraits.hpp>
00131 #include <Teuchos_ScalarTraits.hpp>
00132 #include <Teuchos_TypeNameTraits.hpp>
00133 #include <Teuchos_NullIteratorTraits.hpp>
00134 #include <Teuchos_SerializationTraits.hpp>
00135 // comm
00136 #include <Teuchos_Comm.hpp>
00137 #include <Teuchos_CommHelpers.hpp>
00138 // misc
00139 #include <Teuchos_ParameterList.hpp>
00140 #endif
00141 
00143 namespace Tpetra {
00144 
00152   typedef size_t global_size_t;
00153 
00155   enum LocalGlobal {
00156     LocallyReplicated,  
00157     GloballyDistributed 
00158   };
00159 
00161   enum LookupStatus {
00162     AllIDsPresent, 
00163     IDNotPresent   
00164   };
00165 
00167   enum ProfileType {
00168     StaticProfile,  
00169     DynamicProfile  
00170   };
00171 
00173   enum OptimizeOption {
00174     DoOptimizeStorage,   
00175     DoNotOptimizeStorage 
00176   };
00177 
00189   enum CombineMode {
00190     ADD,     
00191     INSERT,  
00192     REPLACE, 
00193     ABSMAX   
00194   };
00195 
00196   enum EPrivateComputeViewConstructor {
00197     COMPUTE_VIEW_CONSTRUCTOR
00198   };
00199 
00200   enum EPrivateHostViewConstructor {
00201     HOST_VIEW_CONSTRUCTOR
00202   };
00203 
00204   // import Teuchos memory management classes into Tpetra
00205 #ifndef __CUDACC__
00206   using Teuchos::ArrayRCP;
00207   using Teuchos::ArrayView;
00208   using Teuchos::Array;
00209   using Teuchos::OrdinalTraits;
00210   using Teuchos::ScalarTraits;
00211   using Teuchos::RCP;
00212   using Teuchos::Tuple;
00213   using Teuchos::Comm;
00214   using Teuchos::null;
00215 
00216   using Teuchos::outArg;
00217   using Teuchos::tuple;
00218   using Teuchos::arcp;
00219   using Teuchos::rcp;
00220   using Teuchos::rcpFromRef;
00221   using Teuchos::rcp_const_cast;
00222   using Teuchos::av_reinterpret_cast;
00223   using Teuchos::arcp_reinterpret_cast;
00224 
00225   using Teuchos::typeName;
00226 
00227   using Teuchos::ParameterList;
00228   using Teuchos::parameterList;
00229   using Teuchos::sublist;
00230 #endif
00231 
00232   // Tpetra functor objects
00233   // inspired by SGI-specific project2nd, project1st
00234   template <class Arg1, class Arg2>
00235   class firstArg : std::binary_function<Arg1,Arg2,Arg1> {
00236     public:
00237     typedef Arg1 first_argument_type;
00238     typedef Arg2 second_argument_type;
00239     typedef Arg1 result_type;
00240     inline Arg1 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg1;}
00241   };
00242 
00243   template <class Arg1, class Arg2>
00244   class secondArg : std::binary_function<Arg1,Arg2,Arg2> {
00245     public:
00246     typedef Arg1 first_argument_type;
00247     typedef Arg2 second_argument_type;
00248     typedef Arg2 result_type;
00249     inline Arg2 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg2;}
00250   };
00251 
00252 } // end of Tpetra namespace
00253 
00254 
00256 namespace TpetraExamples {
00257 }
00258 
00259 namespace Tpetra {
00261   namespace RTI {
00262   }
00263 }
00264 
00265 namespace Tpetra {
00267   namespace Ext {
00268   }
00270   namespace MatrixMatrix {
00271   }
00272 }
00273 
00274 #endif // TPETRA_CONFIGDEFS_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines