add Intel® oneAPI DPC++/C++ Compiler (icx)#24286
Conversation
…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).
|
@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: |
|
Most probably issue is related to cmake/OpenCVCompilerOptions.cmake:183. |
|
@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. |
|
I tested core module and it produce a lot of failed tests: Findings:
|
|
@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? |
|
CMake version: |
|
I disabled fast-math by default and it fixed most of failures, but I still observe failures with integer arithmetic: The result looks like over-optimization on compiler side. |
cmake/OpenCVCompilerOptions.cmake
Outdated
| # 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) |
There was a problem hiding this comment.
It makes sense to guard this similar to line 101 (like CV_ICC) and/or 93 (MSVS)
There was a problem hiding this comment.
Done. Please take a look.
…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
…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
…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
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
Patch to opencv_extra has the same branch name.