Commit ef478840 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

added message that timings doesn't include data transfer to gpu performance sample (Issue #1846)

parent 52797a55
...@@ -17,7 +17,7 @@ void TestSystem::run() ...@@ -17,7 +17,7 @@ void TestSystem::run()
return; return;
} }
// Run test initializers // Run test initializers
for (vector<Runnable*>::iterator it = inits_.begin(); it != inits_.end(); ++it) for (vector<Runnable*>::iterator it = inits_.begin(); it != inits_.end(); ++it)
{ {
if ((*it)->name().find(test_filter_, 0) != string::npos) if ((*it)->name().find(test_filter_, 0) != string::npos)
...@@ -67,7 +67,7 @@ void TestSystem::finishCurrentSubtest() ...@@ -67,7 +67,7 @@ void TestSystem::finishCurrentSubtest()
speedup_total_ += speedup; speedup_total_ += speedup;
printMetrics(cpu_time, gpu_time, speedup); printMetrics(cpu_time, gpu_time, speedup);
num_subtests_called_++; num_subtests_called_++;
resetCurrentSubtest(); resetCurrentSubtest();
} }
...@@ -86,8 +86,8 @@ void TestSystem::printHeading() ...@@ -86,8 +86,8 @@ void TestSystem::printHeading()
{ {
cout << endl; cout << endl;
cout << setiosflags(ios_base::left); cout << setiosflags(ios_base::left);
cout << TAB << setw(10) << "CPU, ms" << setw(10) << "GPU, ms" cout << TAB << setw(10) << "CPU, ms" << setw(10) << "GPU, ms"
<< setw(14) << "SPEEDUP" << setw(14) << "SPEEDUP"
<< "DESCRIPTION\n"; << "DESCRIPTION\n";
cout << resetiosflags(ios_base::left); cout << resetiosflags(ios_base::left);
} }
...@@ -96,8 +96,8 @@ void TestSystem::printHeading() ...@@ -96,8 +96,8 @@ void TestSystem::printHeading()
void TestSystem::printSummary() void TestSystem::printSummary()
{ {
cout << setiosflags(ios_base::fixed); cout << setiosflags(ios_base::fixed);
cout << "\naverage GPU speedup: x" cout << "\naverage GPU speedup: x"
<< setprecision(3) << speedup_total_ / std::max(1, num_subtests_called_) << setprecision(3) << speedup_total_ / std::max(1, num_subtests_called_)
<< endl; << endl;
cout << resetiosflags(ios_base::fixed); cout << resetiosflags(ios_base::fixed);
} }
...@@ -144,7 +144,7 @@ string abspath(const string& relpath) ...@@ -144,7 +144,7 @@ string abspath(const string& relpath)
} }
int CV_CDECL cvErrorCallback(int /*status*/, const char* /*func_name*/, int CV_CDECL cvErrorCallback(int /*status*/, const char* /*func_name*/,
const char* err_msg, const char* /*file_name*/, const char* err_msg, const char* /*file_name*/,
int /*line*/, void* /*userdata*/) int /*line*/, void* /*userdata*/)
{ {
...@@ -217,6 +217,8 @@ int main(int argc, const char* argv[]) ...@@ -217,6 +217,8 @@ int main(int argc, const char* argv[])
TestSystem::instance().setNumIters(iters); TestSystem::instance().setNumIters(iters);
cout << "\nNote: the timings for GPU don't include data transfer" << endl;
TestSystem::instance().run(); TestSystem::instance().run();
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment