44 for(
int dir=0; dir<4; ++dir){
45 for(
int i=0; i<
V*18; ++i){
47 double* ptr = ((
double**)field)[dir] + i;
48 *ptr += (rand() - RAND_MAX/2.0)/(20.0*RAND_MAX);
50 float* ptr = ((
float**)field)[dir]+i;
51 *ptr += (rand() - RAND_MAX/2.0)/(20.0*RAND_MAX);
59 static void hisq_force_init()
63 gaugeParam.
X[0] =
xdim;
64 gaugeParam.
X[1] =
ydim;
65 gaugeParam.
X[2] =
zdim;
66 gaugeParam.
X[3] =
tdim;
106 static void hisq_force_end()
121 static void hisq_force_test()
125 double unitarize_eps = 1e-5;
126 const double hisq_force_filter = 5e-5;
127 const double max_det_error = 1e-12;
128 const bool allow_svd =
true;
129 const bool svd_only =
false;
130 const double svd_rel_err = 1e-8;
131 const double svd_abs_err = 1e-8;
150 printfQuda(
"Comparing CPU and GPU results\n");
151 for(
int dir=0; dir<4; ++dir){
158 printfQuda(
"Dir:%d Test %s\n",dir,(1 == res) ?
"PASSED" :
"FAILED");
166 printfQuda(
"running the following fermion force computation test:\n");
168 printfQuda(
"link_precision link_reconstruct space_dim(x/y/z) T_dimension\n");
175 int main(
int argc,
char **argv)
183 app->parse(argc, argv);
184 }
catch (
const CLI::ParseError &e) {
void loadCPUField(const cpuGaugeField &cpu)
Download into this field from a CPU field.
void saveCPUField(cpuGaugeField &cpu) const
Upload from this field into a CPU field.
void comm_allreduce_int(int *data)
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
QudaReconstructType link_recon
std::array< int, 4 > gridsize_from_cmdline
enum QudaPrecision_s QudaPrecision
int main(int argc, char **argv)
cudaGaugeField * cudaResult
cpuGaugeField * cpuResult
cudaGaugeField * cudaFatLink
cpuGaugeField * cpuFatLink
cudaGaugeField * cudaOprod
cpuGaugeField * cpuReference
void setPrecision(QudaPrecision precision)
void createNoisyLinkCPU(void **field, QudaPrecision prec, int seed)
int compare_floats(void *a, void *b, int len, double epsilon, QudaPrecision precision)
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
void createSiteLinkCPU(void **link, QudaPrecision precision, int phase)
#define device_malloc(size)
const char * get_prec_str(QudaPrecision prec)
const char * get_recon_str(QudaReconstructType recon)
void setUnitarizeForceConstants(double unitarize_eps, double hisq_force_filter, double max_det_error, bool allow_svd, bool svd_only, double svd_rel_error, double svd_abs_error)
Set the constant parameters for the force unitarization.
void unitarizeForceCPU(GaugeField &newForce, const GaugeField &oldForce, const GaugeField &gauge)
Unitarize the fermion force on CPU.
void unitarizeForce(GaugeField &newForce, const GaugeField &oldForce, const GaugeField &gauge, int *unitarization_failed)
Unitarize the fermion force.
Main header file for the QUDA library.
void initQuda(int device)
#define qudaMemset(ptr, value, count)
QudaReconstructType reconstruct
QudaGaugeFieldOrder gauge_order
QudaGaugeFieldOrder order
void setPrecision(QudaPrecision precision, bool force_native=false)
Helper function for setting the precision and corresponding field order for QUDA internal fields.
QudaGhostExchange ghostExchange