18 extern void usage(
char** argv);
72 for(
int i=0;i < 4;i++){
74 if (siteLink_2d[i] == NULL){
75 errorQuda(
"ERROR: malloc failed for siteLink_2d\n");
91 for(
int i=0;i < 4;i++){
121 fprintf(stderr,
"ERROR: malloc failed for hw\n");
149 fermion_force_test(
void)
152 fermion_force_init();
160 float act_path_coeff[6];
162 act_path_coeff[0] = 0.625000;
163 act_path_coeff[1] = -0.058479;
164 act_path_coeff[2] = -0.087719;
165 act_path_coeff[3] = 0.030778;
166 act_path_coeff[4] = -0.007200;
167 act_path_coeff[5] = -0.123113;
190 struct timeval t0, t1;
191 cudaDeviceSynchronize();
193 gettimeofday(&t0, NULL);
195 cudaDeviceSynchronize();
196 gettimeofday(&t1, NULL);
197 double secs = t1.tv_sec - t0.tv_sec + 0.000001*(t1.tv_usec - t0.tv_usec);
208 printf(
"Test %s\n",(1 == res) ?
"PASSED" :
"FAILED");
211 double perf = 1.0* flops*volume/(secs*1024*1024*1024);
212 printf(
"GPU runtime =%.2f ms, kernel performance= %.2f GFLOPS\n", secs*1000, perf);
218 printf(
"Warning: you test failed. \n");
219 printf(
" Did you use --verify?\n");
220 printf(
" Did you check the GPU health by running cuda memtest?\n");
223 return accuracy_level;
230 printf(
"running the following fermion force computation test:\n");
232 printf(
"link_precision link_reconstruct space_dim(x/y/z) T_dimension\n");
233 printf(
"%s %s %d/%d/%d %d \n",
244 printf(
"Extra options: \n");
245 printf(
" --verify # Verify the GPU results using CPU results\n");
253 for (i =1;i < argc; i++){
258 if( strcmp(argv[i],
"--verify") == 0){
262 fprintf(stderr,
"ERROR: Invalid option:%s\n", argv[i]);
272 int accuracy_level = fermion_force_test();
273 printfQuda(
"accuracy_level=%d\n", accuracy_level);
278 if(accuracy_level >=3 ){