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

index 886c5e2..1b5a0bf 100644 (file)
@@ -4,20 +4,9 @@
 using namespace std;\r
 using namespace cv;\r
 \r
-\r
-void Test::gen(Mat& mat, int rows, int cols, int type, Scalar low, Scalar high)\r
-{   \r
-    mat.create(rows, cols, type);\r
-\r
-    RNG rng(0);\r
-    rng.fill(mat, RNG::UNIFORM, low, high);\r
-}\r
-\r
-\r
 void Test::gen(Mat& mat, int rows, int cols, int type)\r
 {   \r
     mat.create(rows, cols, type);\r
-\r
     Mat mat8u(rows, cols * mat.elemSize(), CV_8U, mat.data, mat.step);\r
 \r
     RNG rng(0);\r
@@ -35,7 +24,6 @@ void TestSystem::run()
     vector<Test*>::iterator it = tests_.begin();\r
     for (; it != tests_.end(); ++it)\r
     {\r
-        can_flush_ = false;\r
         Test* test = *it;\r
 \r
         cout << endl << test->name() << ":\n";\r
@@ -82,6 +70,7 @@ void TestSystem::flush()
     description_.str("");\r
 \r
     cout << resetiosflags(ios_base::fixed | ios_base::left) << endl;\r
+    \r
     can_flush_ = false;\r
 }\r
 \r
index ef0787c..354c54e 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef OPENCV_GPU_SAMPLE_PERFORMANCE_H_\r
+#define OPENCV_GPU_SAMPLE_PERFORMANCE_H_\r
+\r
 #include <iostream>\r
 #include <cstdio>\r
 #include <vector>\r
 class Test\r
 {\r
 public:\r
-    Test(const std::string& name): name_(name) {}\r
+    explicit Test(const std::string& name): name_(name) {}\r
 \r
     const std::string& name() const { return name_; }\r
 \r
-    void gen(cv::Mat& mat, int rows, int cols, int type,\r
-             cv::Scalar low, cv::Scalar high);\r
-\r
     void gen(cv::Mat& mat, int rows, int cols, int type);\r
 \r
     virtual void run() = 0;\r
@@ -96,4 +96,6 @@ private:
 #define CPU_OFF TestSystem::instance()->cpuOff()\r
 #define GPU_OFF TestSystem::instance()->gpuOff()\r
 #define SUBTEST TestSystem::instance()->subtest()\r
-#define DESCRIPTION TestSystem::instance()->subtest()
\ No newline at end of file
+#define DESCRIPTION TestSystem::instance()->subtest()\r
+\r
+#endif // OPENCV_GPU_SAMPLE_PERFORMANCE_H_
\ No newline at end of file