Skip to content
Snippets Groups Projects
Commit a209613b authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Adjust opconter to the csv style

parent 098b3692
No related branches found
No related tags found
No related merge requests found
......@@ -151,18 +151,20 @@ namespace oc {
}
template<typename Stream>
void reportOperations(Stream& os, bool doReset = false)
void reportOperations(Stream& os, std::string exec, std::string kernel, bool doReset = false)
{
os << "additions: " << addition_count << std::endl
<< "multiplications: " << multiplication_count << std::endl
<< "divisions: " << division_count << std::endl
<< "exp: " << exp_count << std::endl
<< "pow: " << pow_count << std::endl
<< "sin: " << sin_count << std::endl
<< "sqrt: " << sqrt_count << std::endl
<< "comparisons: " << comparison_count << std::endl
<< std::endl
<< "total: " << addition_count + multiplication_count + division_count + exp_count + pow_count + sin_count + sqrt_count + comparison_count << std::endl;
auto total = addition_count + multiplication_count + division_count + exp_count + pow_count + sin_count + sqrt_count + comparison_count;
if (total == 0)
return;
os << exec << " " << kernel << " additions " << addition_count << std::endl
<< exec << " " << kernel << " multiplications " << multiplication_count << std::endl
<< exec << " " << kernel << " divisions " << division_count << std::endl
<< exec << " " << kernel << " exp " << exp_count << std::endl
<< exec << " " << kernel << " pow " << pow_count << std::endl
<< exec << " " << kernel << " sin " << sin_count << std::endl
<< exec << " " << kernel << " sqrt " << sqrt_count << std::endl
<< exec << " " << kernel << " comparisons " << comparison_count << std::endl
<< exec << " " << kernel << " totalops " << total << std::endl;
if (doReset)
reset();
......@@ -218,9 +220,9 @@ namespace oc {
}
template<typename Stream>
static void reportOperations(Stream& os, bool doReset = false)
static void reportOperations(Stream& os, std::string exec, std::string kernel, bool doReset = false)
{
counters.reportOperations(os,doReset);
counters.reportOperations(os, exec, kernel, doReset);
}
static Counters counters;
......
......@@ -73,13 +73,13 @@
#define DUMP_TIMER(name,os,reset) \
os << exec << " " << #name << " " << HP_TIMER_ELAPSED(name) << std::endl; \
HP_TIMER_OPCOUNTERS(name).reportOperations(os,reset);
HP_TIMER_OPCOUNTERS(name).reportOperations(os,exec,#name,reset);
#define DUMP_AND_ACCUMULATE_TIMER(name,os,reset,time,ops) \
os << exec << " " << #name << " " << HP_TIMER_ELAPSED(name) << std::endl; \
time += HP_TIMER_ELAPSED(name); \
ops += HP_TIMER_OPCOUNTERS(name); \
HP_TIMER_OPCOUNTERS(name).reportOperations(os,reset);
HP_TIMER_OPCOUNTERS(name).reportOperations(os,exec,#name,reset);
#elif defined ENABLE_HP_TIMERS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment