fixed gpu performance tests:

used new CV_PERF_TEST_MAIN_WITH_IMPLS mechanism
This commit is contained in:
Vladislav Vinogradov 2013-07-16 15:43:04 +04:00
parent 3443fd85cd
commit 4716f63444
14 changed files with 45 additions and 29 deletions

View File

@ -44,11 +44,4 @@
using namespace perf;
static const char * impls[] = {
#ifdef HAVE_CUDA
"cuda",
#endif
"plain"
};
CV_PERF_TEST_MAIN_WITH_IMPLS(gpu, impls, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpu)

View File

@ -52,16 +52,7 @@
#include "opencv2/ts.hpp"
#include "opencv2/ts/gpu_perf.hpp"
int main(int argc, char* argv[])
{
perf::printCudaInfo();
perf::Regression::Init("gpu_perf4au");
perf::TestBase::Init(argc, argv);
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
CV_PERF_TEST_CUDA_MAIN(gpu_perf4au)
//////////////////////////////////////////////////////////
// HoughLinesP

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpuarithm, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpuarithm)

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpubgsegm, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpubgsegm)

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpucodec, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpucodec)

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpufeatures2d, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpufeatures2d)

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpufilters, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpufilters)

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpuimgproc, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpuimgproc)

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpuoptflow, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpuoptflow)

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpustereo, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpustereo)

View File

@ -44,4 +44,4 @@
using namespace perf;
CV_PERF_TEST_MAIN(gpuwarping, printCudaInfo())
CV_PERF_TEST_CUDA_MAIN(gpuwarping)

View File

@ -1,3 +1,11 @@
#include "perf_precomp.hpp"
#include "opencv2/ts/gpu_perf.hpp"
CV_PERF_TEST_MAIN(photo)
static const char * impls[] = {
#ifdef HAVE_CUDA
"cuda",
#endif
"plain"
};
CV_PERF_TEST_MAIN_WITH_IMPLS(photo, impls, perf::printCudaInfo())

View File

@ -41,5 +41,13 @@
//M*/
#include "perf_precomp.hpp"
#include "opencv2/ts/gpu_perf.hpp"
CV_PERF_TEST_MAIN(softcascade)
static const char * impls[] = {
#ifdef HAVE_CUDA
"cuda",
#endif
"plain"
};
CV_PERF_TEST_MAIN_WITH_IMPLS(softcascade, impls, perf::printCudaInfo())

View File

@ -105,6 +105,22 @@ namespace perf
CV_EXPORTS void printCudaInfo();
CV_EXPORTS void sortKeyPoints(std::vector<cv::KeyPoint>& keypoints, cv::InputOutputArray _descriptors = cv::noArray());
#ifdef HAVE_CUDA
#define CV_PERF_TEST_CUDA_MAIN(modulename) \
int main(int argc, char **argv)\
{\
const char * impls[] = { "cuda", "plain" };\
CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, perf::printCudaInfo())\
}
#else
#define CV_PERF_TEST_CUDA_MAIN(modulename) \
int main(int argc, char **argv)\
{\
const char * plain_only[] = { "plain" };\
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only)\
}
#endif
}
#endif // __OPENCV_GPU_PERF_UTILITY_HPP__