Skip to content

Commit bac7c26

Browse files
committed
features2d: add a separate regression test for OCL SURF
1 parent dae2c1b commit bac7c26

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

modules/xfeatures2d/test/test_features2d.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,10 +1027,34 @@ TEST( Features2d_DescriptorExtractor_SIFT, regression )
10271027

10281028
TEST( Features2d_DescriptorExtractor_SURF, regression )
10291029
{
1030+
#ifdef HAVE_OPENCL
1031+
bool useOCL = ocl::useOpenCL();
1032+
ocl::setUseOpenCL(false);
1033+
#endif
1034+
10301035
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-surf", 0.05f,
10311036
SURF::create() );
10321037
test.safe_run();
1038+
1039+
#ifdef HAVE_OPENCL
1040+
ocl::setUseOpenCL(useOCL);
1041+
#endif
1042+
}
1043+
1044+
#ifdef HAVE_OPENCL
1045+
TEST( Features2d_DescriptorExtractor_SURF_OCL, regression )
1046+
{
1047+
bool useOCL = ocl::useOpenCL();
1048+
ocl::setUseOpenCL(true);
1049+
if(ocl::useOpenCL())
1050+
{
1051+
CV_DescriptorExtractorTest<L2<float> > test( "descriptor-surf_ocl", 0.05f,
1052+
SURF::create() );
1053+
test.safe_run();
1054+
}
1055+
ocl::setUseOpenCL(useOCL);
10331056
}
1057+
#endif
10341058

10351059
TEST( Features2d_DescriptorExtractor_DAISY, regression )
10361060
{

0 commit comments

Comments
 (0)