minor refactoring of gpu perf. tests
authorAlexey Spizhevoy <no@email>
Mon, 24 Jan 2011 10:39:28 +0000 (10:39 +0000)
committerAlexey Spizhevoy <no@email>
Mon, 24 Jan 2011 10:39:28 +0000 (10:39 +0000)
samples/gpu/performance/performance.cpp

index 035a123..886c5e2 100644 (file)
@@ -47,7 +47,7 @@ void TestSystem::run()
     cout << setiosflags(ios_base::fixed | ios_base::left);\r
     cout << "\nCPU Total: " << setprecision(3) << cpu_total_ / getTickFrequency() << " sec\n";\r
     cout << "GPU Total: " << setprecision(3) << gpu_total_ / getTickFrequency() << " sec (x" \r
-        << setprecision(3) << (double)cpu_total_ / gpu_total_ << ")\n";\r
+        << setprecision(3) << static_cast<double>(cpu_total_) / gpu_total_ << ")\n";\r
     cout << resetiosflags(ios_base::fixed | ios_base::left);\r
 }\r
 \r
@@ -59,7 +59,7 @@ void TestSystem::flush()
 \r
     int cpu_time = static_cast<int>(cpu_elapsed_ / getTickFrequency() * 1000.0);\r
     int gpu_time = static_cast<int>(gpu_elapsed_ / getTickFrequency() * 1000.0);\r
-    double speedup = (double)cpu_time / gpu_time;\r
+    double speedup = static_cast<double>(cpu_time) / gpu_time;\r
 \r
     cpu_elapsed_ = 0;\r
     gpu_elapsed_ = 0;\r