QUDA  v0.7.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].count > 0) {
15  printfQuda(" %17s = %f secs (%6.3g%%), with %8d calls at %e us per call\n",
16  (const char*)&pname[i][0], profile[i].time,
17  100*profile[i].time/profile[QUDA_PROFILE_TOTAL].time,
18  profile[i].count, 1e6*profile[i].time/profile[i].count);
19  accounted += profile[i].time;
20  }
21  }
22  if (accounted > 0.0) {
23  double missing = profile[QUDA_PROFILE_TOTAL].time - accounted;
24  printfQuda(" total accounted = %f secs (%6.3g%%)\n",
25  accounted, 100*accounted/profile[QUDA_PROFILE_TOTAL].time);
26  printfQuda(" total missing = %f secs (%6.3g%%)\n",
27  missing, 100*missing/profile[QUDA_PROFILE_TOTAL].time);
28  }
29 
30  if (accounted > profile[QUDA_PROFILE_TOTAL].time) {
31  warningQuda("Accounted time %f secs in %s is greater than total time %f secs\n",
32  accounted, (const char*)&fname[0], profile[QUDA_PROFILE_TOTAL].time);
33  }
34 
35  }
36 
37  std::string TimeProfile::pname[] = { "download", "upload", "init", "preamble", "compute",
38  "epilogue", "free", "pack kernel", "dslash kernel",
39  "gather", "scatter", "event record",
40  "event query", "stream wait event",
41  "comms", "comms start", "comms query", "constant",
42  "total" };
43 
44 }
45 
static std::string pname[]
void Print()
Definition: timer.cpp:6
::std::string string
Definition: gtest.h:1979
#define warningQuda(...)
Definition: util_quda.h:84
__device__ unsigned int count
Definition: reduce_core.h:112
std::string fname
#define printfQuda(...)
Definition: util_quda.h:67
Timer profile[QUDA_PROFILE_COUNT]