CHROMA
quda_predictor.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Pick channel for QUDA Predictor
4  *
5  * Predictors for HMC
6  */
7 
8 #ifndef __quda_predictor_h__
9 #define __quda_predictor_h__
10 
11 #include "chromabase.h"
14 #include "quda.h"
16 
17 namespace Chroma
18 {
19 
20  /*! @ingroup predictor */
21  namespace QUDA4DChronoPredictorEnv
22  {
23  extern const std::string name;
24  bool registerAll();
26  }
27 
28  //! Zero initial guess predictor
29  /*! @ingroup predictor */
31  public AbsTwoStepChronologicalPredictor4D<LatticeFermion>
32  {
33  public:
34  QUDA4DChronoPredictor(int max_chrono, QudaPrecisionType prec) :
35  _max_chrono(max_chrono), _prec(prec) {
36  // Check Static Channel IDs:
39  QDPIO::cout << "Initing QUDAChrono Predictor with Channel IDs (X , Y)=("
40  << _X_index <<" , " << _Y_index << ") with max_chrono = "
41  << _max_chrono << std::endl;
42  }
43 
44  // Destructor is automagic
46 
47  // Zero out psi -- it is a zero guess after all
48  void predictX(LatticeFermion& X,
50  const LatticeFermion& chi) override
51  {
52  START_CODE();
53  QDPIO::cout << "This is a special interface to use QUDA's predictor\n";
54  QDPIO::cout << "predictX will return Zero\n";
55  X = zero;
56  END_CODE();
57  }
58 
59  void predictY(LatticeFermion& Y,
61  const LatticeFermion& chi) override
62  {
63  START_CODE();
64  QDPIO::cout << "This is a special interface to use QUDA's predictor\n";
65  QDPIO::cout << "predictX will return Zero\n";
66  Y = zero;
67  END_CODE();
68  }
69 
70 
71 
72  // No internal state so reset is a nop
73  void reset(void) override {
74  // Reset /flush an individual channel
75  flushChronoQuda( getXIndex() );
76  flushChronoQuda( getYIndex() );
77  }
78 
79  // Ignore new std::vector
80  void newXVector(const LatticeFermion& psi) override {
81  QDPIO::cout << "QUDAPredictor: registering new X solution (not)" << std::endl;
82  }
83 
84  void newYVector(const LatticeFermion& psi) override {
85  QDPIO::cout << "QUDAPredictor: registering new Y solution (not)" << std::endl;
86  }
87 
88 
89  inline
90  int getXIndex() const {
91  return _X_index;
92  }
93 
94  inline
95  int getYIndex() const {
96  return _Y_index;
97  }
98 
99  inline
100  int getMaxChrono() const {
101  return _max_chrono;
102  }
103 
104  inline
106  return _prec;
107  }
108  private:
109  int _X_index;
110  int _Y_index;
113  };
114 
115 } // End Namespace Chroma
116 
117 #endif
Primary include file for CHROMA library code.
Chronological predictor for HMC.
Monomial factories.
Abstract interface for a Chronological Solution predictor.
Zero initial guess predictor.
QudaPrecisionType getChronoPrecision() const
QUDA4DChronoPredictor(int max_chrono, QudaPrecisionType prec)
void newYVector(const LatticeFermion &psi) override
void predictY(LatticeFermion &Y, const LinearOperator< LatticeFermion > &A, const LatticeFermion &chi) override
void predictX(LatticeFermion &X, const LinearOperator< LatticeFermion > &A, const LatticeFermion &chi) override
void newXVector(const LatticeFermion &psi) override
void reset(void) override
QudaPrecisionType
Quda Precision type.
Definition: enum_quda_io.h:50
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
START_CODE()
A(A, psi, r, Ncb, PLUS)
Double zero
Definition: invbicg.cc:106
::std::string string
Definition: gtest.h:1979