Skip to content

add Intel® oneAPI DPC++/C++ Compiler (icx)#24286

Merged
asmorkalov merged 4 commits intoopencv:4.xfrom
ashadrina:intel_icx_compiler_support
Sep 22, 2023
Merged

add Intel® oneAPI DPC++/C++ Compiler (icx)#24286
asmorkalov merged 4 commits intoopencv:4.xfrom
ashadrina:intel_icx_compiler_support

Conversation

@ashadrina
Copy link
Copy Markdown
Contributor

Intel® C++ Compiler Classic (icc) is deprecated and will be removed in a oneAPI release in the second half of 2023 (deprecation notice). This commit is intended to add support for the next-generation compiler, Intel® oneAPI DPC++/C++ Compiler (icx) (the documentation for the compiler is available on the link).

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

…n a oneAPI release in the second half of 2023. This commit is intended to add support for the next generation compiler, Intel® oneAPI DPC++/C++ Compiler (icx).
@asmorkalov
Copy link
Copy Markdown
Contributor

asmorkalov commented Sep 19, 2023

@ashadrina Thanks a lot for the contribution! I tried the patch manually with Ubuntu 18.04 and ICX 2023.2.0 (l_BaseKit_p_2023.2.0.49397_offline.sh). The patch fixes compiler diagnostics and enables platform specific optimizations like AVX, but breaks linkage. Steps to reproduce:

$ source /home/alexander/intel/oneapisetvars.sh
$ cmake -DCMAKE_C_COMPILER=/home/alexander/intel/oneapi/compiler/2023.2.0/linux/bin/icx -DCMAKE_CXX_COMPILER=/home/alexander/intel/oneapi/compiler/2023.2.0/linux/bin/icpx ../opencv-master
$ make -j4 VERBOSE=1 opencv_test_core
/home/alexander/intel/oneapi/compiler/2023.2.0/linux/bin/icpx -fPIC    -fsigned-char  -msse3 -O3 -DNDEBUG  -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a   -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libopencv_imgproc.so.408 -o ../../lib/libopencv_imgproc.so.4.8.0 CMakeFiles/opencv_imgproc.dir/src/accum.cpp.o CMakeFiles/opencv_imgproc.dir/src/accum.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/approx.cpp.o CMakeFiles/opencv_imgproc.dir/src/bilateral_filter.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/blend.cpp.o CMakeFiles/opencv_imgproc.dir/src/box_filter.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/canny.cpp.o CMakeFiles/opencv_imgproc.dir/src/clahe.cpp.o CMakeFiles/opencv_imgproc.dir/src/color.cpp.o CMakeFiles/opencv_imgproc.dir/src/color_hsv.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/color_lab.cpp.o CMakeFiles/opencv_imgproc.dir/src/color_rgb.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/color_yuv.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/colormap.cpp.o CMakeFiles/opencv_imgproc.dir/src/connectedcomponents.cpp.o CMakeFiles/opencv_imgproc.dir/src/contours.cpp.o CMakeFiles/opencv_imgproc.dir/src/convhull.cpp.o CMakeFiles/opencv_imgproc.dir/src/corner.cpp.o CMakeFiles/opencv_imgproc.dir/src/cornersubpix.cpp.o CMakeFiles/opencv_imgproc.dir/src/demosaicing.cpp.o CMakeFiles/opencv_imgproc.dir/src/deriv.cpp.o CMakeFiles/opencv_imgproc.dir/src/distransform.cpp.o CMakeFiles/opencv_imgproc.dir/src/drawing.cpp.o CMakeFiles/opencv_imgproc.dir/src/emd.cpp.o CMakeFiles/opencv_imgproc.dir/src/featureselect.cpp.o CMakeFiles/opencv_imgproc.dir/src/filter.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/floodfill.cpp.o CMakeFiles/opencv_imgproc.dir/src/gabor.cpp.o CMakeFiles/opencv_imgproc.dir/src/generalized_hough.cpp.o CMakeFiles/opencv_imgproc.dir/src/geometry.cpp.o CMakeFiles/opencv_imgproc.dir/src/grabcut.cpp.o CMakeFiles/opencv_imgproc.dir/src/hershey_fonts.cpp.o CMakeFiles/opencv_imgproc.dir/src/histogram.cpp.o CMakeFiles/opencv_imgproc.dir/src/hough.cpp.o CMakeFiles/opencv_imgproc.dir/src/imgwarp.cpp.o CMakeFiles/opencv_imgproc.dir/src/intelligent_scissors.cpp.o CMakeFiles/opencv_imgproc.dir/src/intersection.cpp.o CMakeFiles/opencv_imgproc.dir/src/linefit.cpp.o CMakeFiles/opencv_imgproc.dir/src/lsd.cpp.o CMakeFiles/opencv_imgproc.dir/src/main.cpp.o CMakeFiles/opencv_imgproc.dir/src/matchcontours.cpp.o CMakeFiles/opencv_imgproc.dir/src/median_blur.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/min_enclosing_triangle.cpp.o CMakeFiles/opencv_imgproc.dir/src/moments.cpp.o CMakeFiles/opencv_imgproc.dir/src/morph.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/phasecorr.cpp.o CMakeFiles/opencv_imgproc.dir/src/pyramids.cpp.o CMakeFiles/opencv_imgproc.dir/src/resize.cpp.o CMakeFiles/opencv_imgproc.dir/src/rotcalipers.cpp.o CMakeFiles/opencv_imgproc.dir/src/samplers.cpp.o CMakeFiles/opencv_imgproc.dir/src/segmentation.cpp.o CMakeFiles/opencv_imgproc.dir/src/shapedescr.cpp.o CMakeFiles/opencv_imgproc.dir/src/smooth.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/spatialgradient.cpp.o CMakeFiles/opencv_imgproc.dir/src/stackblur.cpp.o CMakeFiles/opencv_imgproc.dir/src/subdivision2d.cpp.o CMakeFiles/opencv_imgproc.dir/src/sumpixels.dispatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/tables.cpp.o CMakeFiles/opencv_imgproc.dir/src/templmatch.cpp.o CMakeFiles/opencv_imgproc.dir/src/thresh.cpp.o CMakeFiles/opencv_imgproc.dir/src/utils.cpp.o CMakeFiles/opencv_imgproc.dir/opencl_kernels_imgproc.cpp.o CMakeFiles/opencv_imgproc.dir/src/imgwarp.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/src/resize.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/accum.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/box_filter.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/filter.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/color_hsv.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/color_rgb.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/color_yuv.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/median_blur.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/morph.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/smooth.sse4_1.cpp.o CMakeFiles/opencv_imgproc.dir/src/corner.avx.cpp.o CMakeFiles/opencv_imgproc.dir/accum.avx.cpp.o CMakeFiles/opencv_imgproc.dir/src/imgwarp.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/src/resize.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/accum.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/bilateral_filter.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/box_filter.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/filter.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/color_hsv.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/color_rgb.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/color_yuv.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/median_blur.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/morph.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/smooth.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/sumpixels.avx2.cpp.o CMakeFiles/opencv_imgproc.dir/sumpixels.avx512_skx.cpp.o  -Wl,-rpath,/home/alexander/Projects/OpenCV/opencv-build/lib: ../../lib/libopencv_core.so.4.8.0 -ldl -lm -lpthread -lrt ../../3rdparty/lib/libippiw.a ../../3rdparty/ippicv/ippicv_lnx/icv/lib/intel64/libippicv.a 
../../3rdparty/lib/libippiw.a(iw_own.c.o): In function `iwTls_Init':
iw_own.c:(.text+0x495): undefined reference to `pthread_mutexattr_init'
iw_own.c:(.text+0x4a8): undefined reference to `pthread_mutexattr_settype'
iw_own.c:(.text+0x4b6): undefined reference to `pthread_mutexattr_destroy'
iw_own.c:(.text+0x4dd): undefined reference to `pthread_mutexattr_destroy'
iw_own.c:(.text+0x4f7): undefined reference to `pthread_key_create'
../../3rdparty/lib/libippiw.a(iw_own.c.o): In function `ownTlsStorage_Release':
iw_own.c:(.text+0x863): undefined reference to `pthread_key_delete'
../../3rdparty/lib/libippiw.a(iw_own.c.o): In function `iwTls_Set':
iw_own.c:(.text+0x8dc): undefined reference to `pthread_getspecific'
iw_own.c:(.text+0x93e): undefined reference to `pthread_getspecific'
iw_own.c:(.text+0xa1d): undefined reference to `pthread_setspecific'
../../3rdparty/lib/libippiw.a(iw_own.c.o): In function `iwTls_Get':
iw_own.c:(.text+0xd07): undefined reference to `pthread_getspecific'
icpx: error: linker command failed with exit code 1 (use -v to see invocation)
modules/imgproc/CMakeFiles/opencv_imgproc.dir/build.make:1557: recipe for target 'lib/libopencv_imgproc.so.4.8.0' failed
make[3]: *** [lib/libopencv_imgproc.so.4.8.0] Error 1
make[3]: выход из каталога «/mnt/projects/Projects/OpenCV/opencv-build»
CMakeFiles/Makefile2:1922: recipe for target 'modules/imgproc/CMakeFiles/opencv_imgproc.dir/all' failed
make[2]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/all] Error 2
make[2]: выход из каталога «/mnt/projects/Projects/OpenCV/opencv-build»
CMakeFiles/Makefile2:1806: recipe for target 'modules/core/CMakeFiles/opencv_test_core.dir/rule' failed
make[1]: *** [modules/core/CMakeFiles/opencv_test_core.dir/rule] Error 2
make[1]: выход из каталога «/mnt/projects/Projects/OpenCV/opencv-build»
Makefile:381: recipe for target 'opencv_test_core' failed
make: *** [opencv_test_core] Error 2

@asmorkalov
Copy link
Copy Markdown
Contributor

Most probably issue is related to cmake/OpenCVCompilerOptions.cmake:183. -pthread option is not added.

@asmorkalov
Copy link
Copy Markdown
Contributor

@ashadrina I pushed commit to your PR to fix linkage issue and some flags. ICX is LLVM-based compiler. Most of CLANG related options are enabled.

@asmorkalov
Copy link
Copy Markdown
Contributor

I tested core module and it produce a lot of failed tests:

[  PASSED  ] 11665 tests.
[  FAILED  ] 96 tests, listed below:
[  FAILED  ] Core_Set.regression_11044
[  FAILED  ] hal_intrin128.float32x4_CPP_EMULATOR
[  FAILED  ] hal_intrin128.float64x2_CPP_EMULATOR
[  FAILED  ] hal_intrin128.float32x4_BASELINE
[  FAILED  ] hal_intrin128.float64x2_BASELINE
[  FAILED  ] hal_intrin128.float32x4_SSE2
[  FAILED  ] hal_intrin128.float64x2_SSE2
[  FAILED  ] hal_intrin128.float32x4_SSE3
[  FAILED  ] hal_intrin128.float64x2_SSE3
[  FAILED  ] hal_intrin128.uint8x16_SSE4_1
[  FAILED  ] hal_intrin128.int8x16_SSE4_1
[  FAILED  ] hal_intrin128.float32x4_SSE4_1
[  FAILED  ] hal_intrin128.float64x2_SSE4_1
[  FAILED  ] hal_intrin128.uint8x16_SSE4_2
[  FAILED  ] hal_intrin128.int8x16_SSE4_2
[  FAILED  ] hal_intrin128.float32x4_SSE4_2
[  FAILED  ] hal_intrin128.float64x2_SSE4_2
[  FAILED  ] hal_intrin128.uint8x16_AVX
[  FAILED  ] hal_intrin128.int8x16_AVX
[  FAILED  ] hal_intrin128.float32x4_AVX
[  FAILED  ] hal_intrin128.float64x2_AVX
[  FAILED  ] Mat.regression_10507_mat_setTo
[  FAILED  ] Core_KMeans.bad_input
[  FAILED  ] Core_QR_Solver.accuracy64f
[  FAILED  ] Core_FastMath.InlineNaN
[  FAILED  ] Core_FastMath.InlineIsInf
[  FAILED  ] Core_DivideRules.type_32f/0, where GetParam() = (false, 1, false, false, false)
[  FAILED  ] Core_DivideRules.type_32f/1, where GetParam() = (false, 1, false, false, true)
[  FAILED  ] Core_DivideRules.type_32f/2, where GetParam() = (false, 1, false, true, false)
[  FAILED  ] Core_DivideRules.type_32f/3, where GetParam() = (false, 1, false, true, true)
[  FAILED  ] Core_DivideRules.type_32f/4, where GetParam() = (false, 1, true, false, false)
[  FAILED  ] Core_DivideRules.type_32f/5, where GetParam() = (false, 1, true, false, true)
[  FAILED  ] Core_DivideRules.type_32f/6, where GetParam() = (false, 1, true, true, false)
[  FAILED  ] Core_DivideRules.type_32f/7, where GetParam() = (false, 1, true, true, true)
[  FAILED  ] Core_DivideRules.type_32f/8, where GetParam() = (false, 5, false, false, false)
[  FAILED  ] Core_DivideRules.type_32f/9, where GetParam() = (false, 5, false, false, true)
[  FAILED  ] Core_DivideRules.type_32f/10, where GetParam() = (false, 5, false, true, false)
[  FAILED  ] Core_DivideRules.type_32f/11, where GetParam() = (false, 5, false, true, true)
[  FAILED  ] Core_DivideRules.type_32f/12, where GetParam() = (false, 5, true, false, false)
[  FAILED  ] Core_DivideRules.type_32f/13, where GetParam() = (false, 5, true, false, true)
[  FAILED  ] Core_DivideRules.type_32f/14, where GetParam() = (false, 5, true, true, false)
[  FAILED  ] Core_DivideRules.type_32f/15, where GetParam() = (false, 5, true, true, true)
[  FAILED  ] Core_DivideRules.type_64f/0, where GetParam() = (false, 1, false, false, false)
[  FAILED  ] Core_DivideRules.type_64f/1, where GetParam() = (false, 1, false, false, true)
[  FAILED  ] Core_DivideRules.type_64f/2, where GetParam() = (false, 1, false, true, false)
[  FAILED  ] Core_DivideRules.type_64f/3, where GetParam() = (false, 1, false, true, true)
[  FAILED  ] Core_DivideRules.type_64f/4, where GetParam() = (false, 1, true, false, false)
[  FAILED  ] Core_DivideRules.type_64f/5, where GetParam() = (false, 1, true, false, true)
[  FAILED  ] Core_DivideRules.type_64f/6, where GetParam() = (false, 1, true, true, false)
[  FAILED  ] Core_DivideRules.type_64f/7, where GetParam() = (false, 1, true, true, true)
[  FAILED  ] Core_DivideRules.type_64f/8, where GetParam() = (false, 5, false, false, false)
[  FAILED  ] Core_DivideRules.type_64f/9, where GetParam() = (false, 5, false, false, true)
[  FAILED  ] Core_DivideRules.type_64f/10, where GetParam() = (false, 5, false, true, false)
[  FAILED  ] Core_DivideRules.type_64f/11, where GetParam() = (false, 5, false, true, true)
[  FAILED  ] Core_DivideRules.type_64f/12, where GetParam() = (false, 5, true, false, false)
[  FAILED  ] Core_DivideRules.type_64f/13, where GetParam() = (false, 5, true, false, true)
[  FAILED  ] Core_DivideRules.type_64f/14, where GetParam() = (false, 5, true, true, false)
[  FAILED  ] Core_DivideRules.type_64f/15, where GetParam() = (false, 5, true, true, true)
[  FAILED  ] UMat/Core_DivideRules.type_32f/0, where GetParam() = (true, 1, false, false, false)
[  FAILED  ] UMat/Core_DivideRules.type_32f/1, where GetParam() = (true, 1, false, false, true)
[  FAILED  ] UMat/Core_DivideRules.type_32f/2, where GetParam() = (true, 1, false, true, false)
[  FAILED  ] UMat/Core_DivideRules.type_32f/3, where GetParam() = (true, 1, false, true, true)
[  FAILED  ] UMat/Core_DivideRules.type_32f/4, where GetParam() = (true, 1, true, false, false)
[  FAILED  ] UMat/Core_DivideRules.type_32f/5, where GetParam() = (true, 1, true, false, true)
[  FAILED  ] UMat/Core_DivideRules.type_32f/6, where GetParam() = (true, 1, true, true, false)
[  FAILED  ] UMat/Core_DivideRules.type_32f/7, where GetParam() = (true, 1, true, true, true)
[  FAILED  ] UMat/Core_DivideRules.type_32f/8, where GetParam() = (true, 5, false, false, false)
[  FAILED  ] UMat/Core_DivideRules.type_32f/9, where GetParam() = (true, 5, false, false, true)
[  FAILED  ] UMat/Core_DivideRules.type_32f/10, where GetParam() = (true, 5, false, true, false)
[  FAILED  ] UMat/Core_DivideRules.type_32f/11, where GetParam() = (true, 5, false, true, true)
[  FAILED  ] UMat/Core_DivideRules.type_32f/12, where GetParam() = (true, 5, true, false, false)
[  FAILED  ] UMat/Core_DivideRules.type_32f/13, where GetParam() = (true, 5, true, false, true)
[  FAILED  ] UMat/Core_DivideRules.type_32f/14, where GetParam() = (true, 5, true, true, false)
[  FAILED  ] UMat/Core_DivideRules.type_32f/15, where GetParam() = (true, 5, true, true, true)
[  FAILED  ] UMat/Core_DivideRules.type_64f/0, where GetParam() = (true, 1, false, false, false)
[  FAILED  ] UMat/Core_DivideRules.type_64f/1, where GetParam() = (true, 1, false, false, true)
[  FAILED  ] UMat/Core_DivideRules.type_64f/2, where GetParam() = (true, 1, false, true, false)
[  FAILED  ] UMat/Core_DivideRules.type_64f/3, where GetParam() = (true, 1, false, true, true)
[  FAILED  ] UMat/Core_DivideRules.type_64f/4, where GetParam() = (true, 1, true, false, false)
[  FAILED  ] UMat/Core_DivideRules.type_64f/5, where GetParam() = (true, 1, true, false, true)
[  FAILED  ] UMat/Core_DivideRules.type_64f/6, where GetParam() = (true, 1, true, true, false)
[  FAILED  ] UMat/Core_DivideRules.type_64f/7, where GetParam() = (true, 1, true, true, true)
[  FAILED  ] UMat/Core_DivideRules.type_64f/8, where GetParam() = (true, 5, false, false, false)
[  FAILED  ] UMat/Core_DivideRules.type_64f/9, where GetParam() = (true, 5, false, false, true)
[  FAILED  ] UMat/Core_DivideRules.type_64f/10, where GetParam() = (true, 5, false, true, false)
[  FAILED  ] UMat/Core_DivideRules.type_64f/11, where GetParam() = (true, 5, false, true, true)
[  FAILED  ] UMat/Core_DivideRules.type_64f/12, where GetParam() = (true, 5, true, false, false)
[  FAILED  ] UMat/Core_DivideRules.type_64f/13, where GetParam() = (true, 5, true, false, true)
[  FAILED  ] UMat/Core_DivideRules.type_64f/14, where GetParam() = (true, 5, true, true, false)
[  FAILED  ] UMat/Core_DivideRules.type_64f/15, where GetParam() = (true, 5, true, true, true)
[  FAILED  ] Core/HasNonZeroLimitValues.hasNonZeroLimitValues/0, where GetParam() = (5, 1x1)
[  FAILED  ] Core/HasNonZeroLimitValues.hasNonZeroLimitValues/1, where GetParam() = (5, 320x240)
[  FAILED  ] Core/HasNonZeroLimitValues.hasNonZeroLimitValues/2, where GetParam() = (5, 127x113)
[  FAILED  ] Core/HasNonZeroLimitValues.hasNonZeroLimitValues/3, where GetParam() = (5, 1x113)
[  FAILED  ] Core/HasNonZeroLimitValues.hasNonZeroLimitValues/4, where GetParam() = (6, 1x1)
[  FAILED  ] Core/HasNonZeroLimitValues.hasNonZeroLimitValues/5, where GetParam() = (6, 320x240)

Findings:

  • /home/alexander/Projects/OpenCV/opencv-master/modules/core/include/opencv2/core/fast_math.hpp:421:5: warning: explicit comparison with infinity in fast floating point mode [-Wtautological-constant-compare] means that compiler uses FastMath option by default. OpenCV does not set fast-math related options by default.
  • HAL_intrin_xxx are pure arithmetic test cases and the fault is related to default compiler options or some compiler behavior.

@ashadrina
Copy link
Copy Markdown
Contributor Author

@asmorkalov thank you! Sorry for being late with the response, I am presently trying to figure out why my PR is working on one machine and failing with pthread issue on another. GCC and cmake versions were my main candidates but it seems that the reason is something else.

Yes, ICX is using -fp-model=fast -fma and -ffast-math by default. Does -fno-fast-math and (optionally) -fp-model=precise -no-fma fix the rest of the tests?

@asmorkalov
Copy link
Copy Markdown
Contributor

CMake version:

alexander@paradox:~/Projects/OpenCV$ cmake --version
cmake version 3.22.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@asmorkalov
Copy link
Copy Markdown
Contributor

I disabled fast-math by default and it fixed most of failures, but I still observe failures with integer arithmetic:

[ RUN      ] hal_intrin128.uint8x16_SSE4_1
SIMD128: void opencv_test::hal::intrin128::opt_SSE4_1::test_hal_intrin_uint8()
/home/alexander/Projects/OpenCV/opencv-master/modules/core/test/test_intrin_utils.hpp:601: Failure
Expected equality of these values:
  data[i]
    Which is: '\x1' (1)
  out[i]
    Which is: 0
Google Test trace:
/home/alexander/Projects/OpenCV/opencv-master/modules/core/test/test_intrin_utils.hpp:600: i=0
/home/alexander/Projects/OpenCV/opencv-master/modules/core/test/test_intrin_utils.hpp:601: Failure
Expected equality of these values:
  data[i]
    Which is: '\x2' (2)
  out[i]
    Which is: 0
Google Test trace:
/home/alexander/Projects/OpenCV/opencv-master/modules/core/test/test_intrin_utils.hpp:600: i=1
/home/alexander/Projects/OpenCV/opencv-master/modules/core/test/test_intrin_utils.hpp:601: Failure
Expected equality of these values:
  data[i]
    Which is: '\x3' (3)
  out[i]
    Which is: 0
Google Test trace:
/home/alexander/Projects/OpenCV/opencv-master/modules/core/test/test_intrin_utils.hpp:600: i=2
/home/alexander/Projects/OpenCV/opencv-master/modules/core/test/test_intrin_utils.hpp:601: Failure
Expected equality of these values:
  data[i]
    Which is: '\x4' (4)
  out[i]
    Which is: 0
Google Test trace:
/home/alexander/Projects/OpenCV/opencv-master/modules/core/test/test_intrin_utils.hpp:600: i=3
[  FAILED  ] hal_intrin128.uint8x16_SSE4_1 (0 ms)

The result looks like over-optimization on compiler side.

Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# ICX uses -ffast-math by default.
if(NOT ENABLE_FAST_MATH)
add_extra_compiler_option(-fno-fast-math)
add_extra_compiler_option(-fp-model=precise)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to guard this similar to line 101 (like CV_ICC) and/or 93 (MSVS)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Please take a look.

@asmorkalov asmorkalov merged commit 3889dcf into opencv:4.x Sep 22, 2023
@asmorkalov asmorkalov mentioned this pull request Sep 28, 2023
hanliutong pushed a commit to hanliutong/opencv that referenced this pull request Oct 7, 2023
…port

Add Intel® oneAPI DPC++/C++ Compiler (icx) opencv#24286

Intel® C++ Compiler Classic (icc) is deprecated and will be removed in a oneAPI release in the second half of 2023 ([deprecation notice](https://community.intel.com/t5/Intel-oneAPI-IoT-Toolkit/DEPRECATION-NOTICE-Intel-C-Compiler-Classic/m-p/1412267#:~:text=Intel%C2%AE%20C%2B%2B%20Compiler%20Classic%20(icc)%20is%20deprecated%20and%20will,the%20second%20half%20of%202023.)). This commit is intended to add support for the next-generation compiler, Intel® oneAPI DPC++/C++ Compiler (icx) (the documentation for the compiler is available on the [link](https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2023-2/overview.html)). 

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
thewoz pushed a commit to thewoz/opencv that referenced this pull request Jan 4, 2024
…port

Add Intel® oneAPI DPC++/C++ Compiler (icx) opencv#24286

Intel® C++ Compiler Classic (icc) is deprecated and will be removed in a oneAPI release in the second half of 2023 ([deprecation notice](https://community.intel.com/t5/Intel-oneAPI-IoT-Toolkit/DEPRECATION-NOTICE-Intel-C-Compiler-Classic/m-p/1412267#:~:text=Intel%C2%AE%20C%2B%2B%20Compiler%20Classic%20(icc)%20is%20deprecated%20and%20will,the%20second%20half%20of%202023.)). This commit is intended to add support for the next-generation compiler, Intel® oneAPI DPC++/C++ Compiler (icx) (the documentation for the compiler is available on the [link](https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2023-2/overview.html)). 

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
thewoz pushed a commit to thewoz/opencv that referenced this pull request May 29, 2024
…port

Add Intel® oneAPI DPC++/C++ Compiler (icx) opencv#24286

Intel® C++ Compiler Classic (icc) is deprecated and will be removed in a oneAPI release in the second half of 2023 ([deprecation notice](https://community.intel.com/t5/Intel-oneAPI-IoT-Toolkit/DEPRECATION-NOTICE-Intel-C-Compiler-Classic/m-p/1412267#:~:text=Intel%C2%AE%20C%2B%2B%20Compiler%20Classic%20(icc)%20is%20deprecated%20and%20will,the%20second%20half%20of%202023.)). This commit is intended to add support for the next-generation compiler, Intel® oneAPI DPC++/C++ Compiler (icx) (the documentation for the compiler is available on the [link](https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2023-2/overview.html)). 

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants