Merge remote-tracking branch 'origin/2.4' into merge-2.4

Conflicts:
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/build_warps.cpp
	modules/ocl/src/color.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/split_merge.cpp
	modules/ocl/test/test_color.cpp
	samples/cpp/3calibration.cpp
	samples/cpp/OpenEXRimages_HDR_Retina_toneMapping.cpp
	samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp
	samples/cpp/Qt_sample/main.cpp
	samples/cpp/camshiftdemo.cpp
	samples/cpp/descriptor_extractor_matcher.cpp
	samples/cpp/distrans.cpp
	samples/cpp/generic_descriptor_match.cpp
	samples/cpp/grabcut.cpp
	samples/cpp/morphology2.cpp
	samples/cpp/segment_objects.cpp
	samples/cpp/stereo_calib.cpp
	samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp
	samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp
	samples/cpp/tutorial_code/introduction/display_image/display_image.cpp
	samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/Test.cpp
	samples/cpp/tutorial_code/objectDetection/objectDetection.cpp
	samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp
	samples/cpp/video_dmtx.cpp
This commit is contained in:
Roman Donchenko
2013-11-19 16:21:09 +04:00
110 changed files with 3002 additions and 1780 deletions

View File

@@ -112,8 +112,30 @@ 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)
#define OCL_TEST_CYCLE_N(n) for(declare.iterations(n); startTimer(), next(); cv::ocl::finish(), stopTimer())
#define OCL_TEST_CYCLE() for(; startTimer(), next(); cv::ocl::finish(), stopTimer())
#define OCL_TEST_CYCLE_MULTIRUN(runsNum) for(declare.runs(runsNum); startTimer(), next(); stopTimer()) for(int r = 0; r < runsNum; cv::ocl::finish(), ++r)
namespace cvtest {
namespace ocl {
inline void checkDeviceMaxMemoryAllocSize(const Size& size, int type, int factor = 1)
{
assert(factor > 0);
if (!(IMPL_OCL == perf::TestBase::getSelectedImpl()))
return; // OpenCL devices are not used
int cn = CV_MAT_CN(type);
int cn_ocl = cn == 3 ? 4 : cn;
int type_ocl = CV_MAKE_TYPE(CV_MAT_DEPTH(type), cn_ocl);
size_t memSize = size.area() * CV_ELEM_SIZE(type_ocl);
const cv::ocl::DeviceInfo& devInfo = cv::ocl::Context::getContext()->getDeviceInfo();
if (memSize * factor >= devInfo.maxMemAllocSize)
{
throw perf::TestBase::PerfSkipTestException();
}
}
} // namespace cvtest::ocl
} // namespace cvtest
using namespace cvtest::ocl;
#endif