Tpetra Matrix/Vector Services Version of the Day
Tpetra_CrsMatrixSolveOp.cpp
00001 /*
00002 // @HEADER
00003 // ***********************************************************************
00004 // 
00005 //          Tpetra: Templated Linear Algebra Services Package
00006 //                 Copyright (2008) Sandia Corporation
00007 // 
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 // 
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00039 // 
00040 // ************************************************************************
00041 // @HEADER
00042 */
00043 
00044 #include "Tpetra_CrsMatrixSolveOp.hpp"
00045 
00046 #ifdef HAVE_TPETRA_EXPLICIT_INSTANTIATION
00047 
00048 #include "Tpetra_CrsMatrixSolveOp_def.hpp"
00049 // need this to instantiate CrsMatrix::solve()
00050 #include "Tpetra_CrsMatrix_def.hpp"
00051 
00052 #include <Kokkos_SerialNode.hpp>
00053 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00054 #  include <Kokkos_TBBNode.hpp>
00055 #endif
00056 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00057 #  include <Kokkos_TPINode.hpp>
00058 #endif
00059 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00060 #  include <Kokkos_OpenMPNode.hpp>
00061 #endif
00062 #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE)
00063 #  include <Kokkos_ThrustGPUNode.hpp>
00064 #endif
00065 
00066 namespace Tpetra {
00067 
00068   //
00069   // instantiate all single-scalar implementations; these are needed internally by CrsMatrix
00070   //
00071 
00072 #if defined(HAVE_TPETRA_INST_DOUBLE)
00073   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,int,Kokkos::SerialNode)
00074 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00075   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,int,Kokkos::TBBNode)
00076 #endif
00077 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00078     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,int,Kokkos::TPINode)
00079 #endif
00080 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00081     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,int,Kokkos::OpenMPNode)
00082 #endif
00083 #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_DOUBLE)
00084     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,int,Kokkos::ThrustGPUNode)
00085 #endif
00086 #endif // double
00087 #if defined(HAVE_TPETRA_INST_FLOAT)
00088   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,int,Kokkos::SerialNode)
00089 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00090   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,int,Kokkos::TBBNode)
00091 #endif
00092 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00093     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,int,Kokkos::TPINode)
00094 #endif
00095 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00096     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,int,Kokkos::OpenMPNode)
00097 #endif
00098 #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_FLOAT)
00099     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,int,Kokkos::ThrustGPUNode)
00100 #endif 
00101 #endif // float
00102 #if defined(HAVE_TPETRA_INST_COMPLEX_DOUBLE)
00103   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,int,Kokkos::SerialNode)
00104 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00105   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,int,Kokkos::TBBNode)
00106 #endif
00107 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00108     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,int,Kokkos::TPINode)
00109 #endif
00110 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00111     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,int,Kokkos::OpenMPNode)
00112 #endif
00113 // not yet supported
00114 // #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_COMPLEX_DOUBLE)
00115 //     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,int,Kokkos::ThrustGPUNode)
00116 // #endif
00117 #endif // complex double
00118 #if defined(HAVE_TPETRA_INST_COMPLEX_FLOAT)
00119   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,int,Kokkos::SerialNode)
00120 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00121   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,int,Kokkos::TBBNode)
00122 #endif
00123 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00124     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,int,Kokkos::TPINode)
00125 #endif
00126 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00127     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,int,Kokkos::OpenMPNode)
00128 #endif
00129 // not yet supported
00130 // #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_COMPLEX_FLOAT)
00131 //     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,int,Kokkos::ThrustGPUNode)
00132 // #endif
00133 #endif // complex float
00134 
00135 #ifdef HAVE_TPETRA_INST_INT_LONG
00136 #if defined(HAVE_TPETRA_INST_DOUBLE)
00137   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,long,Kokkos::SerialNode)
00138 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00139   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,long,Kokkos::TBBNode)
00140 #endif
00141 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00142     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,long,Kokkos::TPINode)
00143 #endif
00144 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00145     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,long,Kokkos::OpenMPNode)
00146 #endif
00147 #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_DOUBLE)
00148     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,double,int,long,Kokkos::ThrustGPUNode)
00149 #endif
00150 #endif // double
00151 #if defined(HAVE_TPETRA_INST_FLOAT)
00152   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,long,Kokkos::SerialNode)
00153 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00154   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,long,Kokkos::TBBNode)
00155 #endif
00156 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00157     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,long,Kokkos::TPINode)
00158 #endif
00159 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00160     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,long,Kokkos::OpenMPNode)
00161 #endif
00162 #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_FLOAT)
00163     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,float,int,long,Kokkos::ThrustGPUNode)
00164 #endif 
00165 #endif // float
00166 #if defined(HAVE_TPETRA_INST_COMPLEX_DOUBLE)
00167   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,long,Kokkos::SerialNode)
00168 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00169   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,long,Kokkos::TBBNode)
00170 #endif
00171 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00172     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,long,Kokkos::TPINode)
00173 #endif
00174 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00175     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,long,Kokkos::OpenMPNode)
00176 #endif
00177 // not yet supported
00178 // #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_COMPLEX_DOUBLE)
00179 //     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<double>,std::complex<double>,int,long,Kokkos::ThrustGPUNode)
00180 // #endif
00181 #endif // complex double
00182 #if defined(HAVE_TPETRA_INST_COMPLEX_FLOAT)
00183   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,long,Kokkos::SerialNode)
00184 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00185   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,long,Kokkos::TBBNode)
00186 #endif
00187 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00188     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,long,Kokkos::TPINode)
00189 #endif
00190 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00191     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,long,Kokkos::OpenMPNode)
00192 #endif
00193 // not yet supported
00194 // #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_COMPLEX_FLOAT)
00195 //     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(std::complex<float>,std::complex<float>,int,long,Kokkos::ThrustGPUNode)
00196 // #endif
00197 #endif // complex float
00198 #endif // <int,long>
00199 
00200 
00201   // get all cross scalar applications
00202   // double x float
00203 #if defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_FLOAT)
00204   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,float,int,int,Kokkos::SerialNode)
00205   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,double,int,int,Kokkos::SerialNode)
00206 #if defined(HAVE_KOKKOSCLASSIC_TBB)
00207   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,float,int,int,Kokkos::TBBNode)
00208   TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,double,int,int,Kokkos::TBBNode)
00209 #endif
00210 #if defined(HAVE_KOKKOSCLASSIC_THREADPOOL)
00211     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,float,int,int,Kokkos::TPINode)
00212     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,double,int,int,Kokkos::TPINode)
00213 #endif
00214 #if defined(HAVE_KOKKOSCLASSIC_OPENMP)
00215     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,float,int,int,Kokkos::OpenMPNode)
00216     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,double,int,int,Kokkos::OpenMPNode)
00217 #endif
00218 #if defined(HAVE_KOKKOSCLASSIC_CUSPARSE) && defined(HAVE_KOKKOSCLASSIC_CUDA_FLOAT) && defined(HAVE_KOKKOSCLASSIC_CUDA_DOUBLE)
00219     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(double,float,int,int,Kokkos::ThrustGPUNode)
00220     TPETRA_CRSMATRIX_SOLVEOP_INSTANT(float,double,int,int,Kokkos::ThrustGPUNode)
00221 #endif
00222 #endif
00223 
00224 } // namespace Tpetra
00225 
00226 #endif // HAVE_TPETRA_EXPLICIT_INSTANTIATION
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines