Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@junxnone
Copy link
Contributor

@junxnone junxnone commented Apr 3, 2024

fixes #25270

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

@asmorkalov
Copy link
Contributor

-- IPPICV: Downloading ippicv_2021.10.1_lnx_intel64_20231206_general.tgz from https://raw.githubusercontent.com/opencv/opencv_3rdparty/c7c6d527dde5fee7cb914ee9e4e20f7436aab3a1/ippicv/ippicv_2021.10.1_lnx_intel64_20231206_general.tgz
CMake Error at cmake/OpenCVFindIPP.cmake:87 (cmake_path):
  Unknown CMake command "cmake_path".
Call Stack (most recent call first):
  cmake/OpenCVFindIPP.cmake:278 (ipp_detect_version)
  cmake/OpenCVFindLibsPerf.cmake:12 (include)
  CMakeLists.txt:820 (include)


-- Configuring incomplete, errors occurred!

@junxnone
Copy link
Contributor Author

junxnone commented Apr 3, 2024

Sorry, cmake_path() is new in version 3.20.

But opencv is use the min 3.5.1:

set(MIN_VER_CMAKE 3.5.1)

Will try to get new method.

junxnone added 2 commits April 4, 2024 08:12
- cmake_path is new in cmake 3.20

Signed-off-by: junxnone <[email protected]>
@asmorkalov
Copy link
Contributor

Looks like the same changes are required for IPP IW in cmake/OpenCVFindIPPIW.cmake.

@junxnone
Copy link
Contributor Author

Looks like the same changes are required for IPP IW in cmake/OpenCVFindIPPIW.cmake.

not found

  • The file ippicv_redefs.h is not release with IPP(OneAPI). So no matter which IPP is used, IPP within OneAPI or ICV(IPP for OpenCV), they all take the IW from ICV package.

if(EXISTS ${IPP_ROOT_DIR}/include/ippicv_redefs.h)
set(__msg " (ICV version)")
set(HAVE_IPP_ICV 1)

# take Intel IPP Integration Wrappers from ICV package
if(NOT HAVE_IPP_ICV)
message(STATUS "Cannot find Intel IPP Integration Wrappers. Checking \"Intel IPP for OpenCV\" package")

  • Is the IW from IPP(OneAPI) not works for OpenCV?

@opencv-alalek
Copy link
Contributor

AFAIK, OpenCV uses "own" IW wrapper due to API from "iw/iw_ll.h" file which is not available in common IPP releases.
Need to check if this API is available in modern IPP package.

@asmorkalov
Copy link
Contributor

@opencv-alalek Does it mean, that the PR may be merged?

# TODO Cleanup code after ICV package stabilization
macro(ipp_detect_version)
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include)
get_filename_component(IPP_INCLUDE_DIRS ${IPP_VERSION_FILE} PATH)
Copy link
Contributor

Choose a reason for hiding this comment

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

Check on the line 93 may fail and fail IPP detection completelly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if(EXISTS ${IPP_ROOT_DIR}/include/ippicv_redefs.h)
set(__msg " (ICV version)")
set(HAVE_IPP_ICV 1)
elseif(EXISTS ${IPP_ROOT_DIR}/include/ipp.h)
# nothing
else()
_ipp_not_supported("Can't resolve Intel IPP directory: ${IPP_ROOT_DIR}")
endif()

In OneAPI 2024, inlcude/ipp.h is the only one that has not moved to the directory include/ipp/.

$ tree  /opt/intel/oneapi/ipp/2021.11/include/ -L 2
/opt/intel/oneapi/ipp/2021.11/include/
├── ipp
│   ├── ippbase.h
...
│   ├── ippvm.h
│   ├── iw
│   └── iw++
└── ipp.h

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the information!

Perhaps we should not change IPP_INCLUDE_DIRS to the nested directory. Or add both locations.

I see these IPP includes in OpenCV:

./modules/core/include/opencv2/core/private.hpp:220:#include "ippversion.h"
./modules/core/include/opencv2/core/private.hpp:230:#include "ippicv.h"
./modules/core/include/opencv2/core/private.hpp:232:#include "ipp.h"

/cc @eplankin

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, top-level ipp.h is just a shim:

#include <ipp/ipp.h>

Copy link
Contributor

@opencv-alalek opencv-alalek left a comment

Choose a reason for hiding this comment

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

  • Validated with l_ipp_oneapi_p_2021.11.0.532_offline.sh

@asmorkalov asmorkalov added this to the 4.10.0 milestone Apr 19, 2024
@asmorkalov asmorkalov merged commit 882f46e into opencv:4.x Apr 19, 2024
@asmorkalov asmorkalov mentioned this pull request Apr 19, 2024
klatism pushed a commit to klatism/opencv that referenced this pull request May 17, 2024
Fix for IPP 2021.10 with OneAPI 2024 opencv#25317

fixes opencv#25270

### 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
- [x] 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.
- [x] 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.

support for IPP 2021.10 in OneAPI 2024

3 participants