mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 05:06:29 +08:00
appended ocl::finish to test_cycle defines
This commit is contained in:
parent
525b6eca2e
commit
3c86aa4ae1
@ -76,7 +76,7 @@ PERF_TEST_P(LUTFixture, LUT,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclLut(lut), oclDst(srcSize, dstType);
|
||||
|
||||
TEST_CYCLE() cv::ocl::LUT(oclSrc, oclLut, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::LUT(oclSrc, oclLut, oclDst);
|
||||
oclDst.download(dst);
|
||||
|
||||
SANITY_CHECK(dst);
|
||||
@ -111,7 +111,7 @@ PERF_TEST_P(ExpFixture, Exp, OCL_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, src.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::exp(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::exp(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -150,7 +150,7 @@ PERF_TEST_P(LogFixture, Log, OCL_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, src.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::log(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::log(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -190,7 +190,7 @@ PERF_TEST_P(AddFixture, Add,
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::add(oclSrc1, oclSrc2, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::add(oclSrc1, oclSrc2, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -229,7 +229,7 @@ PERF_TEST_P(MulFixture, Mul, ::testing::Combine(OCL_TYPICAL_MAT_SIZES,
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::multiply(oclSrc1, oclSrc2, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::multiply(oclSrc1, oclSrc2, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -275,7 +275,7 @@ PERF_TEST_P(DivFixture, Div,
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::divide(oclSrc1, oclSrc2, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::divide(oclSrc1, oclSrc2, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -312,7 +312,7 @@ PERF_TEST_P(AbsDiffFixture, Absdiff,
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::absdiff(oclSrc1, oclSrc2, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::absdiff(oclSrc1, oclSrc2, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -351,7 +351,7 @@ PERF_TEST_P(CartToPolarFixture, CartToPolar, OCL_TYPICAL_MAT_SIZES)
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2),
|
||||
oclDst1(srcSize, src1.type()), oclDst2(srcSize, src1.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::cartToPolar(oclSrc1, oclSrc2, oclDst1, oclDst2);
|
||||
OCL_TEST_CYCLE() cv::ocl::cartToPolar(oclSrc1, oclSrc2, oclDst1, oclDst2);
|
||||
|
||||
oclDst1.download(dst1);
|
||||
oclDst2.download(dst2);
|
||||
@ -392,7 +392,7 @@ PERF_TEST_P(PolarToCartFixture, PolarToCart, OCL_TYPICAL_MAT_SIZES)
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2),
|
||||
oclDst1(srcSize, src1.type()), oclDst2(srcSize, src1.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::polarToCart(oclSrc1, oclSrc2, oclDst1, oclDst2);
|
||||
OCL_TEST_CYCLE() cv::ocl::polarToCart(oclSrc1, oclSrc2, oclDst1, oclDst2);
|
||||
|
||||
oclDst1.download(dst1);
|
||||
oclDst2.download(dst2);
|
||||
@ -430,7 +430,7 @@ PERF_TEST_P(MagnitudeFixture, Magnitude, OCL_TYPICAL_MAT_SIZES)
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2),
|
||||
oclDst(srcSize, src1.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::magnitude(oclSrc1, oclSrc2, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::magnitude(oclSrc1, oclSrc2, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -465,7 +465,7 @@ PERF_TEST_P(TransposeFixture, Transpose,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::transpose(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::transpose(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -500,7 +500,7 @@ PERF_TEST_P(FlipFixture, Flip,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::flip(oclSrc, oclDst, 0);
|
||||
OCL_TEST_CYCLE() cv::ocl::flip(oclSrc, oclDst, 0);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -538,7 +538,7 @@ PERF_TEST_P(minMaxFixture, minMax,
|
||||
{
|
||||
ocl::oclMat oclSrc(src);
|
||||
|
||||
TEST_CYCLE() cv::ocl::minMax(oclSrc, &min_val, &max_val);
|
||||
OCL_TEST_CYCLE() cv::ocl::minMax(oclSrc, &min_val, &max_val);
|
||||
|
||||
ASSERT_GE(max_val, min_val);
|
||||
SANITY_CHECK(min_val);
|
||||
@ -581,7 +581,7 @@ PERF_TEST_P(minMaxLocFixture, minMaxLoc,
|
||||
{
|
||||
ocl::oclMat oclSrc(src);
|
||||
|
||||
TEST_CYCLE() cv::ocl::minMaxLoc(oclSrc, &min_val, &max_val, &min_loc, &max_loc);
|
||||
OCL_TEST_CYCLE() cv::ocl::minMaxLoc(oclSrc, &min_val, &max_val, &min_loc, &max_loc);
|
||||
|
||||
ASSERT_GE(max_val, min_val);
|
||||
SANITY_CHECK(min_val);
|
||||
@ -620,7 +620,7 @@ PERF_TEST_P(SumFixture, Sum,
|
||||
{
|
||||
ocl::oclMat oclSrc(src);
|
||||
|
||||
TEST_CYCLE() result = cv::ocl::sum(oclSrc);
|
||||
OCL_TEST_CYCLE() result = cv::ocl::sum(oclSrc);
|
||||
|
||||
SANITY_CHECK(result);
|
||||
}
|
||||
@ -655,7 +655,7 @@ PERF_TEST_P(countNonZeroFixture, countNonZero,
|
||||
{
|
||||
ocl::oclMat oclSrc(src);
|
||||
|
||||
TEST_CYCLE() result = cv::ocl::countNonZero(oclSrc);
|
||||
OCL_TEST_CYCLE() result = cv::ocl::countNonZero(oclSrc);
|
||||
|
||||
SANITY_CHECK(result);
|
||||
}
|
||||
@ -688,7 +688,7 @@ PERF_TEST_P(PhaseFixture, Phase, OCL_TYPICAL_MAT_SIZES)
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2),
|
||||
oclDst(srcSize, src1.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::phase(oclSrc1, oclSrc2, oclDst, 1);
|
||||
OCL_TEST_CYCLE() cv::ocl::phase(oclSrc1, oclSrc2, oclDst, 1);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -725,7 +725,7 @@ PERF_TEST_P(BitwiseAndFixture, bitwise_and,
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst(srcSize, src1.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::bitwise_and(oclSrc1, oclSrc2, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::bitwise_and(oclSrc1, oclSrc2, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -760,7 +760,7 @@ PERF_TEST_P(BitwiseAndFixture, bitwise_not,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::bitwise_not(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::bitwise_not(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -795,7 +795,7 @@ PERF_TEST_P(CompareFixture, compare,
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst(srcSize, CV_8UC1);
|
||||
|
||||
TEST_CYCLE() cv::ocl::compare(oclSrc1, oclSrc2, oclDst, CMP_EQ);
|
||||
OCL_TEST_CYCLE() cv::ocl::compare(oclSrc1, oclSrc2, oclDst, CMP_EQ);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -826,7 +826,7 @@ PERF_TEST_P(PowFixture, pow, OCL_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, src.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::pow(oclSrc, -2.0, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::pow(oclSrc, -2.0, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -858,7 +858,7 @@ PERF_TEST_P(MagnitudeSqrFixture, MagnitudeSqr, OCL_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst(srcSize, src1.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::magnitudeSqr(oclSrc1, oclSrc2, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::magnitudeSqr(oclSrc1, oclSrc2, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -910,7 +910,7 @@ PERF_TEST_P(AddWeightedFixture, AddWeighted,
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::addWeighted(oclSrc1, alpha, oclSrc2, beta, gama, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::addWeighted(oclSrc1, alpha, oclSrc2, beta, gama, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
|
@ -97,7 +97,7 @@ PERF_TEST_P(blendLinearFixture, blendLinear, OCL_TYPICAL_MAT_SIZES)
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2), oclDst;
|
||||
ocl::oclMat oclWeights1(weights1), oclWeights2(weights2);
|
||||
|
||||
TEST_CYCLE() cv::ocl::blendLinear(oclSrc1, oclSrc2, oclWeights1, oclWeights2, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::blendLinear(oclSrc1, oclSrc2, oclWeights1, oclWeights2, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
|
@ -76,7 +76,7 @@ PERF_TEST_P(BruteForceMatcherFixture, DISABLED_match,
|
||||
ocl::BruteForceMatcher_OCL_base oclMatcher(ocl::BruteForceMatcher_OCL_base::L2Dist);
|
||||
ocl::oclMat oclQuery(query), oclTrain(train);
|
||||
|
||||
TEST_CYCLE() oclMatcher.match(oclQuery, oclTrain, matches);
|
||||
OCL_TEST_CYCLE() oclMatcher.match(oclQuery, oclTrain, matches);
|
||||
|
||||
SANITY_CHECK_MATCHES(matches);
|
||||
}
|
||||
@ -112,7 +112,7 @@ PERF_TEST_P(BruteForceMatcherFixture, DISABLED_knnMatch,
|
||||
ocl::BruteForceMatcher_OCL_base oclMatcher(ocl::BruteForceMatcher_OCL_base::L2Dist);
|
||||
ocl::oclMat oclQuery(query), oclTrain(train);
|
||||
|
||||
TEST_CYCLE() oclMatcher.knnMatch(oclQuery, oclTrain, matches, 2);
|
||||
OCL_TEST_CYCLE() oclMatcher.knnMatch(oclQuery, oclTrain, matches, 2);
|
||||
|
||||
std::vector<DMatch> & matches0 = matches[0], & matches1 = matches[1];
|
||||
SANITY_CHECK_MATCHES(matches0);
|
||||
@ -150,7 +150,7 @@ PERF_TEST_P(BruteForceMatcherFixture, DISABLED_radiusMatch,
|
||||
ocl::oclMat oclQuery(query), oclTrain(train);
|
||||
ocl::BruteForceMatcher_OCL_base oclMatcher(ocl::BruteForceMatcher_OCL_base::L2Dist);
|
||||
|
||||
TEST_CYCLE() oclMatcher.radiusMatch(oclQuery, oclTrain, matches, max_distance);
|
||||
OCL_TEST_CYCLE() oclMatcher.radiusMatch(oclQuery, oclTrain, matches, max_distance);
|
||||
|
||||
std::vector<DMatch> & matches0 = matches[0], & matches1 = matches[1];
|
||||
SANITY_CHECK_MATCHES(matches0);
|
||||
|
@ -69,7 +69,7 @@ PERF_TEST(StereoMatchBMFixture, DISABLED_StereoMatchBM) // TODO doesn't work pro
|
||||
oclDisp(left_image.size(), CV_16SC1);
|
||||
ocl::StereoBM_OCL oclBM(0, n_disp, winSize);
|
||||
|
||||
TEST_CYCLE() oclBM(oclLeft, oclRight, oclDisp);
|
||||
OCL_TEST_CYCLE() oclBM(oclLeft, oclRight, oclDisp);
|
||||
|
||||
oclDisp.download(disp);
|
||||
|
||||
|
@ -61,7 +61,7 @@ PERF_TEST(CannyFixture, DISABLED_Canny) // TODO difference between implmentation
|
||||
{
|
||||
ocl::oclMat oclImg(img), oclEdges(img.size(), CV_8UC1);
|
||||
|
||||
TEST_CYCLE() ocl::Canny(oclImg, oclEdges, 50.0, 100.0);
|
||||
OCL_TEST_CYCLE() ocl::Canny(oclImg, oclEdges, 50.0, 100.0);
|
||||
oclEdges.download(edges);
|
||||
|
||||
SANITY_CHECK(edges);
|
||||
|
@ -62,7 +62,7 @@ PERF_TEST_P(cvtColorFixture, cvtColor, OCL_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(src.size(), CV_8UC4);
|
||||
|
||||
TEST_CYCLE() ocl::cvtColor(oclSrc, oclDst, CV_RGBA2GRAY, 4);
|
||||
OCL_TEST_CYCLE() ocl::cvtColor(oclSrc, oclDst, CV_RGBA2GRAY, 4);
|
||||
oclDst.download(dst);
|
||||
|
||||
SANITY_CHECK(dst);
|
||||
|
@ -66,7 +66,7 @@ PERF_TEST_P(dftFixture, DISABLED_dft, OCL_TYPICAL_MAT_SIZES) // TODO not impleme
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst;
|
||||
|
||||
TEST_CYCLE() cv::ocl::dft(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::dft(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
|
@ -71,7 +71,7 @@ PERF_TEST_P(BlurFixture, Blur,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::blur(oclSrc, oclDst, ksize, Point(-1, -1), bordertype);
|
||||
OCL_TEST_CYCLE() cv::ocl::blur(oclSrc, oclDst, ksize, Point(-1, -1), bordertype);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -109,7 +109,7 @@ PERF_TEST_P(LaplacianFixture, Laplacian,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::Laplacian(oclSrc, oclDst, -1, ksize, 1);
|
||||
OCL_TEST_CYCLE() cv::ocl::Laplacian(oclSrc, oclDst, -1, ksize, 1);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -148,7 +148,7 @@ PERF_TEST_P(ErodeFixture, Erode,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type), oclKer(ker);
|
||||
|
||||
TEST_CYCLE() cv::ocl::erode(oclSrc, oclDst, oclKer);
|
||||
OCL_TEST_CYCLE() cv::ocl::erode(oclSrc, oclDst, oclKer);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -189,7 +189,7 @@ PERF_TEST_P(SobelFixture, Sobel,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::Sobel(oclSrc, oclDst, -1, dx, dy);
|
||||
OCL_TEST_CYCLE() cv::ocl::Sobel(oclSrc, oclDst, -1, dx, dy);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -230,7 +230,7 @@ PERF_TEST_P(ScharrFixture, Scharr,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::Scharr(oclSrc, oclDst, -1, dx, dy);
|
||||
OCL_TEST_CYCLE() cv::ocl::Scharr(oclSrc, oclDst, -1, dx, dy);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -267,7 +267,7 @@ PERF_TEST_P(GaussianBlurFixture, GaussianBlur,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::GaussianBlur(oclSrc, oclDst, Size(ksize, ksize), 0);
|
||||
OCL_TEST_CYCLE() cv::ocl::GaussianBlur(oclSrc, oclDst, Size(ksize, ksize), 0);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -306,7 +306,7 @@ PERF_TEST_P(filter2DFixture, filter2D,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type), oclKernel(kernel);
|
||||
|
||||
TEST_CYCLE() cv::ocl::filter2D(oclSrc, oclDst, -1, oclKernel);
|
||||
OCL_TEST_CYCLE() cv::ocl::filter2D(oclSrc, oclDst, -1, oclKernel);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
|
@ -67,7 +67,7 @@ PERF_TEST_P(gemmFixture, DISABLED_gemm, OCL_TYPICAL_MAT_SIZES) // TODO not imple
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2),
|
||||
oclSrc3(src3), oclDst(srcSize, CV_32FC1);
|
||||
|
||||
TEST_CYCLE() cv::ocl::gemm(oclSrc1, oclSrc2, 1.0, oclSrc3, 1.0, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::gemm(oclSrc1, oclSrc2, 1.0, oclSrc3, 1.0, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
|
@ -77,7 +77,7 @@ PERF_TEST_P(GoodFeaturesToTrackFixture, GoodFeaturesToTrack,
|
||||
ocl::oclMat oclFrame(frame), pts_oclmat;
|
||||
ocl::GoodFeaturesToTrackDetector_OCL detector(maxCorners, qualityLevel, minDistance);
|
||||
|
||||
TEST_CYCLE() detector(oclFrame, pts_oclmat);
|
||||
OCL_TEST_CYCLE() detector(oclFrame, pts_oclmat);
|
||||
|
||||
detector.downloadPoints(pts_oclmat, pts_gold);
|
||||
|
||||
|
@ -113,7 +113,7 @@ PERF_TEST(HaarFixture, Haar)
|
||||
ASSERT_TRUE(faceCascade.load(getDataPath("gpu/haarcascade/haarcascade_frontalface_alt.xml")))
|
||||
<< "can't load haarcascade_frontalface_alt.xml";
|
||||
|
||||
TEST_CYCLE() faceCascade.detectMultiScale(oclImg, faces,
|
||||
OCL_TEST_CYCLE() faceCascade.detectMultiScale(oclImg, faces,
|
||||
1.1, 2, 0 | CV_HAAR_SCALE_IMAGE, Size(30, 30));
|
||||
|
||||
SANITY_CHECK(faces, 4 + 1e-4);
|
||||
|
@ -72,7 +72,7 @@ PERF_TEST(HOGFixture, HOG)
|
||||
ocl_hog.setSVMDetector(ocl_hog.getDefaultPeopleDetector());
|
||||
ocl::oclMat oclSrc(src);
|
||||
|
||||
TEST_CYCLE() ocl_hog.detectMultiScale(oclSrc, found_locations);
|
||||
OCL_TEST_CYCLE() ocl_hog.detectMultiScale(oclSrc, found_locations);
|
||||
|
||||
SANITY_CHECK(found_locations, 1 + DBL_EPSILON);
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ PERF_TEST_P(equalizeHistFixture, equalizeHist, OCL_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, src.type());
|
||||
|
||||
TEST_CYCLE() cv::ocl::equalizeHist(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::equalizeHist(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -101,7 +101,7 @@ PERF_TEST_P(CopyMakeBorderFixture, CopyMakeBorder,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(dstSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::copyMakeBorder(oclSrc, oclDst, 7, 5, 5, 7, borderType, cv::Scalar(1.0));
|
||||
OCL_TEST_CYCLE() cv::ocl::copyMakeBorder(oclSrc, oclDst, 7, 5, 5, 7, borderType, cv::Scalar(1.0));
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -141,7 +141,7 @@ PERF_TEST_P(cornerMinEigenValFixture, cornerMinEigenVal,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, CV_32FC1);
|
||||
|
||||
TEST_CYCLE() cv::ocl::cornerMinEigenVal(oclSrc, oclDst, blockSize, apertureSize, borderType);
|
||||
OCL_TEST_CYCLE() cv::ocl::cornerMinEigenVal(oclSrc, oclDst, blockSize, apertureSize, borderType);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -178,7 +178,7 @@ PERF_TEST_P(cornerHarrisFixture, cornerHarris,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, CV_32FC1);
|
||||
|
||||
TEST_CYCLE() cv::ocl::cornerHarris(oclSrc, oclDst, 5, 7, 0.1, borderType);
|
||||
OCL_TEST_CYCLE() cv::ocl::cornerHarris(oclSrc, oclDst, 5, 7, 0.1, borderType);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -209,7 +209,7 @@ PERF_TEST_P(integralFixture, DISABLED_integral, OCL_TYPICAL_MAT_SIZES) // TODO d
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst;
|
||||
|
||||
TEST_CYCLE() cv::ocl::integral(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::integral(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -252,7 +252,7 @@ PERF_TEST_P(WarpAffineFixture, WarpAffine,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::warpAffine(oclSrc, oclDst, M, srcSize, interpolation);
|
||||
OCL_TEST_CYCLE() cv::ocl::warpAffine(oclSrc, oclDst, M, srcSize, interpolation);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -297,7 +297,7 @@ PERF_TEST_P(WarpPerspectiveFixture, WarpPerspective,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::warpPerspective(oclSrc, oclDst, M, srcSize, interpolation);
|
||||
OCL_TEST_CYCLE() cv::ocl::warpPerspective(oclSrc, oclDst, M, srcSize, interpolation);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -342,7 +342,7 @@ PERF_TEST_P(resizeFixture, resize,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(dstSize, type);
|
||||
|
||||
TEST_CYCLE() cv::ocl::resize(oclSrc, oclDst, Size(), scale, scale, interType);
|
||||
OCL_TEST_CYCLE() cv::ocl::resize(oclSrc, oclDst, Size(), scale, scale, interType);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -381,7 +381,7 @@ PERF_TEST_P(ThreshFixture, threshold,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, CV_8U);
|
||||
|
||||
TEST_CYCLE() cv::ocl::threshold(oclSrc, oclDst, 50.0, 0.0, threshType);
|
||||
OCL_TEST_CYCLE() cv::ocl::threshold(oclSrc, oclDst, 50.0, 0.0, threshType);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -611,7 +611,7 @@ PERF_TEST_P(meanShiftFilteringFixture, meanShiftFiltering,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, CV_8UC4);
|
||||
|
||||
TEST_CYCLE() ocl::meanShiftFiltering(oclSrc, oclDst, sp, sr, crit);
|
||||
OCL_TEST_CYCLE() ocl::meanShiftFiltering(oclSrc, oclDst, sp, sr, crit);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -706,7 +706,7 @@ PERF_TEST_P(meanShiftProcFixture, meanShiftProc,
|
||||
ocl::oclMat oclSrc(src), oclDst1(srcSize, CV_8UC4),
|
||||
oclDst2(srcSize, CV_16SC2);
|
||||
|
||||
TEST_CYCLE() ocl::meanShiftProc(oclSrc, oclDst1, oclDst2, 5, 6, crit);
|
||||
OCL_TEST_CYCLE() ocl::meanShiftProc(oclSrc, oclDst1, oclDst2, 5, 6, crit);
|
||||
|
||||
oclDst1.download(dst1);
|
||||
oclDst2.download(dst2);
|
||||
@ -763,7 +763,7 @@ PERF_TEST_P(remapFixture, remap,
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
ocl::oclMat oclXMap(xmap), oclYMap(ymap);
|
||||
|
||||
TEST_CYCLE() cv::ocl::remap(oclSrc, oclDst, oclXMap, oclYMap, interpolation, borderMode);
|
||||
OCL_TEST_CYCLE() cv::ocl::remap(oclSrc, oclDst, oclXMap, oclYMap, interpolation, borderMode);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -800,7 +800,7 @@ PERF_TEST_P(CLAHEFixture, CLAHE, OCL_TYPICAL_MAT_SIZES)
|
||||
ocl::oclMat oclSrc(src), oclDst;
|
||||
cv::Ptr<cv::CLAHE> oclClahe = cv::ocl::createCLAHE(clipLimit);
|
||||
|
||||
TEST_CYCLE() oclClahe->apply(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() oclClahe->apply(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -845,7 +845,7 @@ PERF_TEST_P(columnSumFixture, columnSum, OCL_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, CV_32FC1);
|
||||
|
||||
TEST_CYCLE() cv::ocl::columnSum(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::columnSum(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
|
@ -72,7 +72,7 @@ PERF_TEST_P(CV_TM_CCORRFixture, matchTemplate,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclTempl(templ), oclDst(dstSize, CV_32F);
|
||||
|
||||
TEST_CYCLE() cv::ocl::matchTemplate(oclSrc, oclTempl, oclDst, CV_TM_CCORR);
|
||||
OCL_TEST_CYCLE() cv::ocl::matchTemplate(oclSrc, oclTempl, oclDst, CV_TM_CCORR);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -104,7 +104,7 @@ PERF_TEST_P(CV_TM_CCORR_NORMEDFixture, matchTemplate, OCL_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclTempl(templ), oclDst(dstSize, CV_8UC1);
|
||||
|
||||
TEST_CYCLE() cv::ocl::matchTemplate(oclSrc, oclTempl, oclDst, CV_TM_CCORR_NORMED);
|
||||
OCL_TEST_CYCLE() cv::ocl::matchTemplate(oclSrc, oclTempl, oclDst, CV_TM_CCORR_NORMED);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
|
@ -70,7 +70,7 @@ PERF_TEST_P(ConvertToFixture, ConvertTo,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, dstType);
|
||||
|
||||
TEST_CYCLE() oclSrc.convertTo(oclDst, dstType);
|
||||
OCL_TEST_CYCLE() oclSrc.convertTo(oclDst, dstType);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -105,7 +105,7 @@ PERF_TEST_P(copyToFixture, copyTo,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(srcSize, type);
|
||||
|
||||
TEST_CYCLE() oclSrc.copyTo(oclDst);
|
||||
OCL_TEST_CYCLE() oclSrc.copyTo(oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -141,7 +141,7 @@ PERF_TEST_P(setToFixture, setTo,
|
||||
{
|
||||
ocl::oclMat oclSrc(srcSize, type);
|
||||
|
||||
TEST_CYCLE() oclSrc.setTo(val);
|
||||
OCL_TEST_CYCLE() oclSrc.setTo(val);
|
||||
oclSrc.download(src);
|
||||
|
||||
SANITY_CHECK(src);
|
||||
|
@ -72,7 +72,7 @@ PERF_TEST_P(MomentsFixture, DISABLED_Moments,
|
||||
{
|
||||
ocl::oclMat oclSrc(src);
|
||||
|
||||
TEST_CYCLE() mom = cv::ocl::ocl_moments(oclSrc, binaryImage); // TODO Use oclSrc
|
||||
OCL_TEST_CYCLE() mom = cv::ocl::ocl_moments(oclSrc, binaryImage); // TODO Use oclSrc
|
||||
cv::HuMoments(mom, dst);
|
||||
|
||||
SANITY_CHECK(dst);
|
||||
|
@ -68,7 +68,7 @@ PERF_TEST_P(normFixture, DISABLED_norm, OCL_TYPICAL_MAT_SIZES) // TODO doesn't w
|
||||
{
|
||||
ocl::oclMat oclSrc1(src1), oclSrc2(src2);
|
||||
|
||||
TEST_CYCLE() value = cv::ocl::norm(oclSrc1, oclSrc2, NORM_INF);
|
||||
OCL_TEST_CYCLE() value = cv::ocl::norm(oclSrc1, oclSrc2, NORM_INF);
|
||||
|
||||
SANITY_CHECK(value);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ PERF_TEST_P(PyrLKOpticalFlowFixture,
|
||||
ocl::oclMat oclPts(1, static_cast<int>(pts.size()), CV_32FC2, (void *)&pts[0]);
|
||||
ocl::oclMat oclNextPts, oclStatus, oclErr;
|
||||
|
||||
TEST_CYCLE()
|
||||
OCL_TEST_CYCLE()
|
||||
oclPyrLK.sparse(oclFrame0, oclFrame1, oclPts, oclNextPts, oclStatus, &oclErr);
|
||||
|
||||
MatToVector(oclNextPts, nextPts);
|
||||
@ -175,7 +175,7 @@ PERF_TEST(tvl1flowFixture, tvl1flow)
|
||||
ocl::oclMat oclFrame0(frame0), oclFrame1(frame1), oclFlow1(srcSize, CV_32FC1),
|
||||
oclFlow2(srcSize, CV_32FC1);
|
||||
|
||||
TEST_CYCLE() oclAlg(oclFrame0, oclFrame1, oclFlow1, oclFlow2);
|
||||
OCL_TEST_CYCLE() oclAlg(oclFrame0, oclFrame1, oclFlow1, oclFlow2);
|
||||
|
||||
oclAlg.collectGarbage();
|
||||
|
||||
@ -259,7 +259,7 @@ PERF_TEST_P(FarnebackOpticalFlowFixture, FarnebackOpticalFlow,
|
||||
farn.flags |= OPTFLOW_USE_INITIAL_FLOW;
|
||||
}
|
||||
|
||||
TEST_CYCLE()
|
||||
OCL_TEST_CYCLE()
|
||||
farn(oclFrame0, oclFrame1, oclFlowx, oclFlowy);
|
||||
|
||||
oclFlowx.download(flowx);
|
||||
|
@ -102,4 +102,8 @@ using namespace cv;
|
||||
CV_TEST_FAIL_NO_IMPL();
|
||||
#endif
|
||||
|
||||
#define OCL_TEST_CYCLE_N(n) for(declare.iterations(n); startTimer(), next(); ocl::finish(), stopTimer())
|
||||
#define OCL_TEST_CYCLE() for(; startTimer(), next(); ocl::finish(), stopTimer())
|
||||
#define OCL_TEST_CYCLE_MULTIRUN(runsNum) for(declare.runs(runsNum); startTimer(), next(); stopTimer()) for(int r = 0; r < runsNum; ocl::finish(), ++r)
|
||||
|
||||
#endif
|
||||
|
@ -70,7 +70,7 @@ PERF_TEST_P(pyrDownFixture, pyrDown,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(dstSize, type);
|
||||
|
||||
TEST_CYCLE() ocl::pyrDown(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() ocl::pyrDown(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -107,7 +107,7 @@ PERF_TEST_P(pyrUpFixture, pyrUp,
|
||||
{
|
||||
ocl::oclMat oclSrc(src), oclDst(dstSize, type);
|
||||
|
||||
TEST_CYCLE() ocl::pyrDown(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() ocl::pyrDown(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
|
@ -78,7 +78,7 @@ PERF_TEST_P(MergeFixture, Merge,
|
||||
for (vector<ocl::oclMat>::size_type i = 0, end = src.size(); i < end; ++i)
|
||||
oclSrc[i] = src[i];
|
||||
|
||||
TEST_CYCLE() cv::ocl::merge(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::merge(oclSrc, oclDst);
|
||||
|
||||
oclDst.download(dst);
|
||||
|
||||
@ -114,7 +114,7 @@ PERF_TEST_P(SplitFixture, Split,
|
||||
ocl::oclMat oclSrc(src);
|
||||
vector<ocl::oclMat> oclDst(channels, ocl::oclMat(srcSize, CV_MAKE_TYPE(depth, 1)));
|
||||
|
||||
TEST_CYCLE() cv::ocl::split(oclSrc, oclDst);
|
||||
OCL_TEST_CYCLE() cv::ocl::split(oclSrc, oclDst);
|
||||
|
||||
ASSERT_EQ(3, channels);
|
||||
Mat dst0, dst1, dst2;
|
||||
|
Loading…
Reference in New Issue
Block a user