QUDA  v0.5.0
A library for QCD on GPUs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
timer.cpp
Go to the documentation of this file.
1 #include <quda_internal.h>
2 
3 namespace quda {
4 
7  if (profile[QUDA_PROFILE_TOTAL].time > 0.0) {
8  printfQuda("\n %20s Total time = %g secs\n", fname.c_str(),
10  }
11 
12  double accounted = 0.0;
13  for (int i=0; i<QUDA_PROFILE_COUNT-1; i++) {
14  if (profile[i].time > 0.0) {
15  printfQuda(" %15s = %f secs (%6.3g%%)\n", (const char*)&pname[i][0],
16  profile[i].time, 100*profile[i].time/profile[QUDA_PROFILE_TOTAL].time);
17  accounted += profile[i].time;
18  }
19  }
20  if (accounted > 0.0) {
21  double missing = profile[QUDA_PROFILE_TOTAL].time - accounted;
22  printfQuda(" total accounted = %f secs (%6.3g%%)\n",
23  accounted, 100*accounted/profile[QUDA_PROFILE_TOTAL].time);
24  printfQuda(" total missing = %f secs (%6.3g%%)\n",
25  missing, 100*missing/profile[QUDA_PROFILE_TOTAL].time);
26  }
27 
28  if (accounted > profile[QUDA_PROFILE_TOTAL].time) {
29  warningQuda("Accounted time %f secs in %s is greater than total time %f secs\n",
30  accounted, (const char*)&fname[0], profile[QUDA_PROFILE_TOTAL].time);
31  }
32 
33  }
34 
35  std::string TimeProfile::pname[] = { "download", "upload", "init", "preamble", "compute",
36  "epilogue", "free", "total" };
37 
38 }
39