11 #include <llfat_reference.h>
17 static double unitarize_eps = 1e-6;
18 static bool reunit_allow_svd =
true;
19 static bool reunit_svd_only =
false;
20 static double svd_rel_error = 1e-4;
21 static double svd_abs_error = 1e-4;
22 static double max_allowed_error = 1e-11;
25 void computeHISQLinksGPU(
void **qdp_fatlink,
void **qdp_longlink,
void **qdp_fatlink_eps,
void **qdp_longlink_eps,
27 size_t gauge_data_type_size,
int n_naiks)
47 void *milc_fatlink_eps =
nullptr;
48 void *milc_longlink_eps =
nullptr;
116 double act_path_coeff_1[6] = {
119 u2 * (-1.0 / 8.0) * 0.5,
120 u4 * (1.0 / 8.0) * 0.25 * 0.5,
121 u6 * (-1.0 / 8.0) * 0.125 * (1.0 / 6.0),
126 double act_path_coeff_2[6] = {
127 ((1.0 / 8.0) + (2.0 * 6.0 / 16.0) + (1.0 / 8.0)),
131 (1.0 / 8.0) * 0.25 * 0.5,
132 (-1.0 / 8.0) * 0.125 * (1.0 / 6.0),
137 double act_path_coeff_3[6] = {
146 for (
int i = 0; i < 6; i++) {
147 act_paths[0][i] = act_path_coeff_1[i];
148 act_paths[1][i] = act_path_coeff_2[i];
149 act_paths[2][i] = act_path_coeff_3[i];
163 double **act_paths =
new double *[3];
164 for (
int i = 0; i < 3; i++) act_paths[i] =
new double[6];
171 void *qdp_fatlink_naik_temp[4];
172 void *qdp_longlink_naik_temp[4];
174 for (
int dir = 0; dir < 4; dir++) {
175 qdp_fatlink_naik_temp[dir] = malloc(
V *
gauge_site_size * gauge_data_type_size);
176 qdp_longlink_naik_temp[dir] = malloc(
V *
gauge_site_size * gauge_data_type_size);
188 gauge_data_type_size,
n_naiks);
192 for (
int dir = 0; dir < 4; dir++) {
193 memcpy(qdp_fatlink[dir], qdp_fatlink_naik_temp[dir],
V *
gauge_site_size * gauge_data_type_size);
194 memcpy(qdp_longlink[dir], qdp_longlink_naik_temp[dir],
V *
gauge_site_size * gauge_data_type_size);
195 free(qdp_fatlink_naik_temp[dir]);
196 qdp_fatlink_naik_temp[dir] =
nullptr;
197 free(qdp_longlink_naik_temp[dir]);
198 qdp_longlink_naik_temp[dir] =
nullptr;
202 for (
int i = 0; i < 3; i++)
delete[] act_paths[i];
210 double **act_paths =
new double *[3];
211 for (
int i = 0; i < 3; i++) act_paths[i] =
new double[6];
218 void *qdp_fatlink_naik_temp[4];
219 void *qdp_longlink_naik_temp[4];
221 for (
int dir = 0; dir < 4; dir++) {
222 qdp_fatlink_naik_temp[dir] = malloc(
V *
gauge_site_size * gauge_data_type_size);
223 qdp_longlink_naik_temp[dir] = malloc(
V *
gauge_site_size * gauge_data_type_size);
239 for (
int dir = 0; dir < 4; dir++) {
240 memcpy(qdp_fatlink_cpu[dir], qdp_fatlink_naik_temp[dir],
V *
gauge_site_size * gauge_data_type_size);
241 memcpy(qdp_longlink_cpu[dir], qdp_longlink_naik_temp[dir],
V *
gauge_site_size * gauge_data_type_size);
255 gauge_data_type_size,
n_naiks);
259 for (
int dir = 0; dir < 4; dir++) {
260 memcpy(qdp_fatlink_gpu[dir], qdp_fatlink_naik_temp[dir],
V *
gauge_site_size * gauge_data_type_size);
261 memcpy(qdp_longlink_gpu[dir], qdp_longlink_naik_temp[dir],
V *
gauge_site_size * gauge_data_type_size);
262 free(qdp_fatlink_naik_temp[dir]);
263 qdp_fatlink_naik_temp[dir] =
nullptr;
264 free(qdp_longlink_naik_temp[dir]);
265 qdp_longlink_naik_temp[dir] =
nullptr;
269 for (
int i = 0; i < 3; i++)
delete[] act_paths[i];
286 for (
int d = 0; d < 4; d++) {
312 int pad_size = x_face_size > y_face_size ? x_face_size : y_face_size;
313 pad_size = pad_size > z_face_size ? pad_size : z_face_size;
314 pad_size = pad_size > t_face_size ? pad_size : t_face_size;
QudaDslashType dslash_type
void * memset(void *s, int c, size_t n)
QudaGaugeParam gauge_param
enum QudaDslashType_s QudaDslashType
void cpu_axy(QudaPrecision prec, double a, void *x, void *y, int size)
void cpu_xpy(QudaPrecision prec, void *x, void *y, int size)
void reorderQDPtoMILC(void *milc_out, void **qdp_in, int V, int siteSize, QudaPrecision out_precision, QudaPrecision in_precision)
void computeHISQLinksCPU(void **fatlink, void **longlink, void **fatlink_eps, void **longlink_eps, void **sitelink, void *qudaGaugeParamPtr, double **act_path_coeffs, double eps_naik)
void reorderMILCtoQDP(void **qdp_out, void *milc_in, int V, int siteSize, QudaPrecision out_precision, QudaPrecision in_precision)
#define pinned_malloc(size)
void setUnitarizeLinksConstants(double unitarize_eps, double max_error, bool allow_svd, bool svd_only, double svd_rel_error, double svd_abs_error)
Main header file for the QUDA library.
void plaqQuda(double plaq[3])
QudaGaugeParam newQudaGaugeParam(void)
void loadGaugeQuda(void *h_gauge, QudaGaugeParam *param)
void computeKSLinkQuda(void *fatlink, void *longlink, void *ulink, void *inlink, double *path_coeff, QudaGaugeParam *param)
void computeFatLongGPU(void **qdp_fatlink, void **qdp_longlink, void **qdp_inlink, QudaGaugeParam &gauge_param, size_t gauge_data_type_size, int n_naiks, double eps_naik)
void computeFatLongGPUandCPU(void **qdp_fatlink_gpu, void **qdp_longlink_gpu, void **qdp_fatlink_cpu, void **qdp_longlink_cpu, void **qdp_inlink, QudaGaugeParam &gauge_param, size_t gauge_data_type_size, int n_naiks, double eps_naik)
void setActionPaths(double **act_paths)
void computeHISQLinksGPU(void **qdp_fatlink, void **qdp_longlink, void **qdp_fatlink_eps, void **qdp_longlink_eps, void **qdp_inlink, QudaGaugeParam &gauge_param_in, double **act_path_coeffs, double eps_naik, size_t gauge_data_type_size, int n_naiks)
void computeStaggeredPlaquetteQDPOrder(void **qdp_link, double plaq[3], const QudaGaugeParam &gauge_param_in, const QudaDslashType dslash_type)
QudaReconstructType reconstruct
QudaPrecision cuda_prec_sloppy
QudaReconstructType reconstruct_sloppy
QudaGaugeFieldOrder gauge_order