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 
00178   enum EPrivateComputeViewConstructor {
00179     COMPUTE_VIEW_CONSTRUCTOR
00180   };
00181 
00182   enum EPrivateHostViewConstructor {
00183     HOST_VIEW_CONSTRUCTOR
00184   };
00185 
00186   // import Teuchos memory management classes into Tpetra
00187 //#ifndef __CUDACC__
00188   using Teuchos::ArrayRCP;
00189   using Teuchos::ArrayView;
00190   using Teuchos::Array;
00191   using Teuchos::OrdinalTraits;
00192   using Teuchos::ScalarTraits;
00193   using Teuchos::RCP;
00194   using Teuchos::Tuple;
00195   using Teuchos::Comm;
00196   using Teuchos::null;
00197 
00198   using Teuchos::outArg;
00199   using Teuchos::tuple;
00200   using Teuchos::arcp;
00201   using Teuchos::rcp;
00202   using Teuchos::rcpFromRef;
00203   using Teuchos::rcp_const_cast;
00204   using Teuchos::av_reinterpret_cast;
00205   using Teuchos::arcp_reinterpret_cast;
00206 
00207   using Teuchos::typeName;
00208 
00209   using Teuchos::ParameterList;
00210   using Teuchos::parameterList;
00211   using Teuchos::sublist;
00212 //#endif
00213 
00230   template<class Arg1, class Arg2>
00231   class project1st : public std::binary_function<Arg1, Arg2, Arg1> {
00232   public:
00233     typedef Arg1 first_argument_type;
00234     typedef Arg2 second_argument_type;
00235     typedef Arg1 result_type;
00236     Arg1 operator () (const Arg1& x, const Arg2& ) const {
00237       return x;
00238     }
00239   };
00240 
00256   template<class Arg1, class Arg2>
00257   class project2nd : public std::binary_function<Arg1, Arg2, Arg2> {
00258   public:
00259     typedef Arg1 first_argument_type;
00260     typedef Arg2 second_argument_type;
00261     typedef Arg2 result_type;
00262     Arg2 operator () (const Arg1& , const Arg2& y) const {
00263       return y;
00264     }
00265   };
00266 
00269   template <class Arg1, class Arg2>
00270   class TEUCHOS_DEPRECATED firstArg : std::binary_function<Arg1,Arg2,Arg1> {
00271     public:
00272     typedef Arg1 first_argument_type;
00273     typedef Arg2 second_argument_type;
00274     typedef Arg1 result_type;
00275     inline Arg1 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg1;}
00276   };
00277 
00280   template <class Arg1, class Arg2>
00281   class TEUCHOS_DEPRECATED secondArg : std::binary_function<Arg1,Arg2,Arg2> {
00282     public:
00283     typedef Arg1 first_argument_type;
00284     typedef Arg2 second_argument_type;
00285     typedef Arg2 result_type;
00286     inline Arg2 operator()(const Arg1 &arg1, const Arg2 &arg2) {return arg2;}
00287   };
00288 
00289 } // end of Tpetra namespace
00290 
00291 
00292 // We include this after the above Tpetra namespace declaration,
00293 // so that we don't interfere with Doxygen's ability to find the
00294 // Tpetra namespace declaration.
00295 #include <Tpetra_CombineMode.hpp>
00296 
00297 
00299 namespace TpetraExamples {
00300 }
00301 
00302 namespace Tpetra {
00304   namespace RTI {
00305   }
00306 }
00307 
00308 namespace Tpetra {
00310   namespace Ext {
00311   }
00312 
00318   namespace MatrixMatrix {
00319   }
00320 }
00321 
00322 namespace Tpetra {
00324   enum ESweepDirection {
00325     Forward = 0,
00326     Backward,
00327     Symmetric
00328   };
00329 }
00330 
00331 #if defined(HAVE_TPETRA_KOKKOSCORE) && defined(HAVE_TPETRA_KOKKOSCOMPAT) && defined(TPETRA_ENABLE_KOKKOS_DISTOBJECT)
00332 #define TPETRA_USE_KOKKOS_DISTOBJECT 1
00333 #else
00334 #define TPETRA_USE_KOKKOS_DISTOBJECT 0
00335 #endif
00336 
00337 #endif // TPETRA_CONFIGDEFS_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines