Perf tests: method ::perf::TestBase::getDataPath made public static; added base CUDA detection into run.py script

pull/13383/head
Andrey Kamaev 13 years ago
parent ccfb3e6a21
commit 6cb1036e04
  1. 2
      modules/gpu/perf/perf_main.cpp
  2. 2
      modules/gpu/perf/perf_utility.cpp
  3. 3
      modules/ts/include/opencv2/ts/ts_perf.hpp
  4. 11
      modules/ts/misc/run.py

@ -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();

@ -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)

@ -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

@ -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")

Loading…
Cancel
Save