File tree Expand file tree Collapse file tree 4 files changed +41
-21
lines changed Expand file tree Collapse file tree 4 files changed +41
-21
lines changed Original file line number Diff line number Diff line change 1
1
project (kleidicv_hal )
2
2
3
- set (KLEIDICV_SOURCE_PATH "" CACHE PATH "Directory containing KleidiCV sources" )
4
- ocv_update (KLEIDICV_SRC_COMMIT "0.2.0" )
5
- ocv_update (KLEIDICV_SRC_HASH "dabe522e8f55ac342d07a787391dab80" )
6
-
7
- if (KLEIDICV_SOURCE_PATH )
8
- set (THE_ROOT "${KLEIDICV_SOURCE_PATH} " )
9
- else ()
10
- ocv_download (FILENAME "kleidicv-${KLEIDICV_SRC_COMMIT} .tar.gz"
11
- HASH ${KLEIDICV_SRC_HASH}
12
- URL
13
- "${OPENCV_KLEIDICV_URL} "
14
- "$ENV{OPENCV_KLEIDICV_URL} "
15
- "https://gitlab.arm.com/kleidi/kleidicv/-/archive/${KLEIDICV_SRC_COMMIT} /"
16
- DESTINATION_DIR "${OpenCV_BINARY_DIR} /3rdparty/kleidicv/"
17
- ID KLEIDICV
18
- STATUS res
19
- UNPACK RELATIVE_URL )
20
- set (THE_ROOT "${OpenCV_BINARY_DIR} /3rdparty/kleidicv/kleidicv-${KLEIDICV_SRC_COMMIT} " )
3
+ if (HAVE_KLEIDICV )
4
+ option (KLEIDICV_ENABLE_SME2 "" OFF ) # not compatible with some CLang versions in NDK
5
+ include ("${KLEIDICV_SOURCE_PATH} /adapters/opencv/CMakeLists.txt" )
21
6
endif ()
22
7
23
- option (KLEIDICV_ENABLE_SME2 "" OFF ) # not compatible with some CLang versions in NDK
24
- include ("${THE_ROOT} /adapters/opencv/CMakeLists.txt" )
Original file line number Diff line number Diff line change
1
+ function (download_kleidicv root_var )
2
+ set (${root_var} "" PARENT_SCOPE )
3
+
4
+ ocv_update (KLEIDICV_SRC_COMMIT "0.2.0" )
5
+ ocv_update (KLEIDICV_SRC_HASH "dabe522e8f55ac342d07a787391dab80" )
6
+
7
+ set (THE_ROOT "${OpenCV_BINARY_DIR} /3rdparty/kleidicv" )
8
+ ocv_download (FILENAME "kleidicv-${KLEIDICV_SRC_COMMIT} .tar.gz"
9
+ HASH ${KLEIDICV_SRC_HASH}
10
+ URL
11
+ "${OPENCV_KLEIDICV_URL} "
12
+ "$ENV{OPENCV_KLEIDICV_URL} "
13
+ "https://gitlab.arm.com/kleidi/kleidicv/-/archive/${KLEIDICV_SRC_COMMIT} /"
14
+ DESTINATION_DIR ${THE_ROOT}
15
+ ID KLEIDICV
16
+ STATUS res
17
+ UNPACK RELATIVE_URL )
18
+ if (res )
19
+ set (${root_var} "${OpenCV_BINARY_DIR} /3rdparty/kleidicv/kleidicv-${KLEIDICV_SRC_COMMIT} " PARENT_SCOPE )
20
+ endif ()
21
+ endfunction ()
Original file line number Diff line number Diff line change @@ -935,7 +935,7 @@ if(HAVE_OPENVX)
935
935
endif ()
936
936
endif ()
937
937
938
- if (WITH_KLEIDICV )
938
+ if (HAVE_KLEIDICV )
939
939
ocv_debug_message (STATUS "Enable KleidiCV acceleration" )
940
940
if (NOT ";${OpenCV_HAL} ;" MATCHES ";kleidicv;" )
941
941
set (OpenCV_HAL "kleidicv;${OpenCV_HAL} " )
Original file line number Diff line number Diff line change @@ -161,3 +161,19 @@ if(WITH_CLP)
161
161
endif ()
162
162
endif ()
163
163
endif (WITH_CLP )
164
+
165
+ # --- ARM KleidiCV
166
+ if (WITH_KLEIDICV )
167
+ if (KLEIDICV_SOURCE_PATH AND EXISTS "${KLEIDICV_SOURCE_PATH} /adapters/opencv/CMakeLists.txt" )
168
+ set (HAVE_KLEIDICV ON )
169
+ endif ()
170
+ if (NOT HAVE_KLEIDICV )
171
+ include ("${OpenCV_SOURCE_DIR} /3rdparty/kleidicv/kleidicv.cmake" )
172
+ download_kleidicv (KLEIDICV_SOURCE_PATH )
173
+ if (KLEIDICV_SOURCE_PATH )
174
+ set (HAVE_KLEIDICV ON )
175
+ endif ()
176
+ else ()
177
+ set (HAVE_KLEIDICV OFF )
178
+ endif ()
179
+ endif (WITH_KLEIDICV )
You can’t perform that action at this time.
0 commit comments