Merge pull request #27252 from asmorkalov:as/extract_hal

Extract all HALs from 3rdparty to dedicated folder. #27252

### 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
- [ ] 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
This commit is contained in:
Alexander Smorkalov 2025-04-25 14:56:42 +03:00 committed by GitHub
parent 9533c5633d
commit 19c4d97638
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
150 changed files with 54 additions and 56 deletions

View File

@ -1005,7 +1005,7 @@ endif()
foreach(hal ${OpenCV_HAL})
if(hal STREQUAL "carotene")
if(";${CPU_BASELINE_FINAL};" MATCHES ";NEON;")
add_subdirectory(3rdparty/carotene/hal)
add_subdirectory(hal/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()
@ -1013,19 +1013,19 @@ foreach(hal ${OpenCV_HAL})
endif()
elseif(hal STREQUAL "fastcv")
if((ARM OR AARCH64) AND (ANDROID OR (UNIX AND NOT APPLE AND NOT IOS AND NOT XROS)))
add_subdirectory(3rdparty/fastcv)
add_subdirectory(hal/fastcv)
ocv_hal_register(FASTCV_HAL_LIBRARIES FASTCV_HAL_HEADERS FASTCV_HAL_INCLUDE_DIRS)
list(APPEND OpenCV_USED_HAL "fastcv (ver ${FASTCV_HAL_VERSION})")
else()
message(STATUS "FastCV: fastcv is not available, disabling fastcv...")
endif()
elseif(hal STREQUAL "kleidicv")
add_subdirectory(3rdparty/kleidicv)
add_subdirectory(hal/kleidicv)
ocv_hal_register(KLEIDICV_HAL_LIBRARIES KLEIDICV_HAL_HEADERS KLEIDICV_HAL_INCLUDE_DIRS)
list(APPEND OpenCV_USED_HAL "KleidiCV (ver ${KLEIDICV_HAL_VERSION})")
elseif(hal STREQUAL "ndsrvp")
if(CMAKE_C_FLAGS MATCHES "-mext-dsp" AND CMAKE_CXX_FLAGS MATCHES "-mext-dsp" AND NOT ";${CPU_BASELINE_FINAL};" MATCHES ";RVV;")
add_subdirectory(3rdparty/ndsrvp)
add_subdirectory(hal/ndsrvp)
ocv_hal_register(NDSRVP_HAL_LIBRARIES NDSRVP_HAL_HEADERS NDSRVP_HAL_INCLUDE_DIRS)
list(APPEND OpenCV_USED_HAL "ndsrvp (ver ${NDSRVP_HAL_VERSION})")
else()
@ -1033,18 +1033,18 @@ foreach(hal ${OpenCV_HAL})
endif()
elseif(hal STREQUAL "halrvv")
if(";${CPU_BASELINE_FINAL};" MATCHES ";RVV;")
add_subdirectory(3rdparty/hal_rvv/)
add_subdirectory(hal/riscv-rvv)
ocv_hal_register(RVV_HAL_LIBRARIES RVV_HAL_HEADERS RVV_HAL_INCLUDE_DIRS)
list(APPEND OpenCV_USED_HAL "HAL RVV (ver ${RVV_HAL_VERSION})")
else()
message(STATUS "HAL RVV: RVV is not available, disabling halrvv...")
endif()
elseif(hal STREQUAL "ipp")
add_subdirectory(3rdparty/ipphal)
add_subdirectory(hal/ipp)
ocv_hal_register(IPP_HAL_LIBRARIES IPP_HAL_HEADERS IPP_HAL_INCLUDE_DIRS)
list(APPEND OpenCV_USED_HAL "ipp (ver ${IPP_HAL_VERSION})")
elseif(hal STREQUAL "openvx")
add_subdirectory(3rdparty/openvx)
add_subdirectory(hal/openvx)
ocv_hal_register(OPENVX_HAL_LIBRARIES OPENVX_HAL_HEADERS OPENVX_HAL_INCLUDE_DIRS)
list(APPEND OpenCV_USED_HAL "openvx (ver ${OPENVX_HAL_VERSION})")
else()

View File

@ -169,7 +169,7 @@ if(WITH_KLEIDICV)
set(HAVE_KLEIDICV ON)
endif()
if(NOT HAVE_KLEIDICV)
include("${OpenCV_SOURCE_DIR}/3rdparty/kleidicv/kleidicv.cmake")
include("${OpenCV_SOURCE_DIR}/hal/kleidicv/kleidicv.cmake")
download_kleidicv(KLEIDICV_SOURCE_PATH)
if(KLEIDICV_SOURCE_PATH)
set(HAVE_KLEIDICV ON)

View File

@ -359,7 +359,7 @@ namespace CAROTENE_NS {
/*
For each point `p` within `size`, do:
dst[p] = src0[p] * scale / src1[p]
dst[p] = src0[p] * scale / src1[p]
NOTE: ROUND_TO_ZERO convert policy is used
*/
@ -420,7 +420,7 @@ namespace CAROTENE_NS {
/*
For each point `p` within `size`, do:
dst[p] = scale / src[p]
dst[p] = scale / src[p]
NOTE: ROUND_TO_ZERO convert policy is used
*/

View File

@ -378,7 +378,7 @@ void extract4(const Size2D &size,
vst1q_##sgn##bits(dst1 + d1j, vals.v4.val[3]); \
}
#endif
#endif
#define SPLIT4ALPHA(sgn,bits) void split4(const Size2D &_size, \
const sgn##bits * srcBase, ptrdiff_t srcStride, \

View File

@ -704,7 +704,6 @@ int fastcv_hal_gemm32f(
fcvMatrixMultiplyf32_v2(src2p, m, k, src2_step, src1p, n, src1_step,
dst_temp2.ptr<float>(), dst_temp2.step[0]);
fcvTransposef32_v2(dst_temp2.ptr<float>(), n, k, dst_temp2.step[0], dstp, dst_stride);
}
else
{
@ -738,4 +737,4 @@ int fastcv_hal_gemm32f(
}
CV_HAL_RETURN(status,hal_gemm32f);
}
}

View File

@ -452,7 +452,7 @@ int fastcv_hal_boxFilter(
nStripes = nThreads;
stripeHeight = src.rows/nThreads;
}
cv::parallel_for_(cv::Range(0, nStripes),
FcvBoxLoop_Invoker(src, width, height, dst_temp, border_type, ksize_width, normalize, stripeHeight, nStripes, src_depth), nStripes);
@ -1139,4 +1139,4 @@ int fastcv_hal_canny(
CV_HAL_RETURN_NOT_IMPLEMENTED(cv::format("Ksize:%d is not supported", ksize));
}
CV_HAL_RETURN(status, hal_canny);
}
}

View File

@ -1,6 +1,6 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_NDSRVP_FEATURES2D_HPP
#define OPENCV_NDSRVP_FEATURES2D_HPP

View File

@ -1,6 +1,6 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// of this distribution and at http://opencv.org/license.html.
#include "cvutils.hpp"

View File

@ -1,6 +1,6 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_NDSRVP_CVUTILS_HPP
#define OPENCV_NDSRVP_CVUTILS_HPP

View File

@ -1,6 +1,6 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// of this distribution and at http://opencv.org/license.html.
#include "ndsrvp_hal.hpp"
#include "opencv2/imgproc/hal/interface.h"
@ -49,7 +49,7 @@ int integral(int depth, int sdepth, int sqdepth,
int j = 0;
for (; j + 8 <= width; j += 8) {
unsigned long vs8x8 = *(unsigned long*)(src_row + j);
unsigned long vs8x8 = *(unsigned long*)(src_row + j);
unsigned long vs810 = __nds__zunpkd810(vs8x8);
unsigned long vs832 = __nds__zunpkd832(vs8x8);

View File

@ -287,7 +287,7 @@ int medianBlur(const uchar* src_data, size_t src_step,
medianBlur_SortNet<ushort, int, uint16x4_t>( src_data_rep, src_step, dst_data, dst_step, width, height, cn, ksize );
else if( depth == CV_16S )
medianBlur_SortNet<short, int, int16x4_t>( src_data_rep, src_step, dst_data, dst_step, width, height, cn, ksize );
else
else
return CV_HAL_ERROR_NOT_IMPLEMENTED;
return CV_HAL_ERROR_OK;

View File

@ -1,6 +1,6 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// of this distribution and at http://opencv.org/license.html.
#include "ndsrvp_hal.hpp"
#include "opencv2/imgproc/hal/interface.h"
@ -129,13 +129,13 @@ int threshold(const uchar* src_data, size_t src_step,
{
threshold_op<uchar, uint8x8_t, 8, opThreshBinary_t>,
threshold_op<uchar, uint8x8_t, 8, opThreshBinaryInv_t>,
threshold_op<uchar, uint8x8_t, 8, opThreshTrunc_t>,
threshold_op<uchar, uint8x8_t, 8, opThreshTrunc_t>,
threshold_op<uchar, uint8x8_t, 8, opThreshToZero_t>,
threshold_op<uchar, uint8x8_t, 8, opThreshToZeroInv_t> },
{
threshold_op<char, int8x8_t, 8, opThreshBinary_t>,
threshold_op<char, int8x8_t, 8, opThreshBinaryInv_t>,
threshold_op<char, int8x8_t, 8, opThreshTrunc_t>,
threshold_op<char, int8x8_t, 8, opThreshTrunc_t>,
threshold_op<char, int8x8_t, 8, opThreshToZero_t>,
threshold_op<char, int8x8_t, 8, opThreshToZeroInv_t> },
{

View File

@ -1,6 +1,6 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// of this distribution and at http://opencv.org/license.html.
#include "ndsrvp_hal.hpp"
#include "opencv2/imgproc/hal/interface.h"

View File

@ -1,6 +1,6 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// of this distribution and at http://opencv.org/license.html.
#include "ndsrvp_hal.hpp"
#include "opencv2/imgproc/hal/interface.h"

Some files were not shown because too many files have changed in this diff Show More