Amesos2 - Direct Sparse Solver Interfaces Version of the Day
Amesos2_ShyLUBasker_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_SHYLUBASKER_FUNCTIONMAP_HPP
20#define AMESOS2_SHYLUBASKER_FUNCTIONMAP_HPP
21
22#ifdef HAVE_TEUCHOS_COMPLEX
23#include <complex>
24#endif
25
28
29//#include "shylubasker_decl.hpp"
30//#include "shylubasker_def.hpp"
31//#include "shylubasker_trilinos_decl.hpp"
32
33namespace Amesos2 {
34
35 /* ==================== Specializations ====================
36 *
37 * \cond ShyLUBasker_function_specializations
38 */
39
44#ifdef HAVE_TEUCHOS_INST_COMPLEX_DOUBLE
45 template <>
46 struct FunctionMap<ShyLUBasker,Kokkos::complex<double>>
47 {
48 static std::complex<double> * convert_scalar(Kokkos::complex<double> * pData) {
49 return reinterpret_cast<std::complex<double> *>(pData);
50 }
51 };
52#endif // HAVE_TEUCHOS_COMPLEX_DOUBLE
53
54#ifdef HAVE_TEUCHOS_INST_COMPLEX_FLOAT
55 template <>
56 struct FunctionMap<ShyLUBasker,Kokkos::complex<float>>
57 {
58 static std::complex<float> * convert_scalar(Kokkos::complex<float> * pData) {
59 return reinterpret_cast<std::complex<float> *>(pData);
60 }
61 };
62#endif // HAVE_TEUCHOS_INST_COMPLEX_FLOAT
63
64 // if not specialized, then assume generic conversion is fine
65 template <typename scalar_t>
66 struct FunctionMap<ShyLUBasker,scalar_t>
67 {
68 static scalar_t * convert_scalar(scalar_t * pData) {
69 return pData; // no conversion necessary
70 }
71 };
72
73
74 /* \endcond ShyLUBasker_function_specializations */
75
76
77} // end namespace Amesos2
78
79#endif // AMESOS2_SHYLUBASKER_FUNCTIONMAP_HPP
Declaration of Function mapping class for Amesos2.
Provides definition of ShyLUBasker types as well as conversions and type traits.