GPU module performance tests are aligned with other OpenCV pefrofmance tests

This commit is contained in:
marina.kolpakova
2012-10-10 01:34:21 +04:00
parent 10f1004465
commit f5d6367ea1
5 changed files with 53 additions and 71 deletions

View File

@@ -205,6 +205,19 @@ private:
#define SANITY_CHECK_KEYPOINTS(array, ...) ::perf::Regression::addKeypoints(this, #array, array , ## __VA_ARGS__)
#define SANITY_CHECK_MATCHES(array, ...) ::perf::Regression::addMatches(this, #array, array , ## __VA_ARGS__)
#ifdef HAVE_CUDA
//#error "CUDA"
class CV_EXPORTS GpuPerf
{
public:
static bool targetDevice();
};
# define PERF_RUN_GPU() ::perf::GpuPerf::targetDevice()
#else
# define PERF_RUN_GPU()
#endif
/*****************************************************************************************\
* Container for performance metrics *

View File

@@ -26,6 +26,9 @@ const std::string command_line_keys =
#endif
"{ perf_max_deviation |1.0 |}"
"{ help h | |print help info}"
#ifdef HAVE_CUDA
"{ perf_run_cpu |false |run GPU performance tests for analogy CPU functions}"
#endif
;
static double param_max_outliers;
@@ -36,10 +39,15 @@ static uint64 param_seed;
static double param_time_limit;
static int param_tbb_nthreads;
static bool param_write_sanity;
#ifdef HAVE_CUDA
static bool param_run_cpu;
#endif
#ifdef ANDROID
static int param_affinity_mask;
static bool log_power_checkpoints;
#include <sys/syscall.h>
#include <pthread.h>
static void setCurrentThreadAffinityMask(int mask)
@@ -608,6 +616,10 @@ void TestBase::Init(int argc, const char* const argv[])
log_power_checkpoints = args.has("perf_log_power_checkpoints");
#endif
#ifdef HAVE_CUDA
param_run_cpu = args.has("perf_run_cpu");
#endif
if (!args.check())
{
args.printErrors();
@@ -1185,6 +1197,17 @@ TestBase::_declareHelper::_declareHelper(TestBase* t) : test(t)
{
}
/*****************************************************************************************\
* ::perf::GpuPerf
\*****************************************************************************************/
#ifdef HAVE_CUDA
bool perf::GpuPerf::targetDevice()
{
return !param_run_cpu;
}
#endif
/*****************************************************************************************\
* ::perf::PrintTo
\*****************************************************************************************/