PARALUTION  1.0.0
PARALUTION
mixed_precision.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_MIXED_PRECISION_HPP_
2 #define PARALUTION_MIXED_PRECISION_HPP_
3 
4 #include "solver.hpp"
5 
6 namespace paralution {
7 
8 template <class OperatorTypeH, class VectorTypeH, typename ValueTypeH,
9  class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
10 class MixedPrecisionDC : public IterativeLinearSolver<OperatorTypeH, VectorTypeH, ValueTypeH> {
11 
12 public:
13 
15  virtual ~MixedPrecisionDC();
16 
17  virtual void Print(void) const;
18 
20 
21  virtual void Build(void);
22  virtual void Clear(void);
23 
24 protected:
25 
26  virtual void SolveNonPrecond_(const VectorTypeH &rhs,
27  VectorTypeH *x);
28  virtual void SolvePrecond_(const VectorTypeH &rhs,
29  VectorTypeH *x);
30 
31  virtual void PrintStart_(void) const;
32  virtual void PrintEnd_(void) const;
33 
34  virtual void MoveToHostLocalData_(void);
35  virtual void MoveToAcceleratorLocalData_(void);
36 
37 private:
38 
40 
41  VectorTypeH r_h_;
42  VectorTypeL r_l_;
43 
44  VectorTypeH *x_h_;
45  VectorTypeL d_l_;
46  VectorTypeH d_h_;
47 
48  const OperatorTypeH *op_h_;
49  OperatorTypeL *op_l_;
50 
51 };
52 
53 
54 }
55 
56 #endif // PARALUTION_MIXED_PRECISION_HPP_
virtual void PrintStart_(void) const
Print starting msg of the solver.
Definition: mixed_precision.cpp:77
void Set(Solver< OperatorTypeL, VectorTypeL, ValueTypeL > &Solver_L)
Definition: mixed_precision.cpp:44
VectorTypeH * x_h_
Definition: mixed_precision.hpp:44
virtual ~MixedPrecisionDC()
Definition: mixed_precision.cpp:32
Base class for all linear (iterative) solvers.
Definition: solver.hpp:94
virtual void Clear(void)
Clear (free all local data) the solver.
Definition: mixed_precision.cpp:173
VectorTypeH d_h_
Definition: mixed_precision.hpp:46
virtual void MoveToHostLocalData_(void)
Move all local data to the host.
Definition: mixed_precision.cpp:207
virtual void Print(void) const
Print information about the solver.
Definition: mixed_precision.cpp:57
VectorTypeL d_l_
Definition: mixed_precision.hpp:45
virtual void SolvePrecond_(const VectorTypeH &rhs, VectorTypeH *x)
Preconditioned solution procedure.
Definition: mixed_precision.cpp:311
Solver< OperatorTypeL, VectorTypeL, ValueTypeL > * Solver_L_
Definition: mixed_precision.hpp:39
VectorTypeL r_l_
Definition: mixed_precision.hpp:42
Definition: mixed_precision.hpp:10
virtual void Build(void)
Build the solver (data allocation, structure computation, numerical computation)
Definition: mixed_precision.cpp:99
virtual void SolveNonPrecond_(const VectorTypeH &rhs, VectorTypeH *x)
Non-preconditioner solution procedure.
Definition: mixed_precision.cpp:233
Definition: backend_manager.cpp:43
MixedPrecisionDC()
Definition: mixed_precision.cpp:19
const IndexType const IndexType const IndexType const ValueType const ValueType const ValueType * x
Definition: cuda_kernels_coo.hpp:91
virtual void MoveToAcceleratorLocalData_(void)
Move all local data to the accelerator.
Definition: mixed_precision.cpp:220
virtual void PrintEnd_(void) const
Print ending msg of the solver.
Definition: mixed_precision.cpp:90
VectorTypeH r_h_
Definition: mixed_precision.hpp:41
OperatorTypeL * op_l_
Definition: mixed_precision.hpp:49
const OperatorTypeH * op_h_
Definition: mixed_precision.hpp:48