Skip to content

Skip KleidiCV in offline build#26303

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/kleidicv_offline
Nov 13, 2024
Merged

Skip KleidiCV in offline build#26303
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/kleidicv_offline

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented Oct 14, 2024

The PR reworks KleidiCV downloading and detection steps to make it similar to IPP and compatible with off-line build.

Fixes #26275

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 asmorkalov added category: build/install platform: android platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc labels Oct 14, 2024
@asmorkalov asmorkalov added this to the 4.11.0 milestone Oct 14, 2024
CMakeLists.txt Outdated
ocv_debug_message(STATUS "Try to enable KleidiCV acceleration")
if(NOT ";${OpenCV_HAL};" MATCHES ";kleidicv;")
set(OpenCV_HAL "kleidicv;${OpenCV_HAL}")
add_subdirectory(3rdparty/kleidicv)
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.

This skips add_subdirectory() call if user specifies cmake -DOpenCV_HAL=kleidicv ....

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.

What is the problem to follow carotene design?

@asmorkalov
Copy link
Copy Markdown
Contributor Author

@opencv-alalek I patched conditions a bit.

@asmorkalov
Copy link
Copy Markdown
Contributor Author

@opencv-alalek Carotene is always there. There is no need to check HAVE_ status.

@opencv-alalek
Copy link
Copy Markdown
Contributor

Carotene is here, but it requires NEON which could be unavailable.

@asmorkalov
Copy link
Copy Markdown
Contributor Author

In case, if NEON is not available Carotene is build as dummy library with "NOT_IMPLEMENTED" stubs. We cannot do the same if KleidiCV code is not available.

@opencv-alalek
Copy link
Copy Markdown
Contributor

    if(";${CPU_BASELINE_FINAL};" MATCHES ";NEON;")
      add_subdirectory(3rdparty/carotene/hal)
      ocv_hal_register(CAROTENE_HAL_LIBRARIES CAROTENE_HAL_HEADERS CAROTENE_HAL_INCLUDE_DIRS)
      list(APPEND OpenCV_USED_HAL "carotene (ver ${CAROTENE_HAL_VERSION})")
    else()
      message(STATUS "Carotene: NEON is not available, disabling carotene...")
    endif()

@asmorkalov
Copy link
Copy Markdown
Contributor Author

@opencv-alalek The PR is re-dun in IPP style. Please take a look again.

@asmorkalov asmorkalov merged commit e1d6664 into opencv:4.x Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: build/install platform: android platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build: ARM KleidiCV HAL must be optional

2 participants