-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbenchmarkResult.cpp
43 lines (37 loc) · 1.5 KB
/
benchmarkResult.cpp
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
32
33
34
35
36
37
38
39
40
41
42
43
#include "benchmarkResult.h"
namespace cuFFTAdvisor {
void BenchmarkResult::print(FILE* stream) const {
if (NULL == stream) return;
transform->print(stream);
printf(
"%s%.10f%s%.10f" // plan estimation
"%s%.10f%s%.10f" // memory
"%s%.10f%s%.10f%s%.10f" // times
"%s%lu%s%.10f%s%s",
SEP, toMB(planSizeEstimateB), SEP, toMB(planSizeEstimate2B), SEP,
toMB(planSizeRealB), SEP, toMB(transform->dataSizeB), SEP, planTimeMS,
SEP, execTimeMS, SEP, totalTimeMS, SEP, transform->elems, SEP, getPerf(), SEP,
errMsg.c_str());
}
void BenchmarkResult::printHeader(FILE* stream) {
Transform::printHeader(stream);
fprintf(
stream,
"%splan size estimate (MB)%splan size estimate 2 (MB)%splan size actual "
"(MB)%sdata size (MB)"
"%splan time (ms)%sexec time (ms/signal)%sexec time of batch (ms)"
"%selements%sperformance (1k elem of signal/ms)%serror message",
SEP, SEP, SEP, SEP, SEP, SEP, SEP, SEP, SEP, SEP);
}
bool BenchmarkResult::execSort(const BenchmarkResult* l,
const BenchmarkResult* r) {
if (std::isnan(l->execTimeMS) && (!std::isnan(r->execTimeMS))) return false;
if ((!std::isnan(l->execTimeMS)) && std::isnan(r->execTimeMS)) return true;
return l->execTimeMS < r->execTimeMS;
}
inline float BenchmarkResult::getPerf() const {
return std::isnan(this->planTimeMS)
? NAN
: ((transform->elems / transform->N) / 1000.f) / this->execTimeMS;
}
} // namespace cuFFTAdvisor