QUDA  v0.5.0
A library for QCD on GPUs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
quda.h
Go to the documentation of this file.
1 #ifndef _QUDA_H
2 #define _QUDA_H
3 
12 #include <enum_quda.h>
13 #include <stdio.h> /* for FILE */
14 
15 #define QUDA_VERSION_MAJOR 0
16 #define QUDA_VERSION_MINOR 5
17 #define QUDA_VERSION_SUBMINOR 0
18 
23 #define QUDA_VERSION ((QUDA_VERSION_MAJOR<<16) | (QUDA_VERSION_MINOR<<8) | QUDA_VERSION_SUBMINOR)
24 
25 
31 #define QUDA_MAX_DIM 5
32 
38 #define QUDA_MAX_MULTI_SHIFT 32
39 
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
49  typedef struct QudaGaugeParam_s {
50 
51  int X[4];
52 
53  double anisotropy;
54  double tadpole_coeff;
58 
60 
62 
65 
68 
71 
73 
74  int ga_pad;
75 
78 
79  int staple_pad;
81  int mom_ga_pad;
82  double gaugeGiB;
83 
87 
88 
92  typedef struct QudaInvertParam_s {
93 
99 
100  double mass;
101  double kappa;
103  double m5;
104  int Ls;
106  double mu;
107  double epsilon;
111  double tol;
112  double tol_hq;
113  double true_res;
114  double true_res_hq;
115  int maxiter;
116  double reliable_delta;
122 
125 
128 
131 
134 
140 
142 
147 
149 
152 
157 
160 
162 
163  int sp_pad;
164  int cl_pad;
165 
166  int iter;
167  double spinorGiB;
168  double cloverGiB;
169  double gflops;
170  double secs;
171 
174 
177 
178  /*
179  * The following parameters are related to the domain-decomposed
180  * preconditioner, if enabled.
181  */
182 
188 
191 
194 
197 
199  double omega;
200 
203 
206 
216 
217  } QudaInvertParam;
218 
219 
220  /*
221  * Interface functions, found in interface_quda.cpp
222  */
223 
249  void setVerbosityQuda(QudaVerbosity verbosity, const char prefix[],
250  FILE *outfile);
251 
262  typedef int (*QudaCommsMap)(const int *coords, void *fdata);
263 
290  void initCommsGridQuda(int nDim, const int *dims, QudaCommsMap func, void *fdata);
291 
300  void initQuda(int device);
301 
305  void endQuda(void);
306 
315 
324 
330 
336 
342  void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param);
343 
347  void freeGaugeQuda(void);
348 
354  void saveGaugeQuda(void *h_gauge, QudaGaugeParam *param);
355 
363  void loadCloverQuda(void *h_clover, void *h_clovinv,
365 
369  void freeCloverQuda(void);
370 
380  void invertQuda(void *h_x, void *h_b, QudaInvertParam *param);
381 
389  void invertMultiShiftQuda(void **_hp_x, void *_hp_b, QudaInvertParam *param);
390 
399  void dslashQuda(void *h_out, void *h_in, QudaInvertParam *inv_param,
401 
411  void cloverQuda(void *h_out, void *h_in, QudaInvertParam *inv_param,
412  QudaParity *parity, int inverse);
413 
421  void MatQuda(void *h_out, void *h_in, QudaInvertParam *inv_param);
422 
430  void MatDagMatQuda(void *h_out, void *h_in, QudaInvertParam *inv_param);
431 
432 
433  /*
434  * The following routines are temporary additions used by the HISQ
435  * link-fattening code.
436  */
437 
438  void set_dim(int *);
439  void pack_ghost(void **cpuLink, void **cpuGhost, int nFace,
440  QudaPrecision precision);
442  int computeFatLinkQuda(void* fatlink, void** sitelink,
443  double* act_path_coeff, QudaGaugeParam* param,
444  QudaComputeFatMethod method);
445 
449  int computeGaugeForceQuda(void* mom, void* sitelink, int*** input_path_buf, int* path_length,
450  void* loop_coeff, int num_paths, int max_length, double eb3,
451  QudaGaugeParam* qudaGaugeParam, double* timeinfo);
452 
453 #ifdef __cplusplus
454 }
455 #endif
456 
457 #include <quda_fortran.h>
458 /* #include <quda_new_interface.h> */
459 
460 #endif /* _QUDA_H */
461