allow gpu module write sanity data for GPU and CPU tests in one xml
authormarina.kolpakova <marina.kolpakova@itseez.com>
Fri, 12 Oct 2012 10:32:47 +0000 (14:32 +0400)
committermarina.kolpakova <marina.kolpakova@itseez.com>
Fri, 12 Oct 2012 10:46:18 +0000 (14:46 +0400)
modules/ts/include/opencv2/ts/ts_perf.hpp
modules/ts/src/ts_perf.cpp

index e502315..22538ef 100644 (file)
@@ -187,6 +187,7 @@ private:
     cv::FileStorage storageOut;
     cv::FileNode rootIn;
     std::string currentTestNodeName;
+    std::string suiteName;
 
     cv::FileStorage& write();
 
index 817b754..e5158b6 100644 (file)
@@ -184,6 +184,8 @@ void Regression::init(const std::string& testSuitName, const std::string& ext)
         storageOutPath = testSuitName;
     }
 
+    suiteName = testSuitName;
+
     try
     {
         if (storageIn.open(storageInPath, cv::FileStorage::READ))
@@ -562,6 +564,12 @@ Regression& Regression::operator() (const std::string& name, cv::InputArray arra
 
     std::string nodename = getCurrentTestNodeName();
 
+#ifdef HAVE_CUDA
+    static const std::string prefix = (param_run_cpu)? "CPU_" : "GPU_";
+    if(suiteName == "gpu")
+       nodename = prefix + nodename;
+#endif
+
     cv::FileNode n = rootIn[nodename];
     if(n.isNone())
     {