Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_Basker_FunctionMap.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Amesos2: Templated Direct Sparse Solver Package
4 //
5 // Copyright 2011 NTESS and the Amesos2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
19 #ifndef AMESOS2_BASKER_FUNCTIONMAP_HPP
20 #define AMESOS2_BASKER_FUNCTIONMAP_HPP
21 
22 #ifdef HAVE_TEUCHOS_COMPLEX
23 #include <complex>
24 #endif
25 
26 #include "Amesos2_FunctionMap.hpp"
28 #include "basker_decl.hpp"
29 #include "basker_def.hpp"
30 
31 namespace Amesos2 {
32 
33 #ifdef HAVE_TEUCHOS_COMPLEX
34  template <>
35  struct FunctionMap<Basker,Kokkos::complex<double>>
36  {
37  static std::complex<double> * convert_scalar(Kokkos::complex<double> * pData) {
38  return reinterpret_cast<std::complex<double> *>(pData);
39  }
40  };
41 
42 #endif // HAVE_TEUCHOS_COMPLEX
43 
44  // if not specialized, then assume generic conversion is fine
45  template <typename scalar_t>
46  struct FunctionMap<Basker,scalar_t>
47  {
48  static scalar_t * convert_scalar(scalar_t * pData) {
49  return pData; // no conversion necessary
50  }
51  };
52 
53 } // end namespace Amesos2
54 
55 #endif // AMESOS2_BASKER_FUNCTIONMAP_HPP
Provides definition of Basker types.
Declaration of Function mapping class for Amesos2.