44#ifndef AMESOS2_TACHO_DECL_HPP
45#define AMESOS2_TACHO_DECL_HPP
47#include <Kokkos_Core.hpp>
50#include "Amesos2_SolverCore.hpp"
51#include "Amesos2_Tacho_FunctionMap.hpp"
54#include "Tacho_Solver.hpp"
65template <
class Matrix,
81 typedef typename super_type::scalar_type scalar_type;
82 typedef typename super_type::local_ordinal_type local_ordinal_type;
83 typedef typename super_type::global_size_type global_size_type;
92 typedef typename type_map::type tacho_type;
93 typedef typename type_map::magnitude_type magnitude_type;
98 typedef Tacho::ordinal_type ordinal_type;
99 typedef Tacho::size_type size_type;
101 typedef Kokkos::DefaultExecutionSpace exec_space_type;
102 typedef Kokkos::DefaultHostExecutionSpace host_exec_space_type;
105 Tacho::UseThisDevice<exec_space_type>::device_type device_type;
107 Tacho::UseThisDevice<host_exec_space_type>::device_type host_device_type;
109 typedef Kokkos::TaskScheduler<exec_space_type> scheduler_type;
111 typedef Kokkos::View<size_type*, device_type> device_size_type_array;
112 typedef Kokkos::View<ordinal_type*, device_type> device_ordinal_type_array;
113 typedef Kokkos::View<tacho_type*, device_type> device_value_type_array;
117 typedef Kokkos::View<size_type*, host_device_type> host_size_type_array;
118 typedef Kokkos::View<ordinal_type*, host_device_type> host_ordinal_type_array;
130 Teuchos::RCP<Vector> X,
131 Teuchos::RCP<const Vector> B);
182 int
solve_impl(const Teuchos::Ptr<MultiVecAdapter<Vector> > X,
183 const Teuchos::Ptr<const MultiVecAdapter<Vector> > B) const;
194 void setParameters_impl(
195 const Teuchos::RCP<Teuchos::ParameterList> & parameterList );
224 mutable struct TACHOData {
225 typename Tacho::Solver<tacho_type, scheduler_type> solver;
232 typedef typename Tacho::Solver<tacho_type, scheduler_type>::value_type_matrix
233 device_solve_array_t;
236 mutable device_solve_array_t workspace_;
239 mutable device_solve_array_t xValues_;
240 mutable device_solve_array_t bValues_;
243 device_value_type_array device_nzvals_view_;
246 host_size_type_array host_row_ptr_view_;
247 host_ordinal_type_array host_cols_view_;
253struct solver_traits<TachoSolver> {
254#ifdef HAVE_TEUCHOS_COMPLEX
255 typedef Meta::make_list6<float,
258 std::complex<double>,
259 Kokkos::complex<float>,
260 Kokkos::complex<double>
263 typedef Meta::make_list2<float,
269template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
270struct solver_supports_matrix<TachoSolver,
271 KokkosSparse::CrsMatrix<Scalar, LocalOrdinal, ExecutionSpace>> {
272 static const bool value =
true;
Provides access to interesting solver traits.
Amesos2::SolverCore: A templated interface for interaction with third-party direct sparse solvers.
Definition: Amesos2_SolverCore_decl.hpp:106
Interface to Amesos2 solver objects.
Definition: Amesos2_Solver_decl.hpp:78
Amesos2 interface to the Tacho package.
Definition: Amesos2_Tacho_decl.hpp:68
bool matrixShapeOK_impl() const
Determines whether the shape of the matrix is OK for this solver.
Definition: Amesos2_Tacho_def.hpp:205
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters_impl() const
Definition: Amesos2_Tacho_def.hpp:226
int numericFactorization_impl()
Tacho specific numeric factorization.
Definition: Amesos2_Tacho_def.hpp:111
int solve_impl(const Teuchos::Ptr< MultiVecAdapter< Vector > > X, const Teuchos::Ptr< const MultiVecAdapter< Vector > > B) const
Tacho specific solve.
Definition: Amesos2_Tacho_def.hpp:125
bool do_optimization() const
can we optimize size_type and ordinal_type for straight pass through
Definition: Amesos2_Tacho_def.hpp:245
std::string description() const
Returns a short description of this Solver.
Definition: Amesos2_Tacho_def.hpp:74
bool loadA_impl(EPhase current_phase)
Reads matrix data into internal structures.
Definition: Amesos2_Tacho_def.hpp:251
int symbolicFactorization_impl()
Perform symbolic factorization of the matrix using Tacho.
Definition: Amesos2_Tacho_def.hpp:90
int preOrdering_impl()
Performs pre-ordering on the matrix to increase efficiency.
Definition: Amesos2_Tacho_def.hpp:83
static const char * name
Name of this solver interface.
Definition: Amesos2_Tacho_decl.hpp:75
Passes functions to TPL functions based on type.
Definition: Amesos2_FunctionMap.hpp:77
Map types to solver-specific data-types and enums.
Definition: Amesos2_TypeMap.hpp:82