CHROMA
enum_quda_io.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief QUDA enum readers
4  */
5 
7 #include <string>
8 
9 namespace Chroma {
10 
11  namespace QudaSolverTypeEnv {
12  bool registerAll(void)
13  {
14  bool success;
15  success = theQudaSolverTypeMap::Instance().registerPair(std::string("CG"),CG);
16  success &= theQudaSolverTypeMap::Instance().registerPair(std::string("BICGSTAB"),BICGSTAB);
17  success &= theQudaSolverTypeMap::Instance().registerPair(std::string("GCR"),GCR);
18  success &= theQudaSolverTypeMap::Instance().registerPair(std::string("CA_GCR"),CA_GCR);
19  success &= theQudaSolverTypeMap::Instance().registerPair(std::string("MR"),MR);
20 
21  success &= (theChromaToQudaSolverTypeMap::Instance())[CG] = QUDA_CG_INVERTER;
22  success &= (theChromaToQudaSolverTypeMap::Instance())[BICGSTAB] = QUDA_BICGSTAB_INVERTER;
23  success &= (theChromaToQudaSolverTypeMap::Instance())[GCR] = QUDA_GCR_INVERTER;
24  success &= (theChromaToQudaSolverTypeMap::Instance())[CA_GCR] = QUDA_CA_GCR_INVERTER;
25  success &= (theChromaToQudaSolverTypeMap::Instance())[MR] = QUDA_MR_INVERTER;
26  return success;
27  }
28  const std::string typeIDString = "QudaSolverType";
30  }
31 
32  //! Read an QudaSolverType enum
33  void read(XMLReader& xml_in, const std::string& path, QudaSolverType& t)
34  {
36  }
37 
38  //! Write an QudaSolverType enum
39  void write(XMLWriter& xml_out, const std::string& path, const QudaSolverType& t)
40  {
42  }
43 
44  namespace QudaPrecisionTypeEnv {
45  bool registerAll(void)
46  {
47  bool success;
48  success = theQudaPrecisionTypeMap::Instance().registerPair(std::string("DEFAULT"),DEFAULT);
49  success &= theQudaPrecisionTypeMap::Instance().registerPair(std::string("QUARTER"),QUARTER);
50  success &= theQudaPrecisionTypeMap::Instance().registerPair(std::string("HALF"),HALF);
51  success &= theQudaPrecisionTypeMap::Instance().registerPair(std::string("SINGLE"),SINGLE);
52  success &= theQudaPrecisionTypeMap::Instance().registerPair(std::string("DOUBLE"),DOUBLE);
53 
54 
55  success &= (theChromaToQudaPrecisionTypeMap::Instance())[QUARTER] = QUDA_QUARTER_PRECISION;
56  success &= (theChromaToQudaPrecisionTypeMap::Instance())[HALF] = QUDA_HALF_PRECISION;
57  success &= (theChromaToQudaPrecisionTypeMap::Instance())[SINGLE] = QUDA_SINGLE_PRECISION;
58  success &= (theChromaToQudaPrecisionTypeMap::Instance())[DOUBLE] = QUDA_DOUBLE_PRECISION;
59  return success;
60  }
61  const std::string typeIDString = "QudaPrecisionType";
63  }
64 
65 
66  //! Read an QudaSolverType enum
67  void read(XMLReader& xml_in, const std::string& path, QudaPrecisionType& t)
68  {
70  }
71 
72  //! Write an QudaSolverType enum
73  void write(XMLWriter& xml_out, const std::string& path, const QudaPrecisionType& t)
74  {
76  }
77 
78  namespace QudaReconsTypeEnv {
79  bool registerAll(void)
80  {
81  bool success;
82  success = theQudaReconsTypeMap::Instance().registerPair(std::string("RECONS_NONE"),RECONS_NONE);
83  success &= theQudaReconsTypeMap::Instance().registerPair(std::string("RECONS_8"),RECONS_8);
84  success &= theQudaReconsTypeMap::Instance().registerPair(std::string("RECONS_12"),RECONS_12);
85 
86 
87  success &= (theChromaToQudaReconsTypeMap::Instance())[RECONS_NONE] = QUDA_RECONSTRUCT_NO;
88  success &= (theChromaToQudaReconsTypeMap::Instance())[RECONS_8] = QUDA_RECONSTRUCT_8;
89  success &= (theChromaToQudaReconsTypeMap::Instance())[RECONS_12] = QUDA_RECONSTRUCT_12;
90 
91  return success;
92  }
93  const std::string typeIDString = "QudaReconsType";
95  }
96 
97  //! Read an QudaSolverType enum
98  void read(XMLReader& xml_in, const std::string& path, QudaReconsType& t)
99  {
101  }
102 
103  //! Write an QudaSolverType enum
104  void write(XMLWriter& xml_out, const std::string& path, const QudaReconsType& t)
105  {
107  }
108 
109  namespace QudaSchwarzMethodEnv {
110  bool registerAll(void)
111  {
112  bool success;
113  success = theQudaSchwarzMethodMap::Instance().registerPair(std::string("ADDITIVE_SCHWARZ"),ADDITIVE_SCHWARZ);
114  success &= theQudaSchwarzMethodMap::Instance().registerPair(std::string("MULTIPLICATIVE_SCHWARZ"),MULTIPLICATIVE_SCHWARZ);
115 
116  success &= theChromaToQudaSchwarzTypeMap::Instance()[INVALID_SCHWARZ] = QUDA_INVALID_SCHWARZ;
117  success &= theChromaToQudaSchwarzTypeMap::Instance()[ADDITIVE_SCHWARZ] = QUDA_ADDITIVE_SCHWARZ;
118  success &= theChromaToQudaSchwarzTypeMap::Instance()[MULTIPLICATIVE_SCHWARZ] = QUDA_MULTIPLICATIVE_SCHWARZ;
119  return success;
120  }
121  const std::string typeIDString = "QudaSchwarzMethod";
123  }
124 
125  //! Read an QudaSolverType enum
126  void read(XMLReader& xml_in, const std::string& path, QudaSchwarzMethod& t)
127  {
129  }
130 
131  //! Write an QudaSolverType enum
132  void write(XMLWriter& xml_out, const std::string& path, const QudaSchwarzMethod& t)
133  {
135  }
136 
137 
138 
139 
140 
141 }
static T & Instance()
Definition: singleton.h:432
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
QudaSolverType
Quda Solver type.
Definition: enum_quda_io.h:21
QudaSchwarzMethod
Definition: enum_quda_io.h:101
QudaReconsType
Quda Gauge Reconstruct type.
Definition: enum_quda_io.h:77
QudaPrecisionType
Quda Precision type.
Definition: enum_quda_io.h:50
int t
Definition: meslate.cc:37
const std::string typeIDString
Definition: enum_quda_io.cc:61
const std::string typeIDString
Definition: enum_quda_io.cc:93
const std::string typeIDString
const std::string typeIDString
Definition: enum_quda_io.cc:28
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
@ ADDITIVE_SCHWARZ
Definition: enum_quda_io.h:103
@ INVALID_SCHWARZ
Definition: enum_quda_io.h:102
@ MULTIPLICATIVE_SCHWARZ
Definition: enum_quda_io.h:104
@ RECONS_12
Definition: enum_quda_io.h:80
@ RECONS_NONE
Definition: enum_quda_io.h:78
@ RECONS_8
Definition: enum_quda_io.h:79
::std::string string
Definition: gtest.h:1979