-
Notifications
You must be signed in to change notification settings - Fork 2
/
eval.h
31 lines (25 loc) · 908 Bytes
/
eval.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef EVAL_H
#define EVAL_H
#include <sys/time.h>
double getUTtime()
{
timeval t;
gettimeofday(&t, 0);
return t.tv_sec + t.tv_usec * 1e-6;
}
void eval(double tStartInit, double tStartCalc, double tEndCalc, double tEnd, int dimX, int dimY, int dimZ, int repeats)
{
double tNetto = tEndCalc - tStartCalc;
double tBrutto = tEnd - tStartInit;
double tOverhead = tBrutto - tNetto;
double gUpdates = 1e-9 * dimX * dimY * dimZ * repeats;
double glupsNetto = gUpdates / tNetto;
double glupsBrutto = gUpdates / tBrutto;
std::cerr << "gridDim: (" << dimX << ", " << dimY << ", " << dimZ << ")\n"
<< "repeats: " << repeats << "\n"
<< "compute time: " << tNetto << " s\n"
<< "overhead time: " << tOverhead << " s\n"
<< "GLUPS peak: " << glupsNetto << "\n"
<< "GLUPS: " << glupsBrutto << "\n";
}
#endif