switching to CL_PERF_TEST_P, adding safeFinish() to flush CL queue

This commit is contained in:
Andrey Pavlenko 2014-01-13 16:58:36 +04:00
parent 2c0e24e948
commit 520a692fda

View File

@ -1,6 +1,8 @@
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
#include <opencv2/imgproc.hpp> #include <opencv2/imgproc.hpp>
#include "opencv2/ts/ocl_perf.hpp"
using namespace std; using namespace std;
using namespace cv; using namespace cv;
using namespace perf; using namespace perf;
@ -10,14 +12,14 @@ using std::tr1::get;
typedef std::tr1::tuple<std::string, std::string, int> Cascade_Image_MinSize_t; typedef std::tr1::tuple<std::string, std::string, int> Cascade_Image_MinSize_t;
typedef perf::TestBaseWithParam<Cascade_Image_MinSize_t> Cascade_Image_MinSize; typedef perf::TestBaseWithParam<Cascade_Image_MinSize_t> Cascade_Image_MinSize;
PERF_TEST_P( Cascade_Image_MinSize, CascadeClassifier_UMat, OCL_PERF_TEST_P(Cascade_Image_MinSize, CascadeClassifier,
testing::Combine( testing::Combine(
testing::Values( string("cv/cascadeandhog/cascades/haarcascade_frontalface_alt.xml"), testing::Values( string("cv/cascadeandhog/cascades/haarcascade_frontalface_alt.xml"),
string("cv/cascadeandhog/cascades/lbpcascade_frontalface.xml") ), string("cv/cascadeandhog/cascades/lbpcascade_frontalface.xml") ),
testing::Values( string("cv/shared/lena.png"), testing::Values( string("cv/shared/lena.png"),
string("cv/cascadeandhog/images/bttf301.png"), string("cv/cascadeandhog/images/bttf301.png"),
string("cv/cascadeandhog/images/class57.png") ), string("cv/cascadeandhog/images/class57.png") ),
testing::Values(30, 64, 90) ) ) testing::Values(30, 64, 90) ) )
{ {
const string cascasePath = get<0>(GetParam()); const string cascasePath = get<0>(GetParam());
const string imagePath = get<1>(GetParam()); const string imagePath = get<1>(GetParam());
@ -42,6 +44,7 @@ PERF_TEST_P( Cascade_Image_MinSize, CascadeClassifier_UMat,
while(next()) while(next())
{ {
faces.clear(); faces.clear();
cvtest::ocl::perf::safeFinish();
startTimer(); startTimer();
cc.detectMultiScale(uimg, faces, 1.1, 3, 0, minSize); cc.detectMultiScale(uimg, faces, 1.1, 3, 0, minSize);