19 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
20 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
178 {3, 5, 4}, {4, 5, 3}, {0, 5, 7}, {7, 5, 0}, {1, 5, 6}, {6, 5, 1}, {2, 3, 5, 5, 4},
179 {3, 5, 5, 4, 2}, {4, 5, 5, 3, 2}, {2, 4, 5, 5, 3}, {2, 0, 5, 5, 7}, {0, 5, 5, 7, 2}, {7, 5, 5, 0, 2}, {2, 7, 5, 5, 0},
180 {2, 1, 5, 5, 6}, {1, 5, 5, 6, 2}, {6, 5, 5, 1, 2}, {2, 6, 5, 5, 1}, {4, 4, 5, 3, 3}, {3, 3, 5, 4, 4}, {7, 7, 5, 0, 0},
181 {0, 0, 5, 7, 7}, {6, 6, 5, 1, 1}, {1, 1, 5, 6, 6}, {3, 0, 5, 4, 7}, {7, 4, 5, 0, 3}, {3, 7, 5, 4, 0}, {0, 4, 5, 7, 3},
182 {4, 0, 5, 3, 7}, {7, 3, 5, 0, 4}, {4, 7, 5, 3, 0}, {0, 3, 5, 7, 4}, {3, 1, 5, 4, 6}, {6, 4, 5, 1, 3}, {3, 6, 5, 4, 1},
183 {1, 4, 5, 6, 3}, {4, 1, 5, 3, 6}, {6, 3, 5, 1, 4}, {4, 6, 5, 3, 1}, {1, 3, 5, 6, 4}, {0, 1, 5, 7, 6}, {6, 7, 5, 1, 0},
184 {0, 6, 5, 7, 1}, {1, 7, 5, 6, 0}, {7, 1, 5, 0, 6}, {6, 0, 5, 1, 7}, {7, 6, 5, 0, 1}, {1, 0, 5, 6, 7}};
237 static double force_check;
238 static double deviation;
254 double loop_coeff_d[
sizeof(
loop_coeff_f)/
sizeof(
float)];
255 for(
unsigned int i=0;i <
sizeof(
loop_coeff_f)/
sizeof(
float); i++){
263 loop_coeff = loop_coeff_d;
268 int** input_path_buf[4];
269 for (
int dir = 0; dir < 4; dir++) {
270 input_path_buf[dir] = (
int **)
safe_malloc(num_paths *
sizeof(
int *));
271 for (
int i = 0; i < num_paths; i++) {
309 void *sitelink =
nullptr;
312 sitelink = U_milc->Gauge_p();
313 mom = Mom_milc->Gauge_p();
315 sitelink = U_qdp->Gauge_p();
316 mom = Mom_qdp->Gauge_p();
318 errorQuda(
"Unsupported gauge order %d", gauge_order);
324 struct timeval t0, t1;
325 double total_time = 0.0;
329 for (
int i = 0; i <
niter; i++) {
330 Mom_->copy(*Mom_ref_milc);
331 gettimeofday(&t0, NULL);
333 gettimeofday(&t1, NULL);
334 total_time += t1.tv_sec - t0.tv_sec + 0.000001*(t1.tv_usec - t0.tv_usec);
341 void *refmom = Mom_ref_milc->Gauge_p();
344 loop_coeff, num_paths);
354 printfQuda(
"QUDA action = %e, reference = %e relative deviation = %e\n", action_quda, action_ref, deviation);
357 printfQuda(
"total time = %.2f ms\n", total_time * 1e+3);
358 printfQuda(
"overall performance : %.2f GFLOPS\n",perf);
360 for(
int dir = 0; dir < 4; dir++){
361 for(
int i=0;i < num_paths; i++)
host_free(input_path_buf[dir][i]);
372 TEST(force, verify) {
ASSERT_EQ(force_check, 1) <<
"CPU and QUDA implementations do not agree"; }
380 printfQuda(
"link_precision link_reconstruct space_dim(x/y/z) T_dimension "
381 "Gauge_order niter\n");
388 int main(
int argc,
char **argv)
399 app->add_option(
"--gauge-order", gauge_order,
"")->transform(CLI::QUDACheckedTransformer(gauge_order_map));
401 app->parse(argc, argv);
402 }
catch (
const CLI::ParseError &e) {
TestEventListener * Release(TestEventListener *listener)
TestEventListener * default_result_printer() const
TestEventListeners & listeners()
static UnitTest * GetInstance()
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
QudaReconstructType link_recon
std::array< int, 4 > gridsize_from_cmdline
QudaGaugeParam gauge_param
enum QudaGaugeFieldOrder_s QudaGaugeFieldOrder
void gauge_force_reference(void *refMom, double eb3, void **sitelink, QudaPrecision prec, int ***path_dir, int *length, void *loop_coeff, int num_paths)
int main(int argc, char **argv)
void gauge_force_test(void)
#define ASSERT_EQ(val1, val2)
#define ASSERT_LE(val1, val2)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
int compare_floats(void *a, void *b, int len, double epsilon, QudaPrecision precision)
double mom_action(real *mom_, int len)
QudaPrecision & cuda_prec
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
void createMomCPU(void *mom, QudaPrecision precision)
int strong_check_mom(void *momA, void *momB, int len, QudaPrecision prec)
void createSiteLinkCPU(void **link, QudaPrecision precision, int phase)
double getTolerance(QudaPrecision prec)
#define safe_malloc(size)
const char * get_prec_str(QudaPrecision prec)
const char * get_gauge_order_str(QudaGaugeFieldOrder order)
const char * get_recon_str(QudaReconstructType recon)
__host__ __device__ ValueType abs(ValueType x)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Main header file for the QUDA library.
double momActionQuda(void *momentum, QudaGaugeParam *param)
int computeGaugeForceQuda(void *mom, void *sitelink, int ***input_path_buf, int *path_length, double *loop_coeff, int num_paths, int max_length, double dt, QudaGaugeParam *qudaGaugeParam)
QudaGaugeParam newQudaGaugeParam(void)
void setVerbosityQuda(QudaVerbosity verbosity, const char prefix[], FILE *outfile)
void initQuda(int device)
QudaReconstructType reconstruct
QudaGaugeFieldOrder gauge_order
void setGaugeParam(QudaGaugeParam &gauge_param)
QudaTune getTuning()
Query whether autotuning is enabled or not. Default is enabled but can be overridden by setting QUDA_...