CHROMA
quda_predictor.cc
Go to the documentation of this file.
1 #include "chromabase.h"
3 
4 
5 namespace Chroma
6 {
7 
8  namespace QUDA4DChronoPredictorEnv
9  {
10  namespace
11  {
12  // Create a new 4D Zero Guess Predictor
13  // No params to read -- but preserve form
14  AbsChronologicalPredictor4D<LatticeFermion>* createPredictor(XMLReader& xml,
15  const std::string& path) {
16  unsigned int max_chrono = 1;
18 
19  try {
20 
21  XMLReader paramtop(xml, path);
22  read( paramtop, "./MaxChrono", max_chrono);
23  if ( paramtop.count("./Precision") == 1) {
24  read(paramtop, "./Precision", prec);
25  }
26  }
27  catch( const std::string& e ) {
28  QDPIO::cerr << "Caught exception reading XML: " << e << std::endl;
29  QDP_abort(1);
30  }
31 
32  // No params to read
33  return new QUDA4DChronoPredictor(max_chrono,prec);
34  }
35 
36  //! Local registration flag
37  bool registered = false;
38 
39  //! Local Chrono index
40  int chrono_index = 0;
41 
42  }
43 
44  const std::string name = "QUDA_4D_PREDICTOR";
45 
47  {
48  int ret_val = chrono_index;
49  ++chrono_index;
50  return ret_val;
51  }
52 
53  //! Register all the factories
54  bool registerAll()
55  {
56  bool success = true;
57  if (! registered)
58  {
59  success &= The4DChronologicalPredictorFactory::Instance().registerObject(name, createPredictor);
60  registered = true;
61  }
62  return success;
63  }
64 
65  }
66 }
Primary include file for CHROMA library code.
Zero initial guess predictor.
static T & Instance()
Definition: singleton.h:432
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
QudaPrecisionType
Quda Precision type.
Definition: enum_quda_io.h:50
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979
Pick channel for QUDA Predictor.