diff --git a/CMakeLists.txt b/CMakeLists.txt index 90b4a2669b52..d1f5732b399a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -295,7 +295,7 @@ OCV_OPTION(WITH_NGRAPH "Include nGraph support" WITH_INF_ENGINE OCV_OPTION(WITH_JASPER "Include JPEG2K support (Jasper)" ON VISIBLE_IF NOT IOS VERIFY HAVE_JASPER) -OCV_OPTION(WITH_OPENJPEG "Include JPEG2K support (OpenJPEG)" ON +OCV_OPTION(WITH_OPENJPEG "Include JPEG2K support (OpenJPEG)" OFF VISIBLE_IF NOT IOS VERIFY HAVE_OPENJPEG) OCV_OPTION(WITH_JPEG "Include JPEG support" ON diff --git a/modules/core/src/copy.cpp b/modules/core/src/copy.cpp index 7f4329df7823..886f69ead2f6 100644 --- a/modules/core/src/copy.cpp +++ b/modules/core/src/copy.cpp @@ -981,11 +981,11 @@ static bool ipp_flip(Mat &src, Mat &dst, int flip_mode) CV_INSTRUMENT_REGION_IPP(); // Details: https://github.com/opencv/opencv/issues/12943 - if (flip_mode <= 0 /* swap rows */ - && cv::ipp::getIppTopFeatures() != ippCPUID_SSE42 - && (int64_t)(src.total()) * src.elemSize() >= CV_BIG_INT(0x80000000)/*2Gb*/ - ) - return false; + // if (flip_mode <= 0 /* swap rows */ + // && cv::ipp::getIppTopFeatures() != ippCPUID_SSE42 + // && (int64_t)(src.total()) * src.elemSize() >= CV_BIG_INT(0x80000000)/*2Gb*/ + // ) + // return false; IppiAxis ippMode; if(flip_mode < 0) diff --git a/modules/core/src/matrix_operations.cpp b/modules/core/src/matrix_operations.cpp index ac94ecee7d6d..122519f6ecd7 100644 --- a/modules/core/src/matrix_operations.cpp +++ b/modules/core/src/matrix_operations.cpp @@ -8,11 +8,11 @@ #include "opencl_kernels_core.hpp" #include "precomp.hpp" -#undef HAVE_IPP -#undef CV_IPP_RUN_FAST -#define CV_IPP_RUN_FAST(f, ...) -#undef CV_IPP_RUN -#define CV_IPP_RUN(c, f, ...) +// #undef HAVE_IPP +// #undef CV_IPP_RUN_FAST +// #define CV_IPP_RUN_FAST(f, ...) +// #undef CV_IPP_RUN +// #define CV_IPP_RUN(c, f, ...) /*************************************************************************************************\ Matrix Operations diff --git a/modules/core/src/mean.dispatch.cpp b/modules/core/src/mean.dispatch.cpp index 7a8f9413fc41..3c837c137d33 100644 --- a/modules/core/src/mean.dispatch.cpp +++ b/modules/core/src/mean.dispatch.cpp @@ -8,11 +8,11 @@ #include "opencv2/core/openvx/ovx_defs.hpp" #include "stat.hpp" -#undef HAVE_IPP -#undef CV_IPP_RUN_FAST -#define CV_IPP_RUN_FAST(f, ...) -#undef CV_IPP_RUN -#define CV_IPP_RUN(c, f, ...) +// #undef HAVE_IPP +// #undef CV_IPP_RUN_FAST +// #define CV_IPP_RUN_FAST(f, ...) +// #undef CV_IPP_RUN +// #define CV_IPP_RUN(c, f, ...) #include "mean.simd.hpp" #include "mean.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content diff --git a/modules/core/src/minmax.cpp b/modules/core/src/minmax.cpp index 61bddc3d3567..68658261da91 100644 --- a/modules/core/src/minmax.cpp +++ b/modules/core/src/minmax.cpp @@ -8,11 +8,11 @@ #include "opencv2/core/openvx/ovx_defs.hpp" #include "stat.hpp" -#undef HAVE_IPP -#undef CV_IPP_RUN_FAST -#define CV_IPP_RUN_FAST(f, ...) -#undef CV_IPP_RUN -#define CV_IPP_RUN(c, f, ...) +// #undef HAVE_IPP +// #undef CV_IPP_RUN_FAST +// #define CV_IPP_RUN_FAST(f, ...) +// #undef CV_IPP_RUN +// #define CV_IPP_RUN(c, f, ...) #define IPP_DISABLE_MINMAXIDX_MANY_ROWS 1 // see Core_MinMaxIdx.rows_overflow test diff --git a/modules/core/src/norm.cpp b/modules/core/src/norm.cpp index 088c163c873b..f5f4513ed4f2 100644 --- a/modules/core/src/norm.cpp +++ b/modules/core/src/norm.cpp @@ -1008,16 +1008,17 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra type == CV_16UC3 ? (ippiMaskNormDiffFuncC3)ippiNormDiff_L2_16u_C3CMR : type == CV_32FC3 ? (ippiMaskNormDiffFuncC3)ippiNormDiff_L2_32f_C3CMR : 0) : 0; - if (cv::ipp::getIppTopFeatures() & ( -#if IPP_VERSION_X100 >= 201700 - ippCPUID_AVX512F | -#endif - ippCPUID_AVX2) - ) // IPP_DISABLE_NORM_16UC3_mask_small (#11399) - { - if (normType == NORM_L1 && type == CV_16UC3 && sz.width < 16) - return false; - } + // if (cv::ipp::getIppTopFeatures() & ippCPUID_AVX2) + // if (cv::ipp::getIppTopFeatures() & ( +// #if IPP_VERSION_X100 >= 201700 +// ippCPUID_AVX512F | +// #endif +// ippCPUID_AVX2) +// ) // IPP_DISABLE_NORM_16UC3_mask_small (#11399) + // { + // if (normType == NORM_L1 && type == CV_16UC3 && sz.width < 16) + // return false; + // } if( ippiNormDiff_C3CMR ) { Ipp64f norm1, norm2, norm3; diff --git a/modules/core/src/sum.dispatch.cpp b/modules/core/src/sum.dispatch.cpp index 20caca9f0453..9c8515592606 100644 --- a/modules/core/src/sum.dispatch.cpp +++ b/modules/core/src/sum.dispatch.cpp @@ -10,11 +10,11 @@ #include "sum.simd.hpp" #include "sum.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content -#undef HAVE_IPP +/* #undef HAVE_IPP #undef CV_IPP_RUN_FAST #define CV_IPP_RUN_FAST(f, ...) #undef CV_IPP_RUN -#define CV_IPP_RUN(c, f, ...) +#define CV_IPP_RUN(c, f, ...) */ namespace cv { diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index 3acf77035ffc..496b307ccade 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -2303,6 +2303,7 @@ struct IPPInitSingleton if(env == "disabled") { + printf("Hi there! env is disabled!!!\n"); std::cerr << "WARNING: IPP was disabled by OPENCV_IPP environment variable" << std::endl; useIPP = false; } @@ -2337,6 +2338,12 @@ struct IPPInitSingleton )) { useIPP = false; + printf("cpuFeatures = %lu\n", cpuFeatures); + printf("cpuFeatures&ippCPUID_AVX512F = %lu\n", cpuFeatures&ippCPUID_AVX512F); + printf("cpuFeatures&ippCPUID_AVX2 = %lu\n", cpuFeatures&ippCPUID_AVX2); + printf("cpuFeatures&ippCPUID_SSE42 = %lu\n", cpuFeatures&ippCPUID_SSE42); + printf("ippCPUID_SSE42 = %lu\n", ippCPUID_SSE42); + printf("useIPP 0 = %d\n", useIPP); return; } diff --git a/modules/core/test/test_arithm.cpp b/modules/core/test/test_arithm.cpp index 75a7004f8191..756957a8d15f 100644 --- a/modules/core/test/test_arithm.cpp +++ b/modules/core/test/test_arithm.cpp @@ -2445,9 +2445,9 @@ TEST(Core_MinMaxIdx, rows_overflow) double minVal0 = 0, maxVal0 = 0; int minIdx0[CV_MAX_DIM] = { 0 }, maxIdx0[CV_MAX_DIM] = { 0 }; - cv::ipp::setUseIPP(false); + // cv::ipp::setUseIPP(false); cv::minMaxIdx(m, &minVal0, &maxVal0, minIdx0, maxIdx0); - cv::ipp::setUseIPP(true); + // cv::ipp::setUseIPP(true); EXPECT_FALSE(fabs(minVal0 - minVal) > 1e-6 || fabs(maxVal0 - maxVal) > 1e-6) << "NxM=" << N << "x" << M << " min=" << minVal0 << " vs " << minVal << diff --git a/modules/core/test/test_mat.cpp b/modules/core/test/test_mat.cpp index 578f693dbf96..d7ac167d865c 100644 --- a/modules/core/test/test_mat.cpp +++ b/modules/core/test/test_mat.cpp @@ -2156,7 +2156,7 @@ TEST(Core_Eigen, cv2eigen_tensormap_check_tensormap_access) TEST(Mat, regression_12943) // memory usage: ~4.5 Gb { - applyTestTag(CV_TEST_TAG_MEMORY_6GB); + // applyTestTag(CV_TEST_TAG_MEMORY_6GB); const int width = 0x8000; const int height = 0x10001; diff --git a/modules/imgproc/src/corner.cpp b/modules/imgproc/src/corner.cpp index f0ea0b5bb5e1..1b18eab2f395 100644 --- a/modules/imgproc/src/corner.cpp +++ b/modules/imgproc/src/corner.cpp @@ -471,7 +471,8 @@ static bool ocl_preCornerDetect( InputArray _src, OutputArray _dst, int ksize, i } -#if 0 //defined(HAVE_IPP) +#if defined(HAVE_IPP) +// #if 0 //defined(HAVE_IPP) namespace cv { static bool ipp_cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, int ksize, int borderType ) @@ -554,7 +555,7 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(), ocl_cornerMinEigenValVecs(_src, _dst, blockSize, ksize, 0.0, borderType, MINEIGENVAL)) -/*#ifdef HAVE_IPP +#ifdef HAVE_IPP int kerSize = (ksize < 0)?3:ksize; bool isolated = (borderType & BORDER_ISOLATED) != 0; int borderTypeNI = borderType & ~BORDER_ISOLATED; @@ -562,7 +563,7 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in CV_IPP_RUN(((borderTypeNI == BORDER_REPLICATE && (!_src.isSubmatrix() || isolated)) && (kerSize == 3 || kerSize == 5) && (blockSize == 3 || blockSize == 5)) && IPP_VERSION_X100 >= 800, ipp_cornerMinEigenVal( _src, _dst, blockSize, ksize, borderType )); - */ + Mat src = _src.getMat(); _dst.create( src.size(), CV_32FC1 ); diff --git a/modules/imgproc/src/deriv.cpp b/modules/imgproc/src/deriv.cpp index 2d8b59926dcb..61335725c04a 100644 --- a/modules/imgproc/src/deriv.cpp +++ b/modules/imgproc/src/deriv.cpp @@ -260,7 +260,8 @@ namespace cv } #endif -#if 0 //defined HAVE_IPP +#if defined HAVE_IPP +// #if 0 //defined HAVE_IPP namespace cv { @@ -459,7 +460,7 @@ void cv::Sobel( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, CV_OVX_RUN(true, openvx_sobel(src, dst, dx, dy, ksize, scale, delta, borderType)) - //CV_IPP_RUN_FAST(ipp_Deriv(src, dst, dx, dy, ksize, scale, delta, borderType)); + CV_IPP_RUN_FAST(ipp_Deriv(src, dst, dx, dy, ksize, scale, delta, borderType)); sepFilter2D(src, dst, ddepth, kx, ky, Point(-1, -1), delta, borderType ); } @@ -511,7 +512,7 @@ void cv::Scharr( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, CALL_HAL(scharr, cv_hal_scharr, src.ptr(), src.step, dst.ptr(), dst.step, src.cols, src.rows, sdepth, ddepth, cn, ofs.x, ofs.y, wsz.width - src.cols - ofs.x, wsz.height - src.rows - ofs.y, dx, dy, scale, delta, borderType&~BORDER_ISOLATED); - //CV_IPP_RUN_FAST(ipp_Deriv(src, dst, dx, dy, 0, scale, delta, borderType)); + CV_IPP_RUN_FAST(ipp_Deriv(src, dst, dx, dy, 0, scale, delta, borderType)); sepFilter2D( src, dst, ddepth, kx, ky, Point(-1, -1), delta, borderType ); } diff --git a/modules/imgproc/src/distransform.cpp b/modules/imgproc/src/distransform.cpp index a2c5a0d5fdd9..911e603e3d39 100644 --- a/modules/imgproc/src/distransform.cpp +++ b/modules/imgproc/src/distransform.cpp @@ -795,7 +795,7 @@ void cv::distanceTransform( InputArray _src, OutputArray _dst, OutputArray _labe { if( maskSize == CV_DIST_MASK_3 ) { -#if defined (HAVE_IPP) && (IPP_VERSION_X100 >= 700) && 0 // disabled: https://github.com/opencv/opencv/issues/15904 +#if defined (HAVE_IPP) && (IPP_VERSION_X100 >= 700) //&& 0 // disabled: https://github.com/opencv/opencv/issues/15904 CV_IPP_CHECK() { IppiSize roi = { src.cols, src.rows }; diff --git a/modules/imgproc/src/filter.dispatch.cpp b/modules/imgproc/src/filter.dispatch.cpp index c9d1bb457ca2..49283c516497 100644 --- a/modules/imgproc/src/filter.dispatch.cpp +++ b/modules/imgproc/src/filter.dispatch.cpp @@ -1187,7 +1187,8 @@ static bool replacementFilter2D(int stype, int dtype, int kernel_type, return success; } -#if 0 //defined HAVE_IPP +#if defined HAVE_IPP +// #if 0 //defined HAVE_IPP static bool ippFilter2D(int stype, int dtype, int kernel_type, uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, @@ -1451,7 +1452,7 @@ void filter2D(int stype, int dtype, int kernel_type, if (res) return; - /*CV_IPP_RUN_FAST(ippFilter2D(stype, dtype, kernel_type, + CV_IPP_RUN_FAST(ippFilter2D(stype, dtype, kernel_type, src_data, src_step, dst_data, dst_step, width, height, @@ -1460,7 +1461,7 @@ void filter2D(int stype, int dtype, int kernel_type, kernel_data, kernel_step, kernel_width, kernel_height, anchor_x, anchor_y, - delta, borderType, isSubmatrix))*/ + delta, borderType, isSubmatrix)) res = dftFilter2D(stype, dtype, kernel_type, src_data, src_step, diff --git a/modules/imgproc/src/median_blur.dispatch.cpp b/modules/imgproc/src/median_blur.dispatch.cpp index 949a0a9ecedd..1ba0735828ab 100644 --- a/modules/imgproc/src/median_blur.dispatch.cpp +++ b/modules/imgproc/src/median_blur.dispatch.cpp @@ -203,7 +203,8 @@ static bool openvx_medianFilter(InputArray _src, OutputArray _dst, int ksize) } #endif -#if 0 //defined HAVE_IPP +#if defined HAVE_IPP +// #if 0 //defined HAVE_IPP static bool ipp_medianFilter(Mat &src0, Mat &dst, int ksize) { CV_INSTRUMENT_REGION_IPP(); @@ -303,7 +304,7 @@ void medianBlur( InputArray _src0, OutputArray _dst, int ksize ) CV_OVX_RUN(true, openvx_medianFilter(_src0, _dst, ksize)) - //CV_IPP_RUN_FAST(ipp_medianFilter(src0, dst, ksize)); + CV_IPP_RUN_FAST(ipp_medianFilter(src0, dst, ksize)); CV_CPU_DISPATCH(medianBlur, (src0, dst, ksize), CV_CPU_DISPATCH_MODES_ALL); diff --git a/modules/imgproc/src/morph.dispatch.cpp b/modules/imgproc/src/morph.dispatch.cpp index 45ae3994d9ac..289a211c52cf 100644 --- a/modules/imgproc/src/morph.dispatch.cpp +++ b/modules/imgproc/src/morph.dispatch.cpp @@ -221,7 +221,8 @@ static bool halMorph(int op, int src_type, int dst_type, } // ===== 2. IPP implementation -#if 0 //defined HAVE_IPP +#if defined HAVE_IPP +// #if 0 //defined HAVE_IPP #ifdef HAVE_IPP_IW static inline IwiMorphologyType ippiGetMorphologyType(int morphOp) { @@ -495,12 +496,12 @@ void morph(int op, int src_type, int dst_type, return; } - /*CV_IPP_RUN_FAST(ippMorph(op, src_type, dst_type, src_data, src_step, dst_data, dst_step, width, height, + CV_IPP_RUN_FAST(ippMorph(op, src_type, dst_type, src_data, src_step, dst_data, dst_step, width, height, roi_width, roi_height, roi_x, roi_y, roi_width2, roi_height2, roi_x2, roi_y2, kernel_type, kernel_data, kernel_step, kernel_width, kernel_height, anchor_x, anchor_y, - borderType, borderValue, iterations, isSubmatrix));*/ + borderType, borderValue, iterations, isSubmatrix)); ocvMorph(op, src_type, dst_type, src_data, src_step, dst_data, dst_step, width, height, roi_width, roi_height, roi_x, roi_y, @@ -1085,7 +1086,8 @@ static bool ocl_morphologyEx(InputArray _src, OutputArray _dst, int op, #endif #define IPP_DISABLE_MORPH_ADV 1 -#if 0 //defined HAVE_IPP +#if defined HAVE_IPP +// #if 0 //defined HAVE_IPP #if !IPP_DISABLE_MORPH_ADV static bool ipp_morphologyEx(int op, InputArray _src, OutputArray _dst, InputArray _kernel, @@ -1182,7 +1184,7 @@ void morphologyEx( InputArray _src, OutputArray _dst, int op, Mat dst = _dst.getMat(); #if !IPP_DISABLE_MORPH_ADV - //CV_IPP_RUN_FAST(ipp_morphologyEx(op, src, dst, kernel, anchor, iterations, borderType, borderValue)); + CV_IPP_RUN_FAST(ipp_morphologyEx(op, src, dst, kernel, anchor, iterations, borderType, borderValue)); #endif switch( op ) diff --git a/modules/imgproc/src/thresh.cpp b/modules/imgproc/src/thresh.cpp index 7cd8ff0b22b6..6875410a5788 100644 --- a/modules/imgproc/src/thresh.cpp +++ b/modules/imgproc/src/thresh.cpp @@ -757,7 +757,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type ) } setIppErrorStatus(); break; -#if 0 // details: https://github.com/opencv/opencv/pull/16085 +// #if 0 // details: https://github.com/opencv/opencv/pull/16085 case THRESH_TOZERO: if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_LTVal_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh + FLT_EPSILON, 0)) { @@ -766,7 +766,7 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type ) } setIppErrorStatus(); break; -#endif +// #endif case THRESH_TOZERO_INV: if (0 <= CV_INSTRUMENT_FUN_IPP(ippiThreshold_GTVal_32f_C1R, src, (int)src_step*sizeof(src[0]), dst, (int)dst_step*sizeof(dst[0]), sz, thresh, 0)) { diff --git a/modules/ts/src/ts.cpp b/modules/ts/src/ts.cpp index c7226ba0a3e5..ced607009346 100644 --- a/modules/ts/src/ts.cpp +++ b/modules/ts/src/ts.cpp @@ -1122,6 +1122,7 @@ void SystemInfoCollector::OnTestProgramStart(const testing::UnitTest&) } recordPropertyVerbose("cv_cpu_features", "CPU features", cv::getCPUFeaturesLine()); #ifdef HAVE_IPP + printf("Hi there! IPP is %d\n", cv::ipp::useIPP()); recordPropertyVerbose("cv_ipp_version", "Intel(R) IPP version", cv::ipp::useIPP() ? cv::ipp::getIppVersion() : "disabled"); #endif #ifdef HAVE_OPENCL diff --git a/modules/ts/src/ts_tags.cpp b/modules/ts/src/ts_tags.cpp index 8bed1b739fa3..e07b97f8fb45 100644 --- a/modules/ts/src/ts_tags.cpp +++ b/modules/ts/src/ts_tags.cpp @@ -48,8 +48,9 @@ static std::vector& getTestTagsSkipList() #if OPENCV_32BIT_CONFIGURATION testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_2GB); #else - if (!cvtest::runBigDataTests) - testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB); + testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB); + // if (!cvtest::runBigDataTests) + // testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB); #endif testSkipWithTags.push_back(CV_TEST_TAG_VERYLONG); #if defined(_DEBUG)