diff --git a/modules/gpu/perf/perf_main.cpp b/modules/gpu/perf/perf_main.cpp index 32d550594..8092deb83 100644 --- a/modules/gpu/perf/perf_main.cpp +++ b/modules/gpu/perf/perf_main.cpp @@ -5,7 +5,7 @@ int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); - cvtest::TS::ptr()->init("gpu"); + //cvtest::TS::ptr()->init("gpu"); Regression::Init("gpu"); TestBase::Init(argc, argv); return RUN_ALL_TESTS(); diff --git a/modules/gpu/perf/perf_utility.cpp b/modules/gpu/perf/perf_utility.cpp index 0b7c11846..e5a73c6c0 100644 --- a/modules/gpu/perf/perf_utility.cpp +++ b/modules/gpu/perf/perf_utility.cpp @@ -5,7 +5,7 @@ using namespace cv::gpu; Mat readImage(const string& fileName, int flags) { - return imread(string(cvtest::TS::ptr()->get_data_path()) + fileName, flags); + return imread(::perf::TestBase::getDataPath(fileName), flags); } bool supportFeature(const DeviceInfo& info, FeatureSet feature) diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp index 708a767d1..39cb764e9 100644 --- a/modules/ts/include/opencv2/ts/ts_perf.hpp +++ b/modules/ts/include/opencv2/ts/ts_perf.hpp @@ -203,6 +203,7 @@ public: TestBase(); static void Init(int argc, const char* const argv[]); + static std::string getDataPath(const std::string& relativePath); protected: virtual void PerfTestBody() = 0; @@ -214,8 +215,6 @@ protected: void stopTimer(); bool next(); - std::string getDataPath(const std::string& relativePath); - //_declareHelper declare; enum diff --git a/modules/ts/misc/run.py b/modules/ts/misc/run.py index c49289e2d..643080a8e 100644 --- a/modules/ts/misc/run.py +++ b/modules/ts/misc/run.py @@ -22,6 +22,8 @@ parse_patterns = ( {'name': "is_x64", 'default': "OFF", 'pattern': re.compile("^CUDA_64_BIT_DEVICE_CODE:BOOL=(ON)$")},#ugly( {'name': "cmake_generator", 'default': None, 'pattern': re.compile("^CMAKE_GENERATOR:INTERNAL=(.+)$")}, {'name': "cxx_compiler", 'default': None, 'pattern': re.compile("^CMAKE_CXX_COMPILER:FILEPATH=(.+)$")}, + {'name': "with_cuda", 'default': "OFF", 'pattern': re.compile("^WITH_CUDA:BOOL=(ON)$")}, + {'name': "cuda_library", 'default': None, 'pattern': re.compile("^CUDA_CUDA_LIBRARY:FILEPATH=(.+)$")}, ) def query_yes_no(stdout, question, default="yes"): @@ -67,6 +69,7 @@ class RunInfo(object): except: pass cachefile.close() + # fix empty tests dir if not self.tests_dir: self.tests_dir = self.path @@ -120,6 +123,12 @@ class RunInfo(object): else: self.targetarch = "unknown" + # fix CUDA attributes + self.with_cuda = self.with_cuda == "ON" + if self.cuda_library and self.cuda_library.endswith("-NOTFOUND"): + self.cuda_library = None + self.has_cuda = self.with_cuda and self.cuda_library and self.targetarch in ["x86", "x64"] + self.hardware = None self.getSvnVersion(self.cmake_home, "cmake_home_svn") @@ -210,6 +219,8 @@ class RunInfo(object): rev = "" if self.hardware: hw = str(self.hardware).replace(" ", "_") + "_" + elif self.has_cuda: + hw = "CUDA_" else: hw = "" #stamp = timestamp.strftime("%Y%m%dT%H%M%S")