QUDA v0.3.2
A library for QCD on GPUs

quda/include/quda.h

Go to the documentation of this file.
00001 #ifndef _QUDA_H
00002 #define _QUDA_H
00003 
00004 #include <enum_quda.h>
00005 
00006 #define QUDA_VERSION 000302 // version 0.3.2
00007 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019 
00020   // When adding new members to QudaGaugeParam and QudaInvertParam,
00021   // be sure to update lib/check_params.h
00022 
00023   typedef struct QudaGaugeParam_s {
00024 
00025     int X[4];
00026 
00027     double anisotropy;    // used for Wilson and Wilson-clover
00028     double tadpole_coeff; // used for staggered only
00029 
00030     QudaLinkType type;
00031     QudaGaugeFieldOrder gauge_order;
00032 
00033     QudaTboundary t_boundary;
00034 
00035     QudaPrecision cpu_prec;
00036 
00037     QudaPrecision cuda_prec;
00038     QudaReconstructType reconstruct;
00039 
00040     QudaPrecision cuda_prec_sloppy;
00041     QudaReconstructType reconstruct_sloppy;
00042 
00043     QudaGaugeFixed gauge_fix;
00044 
00045     int ga_pad;
00046 
00047     int packed_size;
00048     double gaugeGiB;
00049 
00050   } QudaGaugeParam;
00051 
00052   typedef struct QudaInvertParam_s {
00053 
00054     QudaDslashType dslash_type;
00055     QudaInverterType inv_type;
00056 
00057     double mass;  // used for staggered only
00058     double kappa; // used for Wilson and Wilson-clover
00059 
00060     double m5; // domain wall shift parameter
00061     int Ls; // domain wall 5th dimension
00062 
00063     double mu; // twisted mass parameter
00064     QudaTwistFlavorType twist_flavor; // twisted mass flavor
00065 
00066     double tol;
00067     int maxiter;
00068     double reliable_delta; // reliable update tolerance
00069 
00070     QudaSolutionType solution_type; // type of system to solve
00071     QudaSolveType solve_type; // how to solve it
00072     QudaMatPCType matpc_type;
00073     QudaDagType dagger;
00074     QudaMassNormalization mass_normalization;
00075 
00076     QudaPreserveSource preserve_source;
00077 
00078     QudaPrecision cpu_prec;
00079     QudaPrecision cuda_prec;
00080     QudaPrecision cuda_prec_sloppy;
00081 
00082     QudaDiracFieldOrder dirac_order;
00083 
00084     QudaPrecision clover_cpu_prec;
00085     QudaPrecision clover_cuda_prec;
00086     QudaPrecision clover_cuda_prec_sloppy;
00087 
00088     QudaCloverFieldOrder clover_order;
00089 
00090     QudaVerbosity verbosity;
00091 
00092     int sp_pad;
00093     int cl_pad;
00094 
00095     int iter;
00096     double spinorGiB;
00097     double cloverGiB;
00098     double gflops;
00099     double secs;
00100 
00101   } QudaInvertParam;
00102 
00103 
00104   // Interface functions, found in interface_quda.cpp
00105 
00106   void initQuda(int dev);
00107   void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param);
00108   void saveGaugeQuda(void *h_gauge, QudaGaugeParam *param);
00109   void loadCloverQuda(void *h_clover, void *h_clovinv,
00110                       QudaInvertParam *inv_param);
00111 
00112   void invertQuda(void *h_x, void *h_b, QudaInvertParam *param);
00113   void invertMultiShiftQuda(void **_hp_x, void *_hp_b, QudaInvertParam *param,
00114                             double* offsets, int num_offsets,
00115                             double* residue_sq);
00116   
00117   void dslashQuda(void *h_out, void *h_in, QudaInvertParam *inv_param,
00118                   QudaParity parity);
00119   void MatQuda(void *h_out, void *h_in, QudaInvertParam *inv_param);
00120   void MatDagMatQuda(void *h_out, void *h_in, QudaInvertParam *inv_param);
00121 
00122   void endQuda(void);
00123 
00124   QudaGaugeParam newQudaGaugeParam(void);
00125   QudaInvertParam newQudaInvertParam(void);
00126 
00127   void printQudaGaugeParam(QudaGaugeParam *param);
00128   void printQudaInvertParam(QudaInvertParam *param);
00129 
00130 #ifdef __cplusplus
00131 }
00132 #endif
00133 
00134 #endif // _QUDA_H
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines