Tpetra_ExplicitInstantiationHelpers.hpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //                    Tpetra: Templated Petra Package
00005 //                 Copyright (2004) 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_EXPLICIT_INSTANTIATION_HELPERS_HPP
00030 #define TPETRA_EXPLICIT_INSTANTIATION_HELPERS_HPP
00031 
00038 #include "Tpetra_ConfigDefs.hpp"
00039 
00040 //
00041 // 2007/07/10: rabartl: NOTE: Semicolons must only be used at the lowest level
00042 // of final code to ensure that there will not be any empty semicolon lines
00043 // that might issue a compiler warning or error. In general, I like to define
00044 // macros that need a semicolon when you use them because my emacs mode will
00045 // then do the indentation correctly.  However, this is not a big deal since
00046 // these macros only get used in a final *.cpp file and at that point they are
00047 // only used once in the entire mostly empty file.
00048 //
00049 
00050 #ifdef HAVE_KOKKOS_THRUST
00051 #include <Kokkos_ThrustGPUNode.hpp>
00052 #  if defined(HAVE_KOKKOS_CUDA_FLOAT) && defined(HAVE_TPETRA_INST_FLOAT)
00053 #    define TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_FLOAT(LO,GO,INSTANT_MACRO)\
00054        INSTANT_MACRO(float,LO,GO,Kokkos::ThrustGPUNode)
00055 #  else
00056 #    define TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_FLOAT(LO,GO,INSTANT_MACRO)
00057 #  endif
00058 #  if defined(HAVE_KOKKOS_CUDA_DOUBLE) && defined(HAVE_TPETRA_INST_DOUBLE)
00059 #    define TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_DOUBLE(LO,GO,INSTANT_MACRO)\
00060        INSTANT_MACRO(double,LO,GO,Kokkos::ThrustGPUNode)
00061 #  else
00062 #    define TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_DOUBLE(LO,GO,INSTANT_MACRO)
00063 #  endif
00064 #  define TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_INT(LO,GO,INSTANT_MACRO)\
00065      INSTANT_MACRO(int,LO,GO,Kokkos::ThrustGPUNode)
00066 #else
00067 #  define TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_FLOAT(LO,GO,INSTANT_MACRO)
00068 #  define TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_DOUBLE(LO,GO,INSTANT_MACRO)
00069 #  define TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_INT(LO,GO,INSTANT_MACRO)
00070 #endif
00071 
00072 #define TPETRA_MACRO_TEMPLATE_INSTANT_ALL_SCALAR_THRUSTNODE(LO,GO,MACRO) \
00073   TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_FLOAT(LO,GO,MACRO) \
00074   TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_DOUBLE(LO,GO,MACRO) \
00075   TPETRA_MACRO_TEMPLATE_INSTANT_THRUST_INT(LO,GO,MACRO)
00076 
00078 #ifdef HAVE_KOKKOS_TBB
00079 #  include <Kokkos_TBBNode.hpp>
00080 #  define TPETRA_MACRO_TEMPLATE_INSTANT_TBBNODE(SCALAR,LO,GO,INSTANT_MACRO)\
00081      INSTANT_MACRO(SCALAR,LO,GO,Kokkos::TBBNode)
00082 #else
00083 #  define TPETRA_MACRO_TEMPLATE_INSTANT_TBBNODE(SCALAR,LO,GO,INSTANT_MACRO)
00084 #endif
00085 
00087 #ifdef HAVE_KOKKOS_THREADPOOL
00088 #  include <Kokkos_TPINode.hpp>
00089 #  define TPETRA_MACRO_TEMPLATE_INSTANT_TPINODE(SCALAR,LO,GO,INSTANT_MACRO)\
00090      INSTANT_MACRO(SCALAR,LO,GO,Kokkos::TPINode)
00091 #else
00092 #  define TPETRA_MACRO_TEMPLATE_INSTANT_TPINODE(SCALAR,LO,GO,INSTANT_MACRO)
00093 #endif
00094 
00096 #include <Kokkos_SerialNode.hpp>
00097 #define TPETRA_MACRO_TEMPLATE_INSTANT_SERIALNODE(SCALAR,LO,GO,INSTANT_MACRO)\
00098    INSTANT_MACRO(SCALAR,LO,GO,Kokkos::SerialNode)
00099 
00100 #define TPETRA_MACRO_TEMPLATE_INSTANT_ALL_CPUNODE(SCALAR,LO,GO,MACRO)\
00101   TPETRA_MACRO_TEMPLATE_INSTANT_SERIALNODE(SCALAR,LO,GO,MACRO)\
00102   TPETRA_MACRO_TEMPLATE_INSTANT_TPINODE(SCALAR,LO,GO,MACRO)\
00103   TPETRA_MACRO_TEMPLATE_INSTANT_TBBNODE(SCALAR,LO,GO,MACRO)
00104 
00105 #ifdef HAVE_TPETRA_INST_FLOAT
00106 # define TPETRA_MACRO_TEMPLATE_INSTANT_FLOAT_ALL_CPUNODE(LO,GO,MACRO)\
00107     TPETRA_MACRO_TEMPLATE_INSTANT_ALL_CPUNODE(float,LO,GO,MACRO)
00108 #else
00109 # define TPETRA_MACRO_TEMPLATE_INSTANT_FLOAT_ALL_CPUNODE(LO,GO,MACRO)
00110 #endif
00111 
00112 #ifdef HAVE_TPETRA_INST_DOUBLE
00113 # define TPETRA_MACRO_TEMPLATE_INSTANT_DOUBLE_ALL_CPUNODE(LO,GO,MACRO)\
00114     TPETRA_MACRO_TEMPLATE_INSTANT_ALL_CPUNODE(double,LO,GO,MACRO)
00115 #else
00116 # define TPETRA_MACRO_TEMPLATE_INSTANT_DOUBLE_ALL_CPUNODE(LO,GO,MACRO)
00117 #endif
00118 
00119 #ifdef HAVE_INST_TPETRA_COMPLEX_FLOAT
00120 # define TPETRA_MACRO_TEMPLATE_INSTANT_COMPLEX_FLOAT_ALL_CPUNODE(LO,GO,MACRO)\
00121     TPETRA_MACRO_TEMPLATE_INSTANT_ALL_CPUNODE(std::complex<float>,LO,GO,MACRO)
00122 #else
00123 # define TPETRA_MACRO_TEMPLATE_INSTANT_COMPLEX_FLOAT_ALL_CPUNODE(LO,GO,MACRO)
00124 #endif
00125 
00126 #ifdef HAVE_INST_TPETRA_COMPLEX_DOUBLE
00127 # define TPETRA_MACRO_TEMPLATE_INSTANT_COMPLEX_DOUBLE_ALL_CPUNODE(LO,GO,MACRO)\
00128     TPETRA_MACRO_TEMPLATE_INSTANT_ALL_CPUNODE(std::complex<double>,LO,GO,MACRO)
00129 #else
00130 # define TPETRA_MACRO_TEMPLATE_INSTANT_COMPLEX_DOUBLE_ALL_CPUNODE(LO,GO,MACRO)
00131 #endif
00132 
00133 #define TPETRA_MACRO_TEMPLATE_INSTANT_ALL_SCALAR_CPUNODE(LO,GO,MACRO)\
00134   TPETRA_MACRO_TEMPLATE_INSTANT_FLOAT_ALL_CPUNODE(LO,GO,MACRO)\
00135   TPETRA_MACRO_TEMPLATE_INSTANT_DOUBLE_ALL_CPUNODE(LO,GO,MACRO)\
00136   TPETRA_MACRO_TEMPLATE_INSTANT_COMPLEX_FLOAT_ALL_CPUNODE(LO,GO,MACRO)\
00137   TPETRA_MACRO_TEMPLATE_INSTANT_COMPLEX_DOUBLE_ALL_CPUNODE(LO,GO,MACRO)\
00138   TPETRA_MACRO_TEMPLATE_INSTANT_ALL_CPUNODE(int,LO,GO,MACRO)
00139 
00141 #define TPETRA_MACRO_TEMPLATE_INSTANT_ALL_SCALAR_NODE(LO,GO,MACRO)\
00142   TPETRA_MACRO_TEMPLATE_INSTANT_ALL_SCALAR_THRUSTNODE(LO,GO,MACRO)\
00143   TPETRA_MACRO_TEMPLATE_INSTANT_ALL_SCALAR_CPUNODE(LO,GO,MACRO)
00144 
00147 #define TPETRA_MACRO_TEMPLATE_INSTANT_ALL_SCALAR_ORDINAL_NODES(MACRO)\
00148   TPETRA_MACRO_TEMPLATE_INSTANT_ALL_SCALAR_NODE(short,int,MACRO)\
00149   TPETRA_MACRO_TEMPLATE_INSTANT_ALL_SCALAR_NODE(int,int,MACRO)
00150 
00151 #endif  // TPETRA_EXPLICIT_INSTANTIATION_HELPERS_HPP

Generated on Tue Jul 13 09:39:06 2010 for Tpetra Matrix/Vector Services by  doxygen 1.4.7