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 #endif
00139 
00141 namespace Tpetra {
00142 
00150   typedef size_t global_size_t;
00151 
00153   enum LocalGlobal {
00154     LocallyReplicated,  
00155     GloballyDistributed 
00156   };
00157 
00159   enum LookupStatus {
00160     AllIDsPresent, 
00161     IDNotPresent   
00162   };
00163 
00165   enum ProfileType {
00166     StaticProfile,  
00167     DynamicProfile  
00168   };
00169 
00171   enum OptimizeOption {
00172     DoOptimizeStorage,   
00173     DoNotOptimizeStorage 
00174   };
00175 
00187   enum CombineMode {
00188     ADD,     
00189     INSERT,  
00190     REPLACE, 
00191     ABSMAX   
00192   };
00193 
00194   // import Teuchos memory management classes into Tpetra
00195 #ifndef __CUDACC__
00196   using Teuchos::ArrayRCP;
00197   using Teuchos::ArrayView;
00198   using Teuchos::Array;
00199   using Teuchos::OrdinalTraits;
00200   using Teuchos::ScalarTraits;
00201   using Teuchos::RCP;
00202   using Teuchos::Tuple;
00203   using Teuchos::Comm;
00204   using Teuchos::null;
00205 
00206   using Teuchos::outArg;
00207   using Teuchos::tuple;
00208   using Teuchos::arcp;
00209   using Teuchos::rcp;
00210   using Teuchos::rcpFromRef;
00211   using Teuchos::av_reinterpret_cast;
00212   using Teuchos::arcp_reinterpret_cast;
00213 
00214   using Teuchos::typeName;
00215 #endif
00216 
00217   // Tpetra functor objects
00218   // inspired by SGI-specific project2nd, project1st
00219   template <class Arg1, class Arg2>
00220   class firstArg : std::binary_function<Arg1,Arg2,Arg1> {
00221     public:
00222     typedef Arg1 first_argument_type;
00223     typedef Arg2 second_argument_type;
00224     typedef Arg1 result_type;
00225     inline Arg1 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg1;}
00226   };
00227 
00228   template <class Arg1, class Arg2>
00229   class secondArg : std::binary_function<Arg1,Arg2,Arg2> {
00230     public:
00231     typedef Arg1 first_argument_type;
00232     typedef Arg2 second_argument_type;
00233     typedef Arg2 result_type;
00234     inline Arg2 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg2;}
00235   };
00236 
00237 } // end of Tpetra namespace
00238 
00239 
00241 namespace TpetraExamples {
00242 }
00243 
00244 namespace Tpetra {
00246   namespace RTI {
00247   }
00248 }
00249 
00250 namespace Tpetra {
00252   namespace Ext {
00253   }
00255   namespace MatrixMatrix {
00256   }
00257 }
00258 
00259 #endif // TPETRA_CONFIGDEFS_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines