1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #24231 from fengyuentau:halide_cleanup_5.x

dnn: cleanup of halide backend for 5.x #24231

Merge with https://github.com/opencv/opencv_extra/pull/1092.

### 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
- [x] 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
This commit is contained in:
Yuantao Feng
2023-10-13 08:53:18 -05:00
committed by GitHub
parent 0976765c62
commit d789cb459c
59 changed files with 226 additions and 2610 deletions
-47
View File
@@ -1,47 +0,0 @@
cmake_minimum_required(VERSION ${MIN_VER_CMAKE})
if(" ${HALIDE_ROOT_DIR}" STREQUAL " ")
unset(HALIDE_ROOT_DIR CACHE)
endif()
ocv_check_environment_variables(HALIDE_ROOT_DIR)
set(HALIDE_ROOT_DIR "${HALIDE_ROOT_DIR}" CACHE PATH "Halide root directory")
if(NOT HAVE_HALIDE)
find_package(Halide QUIET) # Try CMake-based config files
if(Halide_FOUND)
if(TARGET Halide::Halide) # modern Halide scripts defines imported target
set(HALIDE_INCLUDE_DIRS "")
set(HALIDE_LIBRARIES "Halide::Halide")
set(HAVE_HALIDE TRUE)
else()
# using HALIDE_INCLUDE_DIRS / Halide_LIBRARIES
set(HAVE_HALIDE TRUE)
endif()
endif()
endif()
if(NOT HAVE_HALIDE AND HALIDE_ROOT_DIR)
# Try manual search
find_library(HALIDE_LIBRARY
NAMES Halide
HINTS ${HALIDE_ROOT_DIR}/lib # Unix
HINTS ${HALIDE_ROOT_DIR}/lib/Release # Win32
)
find_path(HALIDE_INCLUDE_DIR
NAMES Halide.h HalideRuntime.h
HINTS ${HALIDE_ROOT_DIR}/include
)
if(HALIDE_LIBRARY AND HALIDE_INCLUDE_DIR)
# TODO try_compile
set(HALIDE_INCLUDE_DIRS "${HALIDE_INCLUDE_DIR}")
set(HALIDE_LIBRARIES "${HALIDE_LIBRARY}")
set(HAVE_HALIDE TRUE)
endif()
endif()
if(HAVE_HALIDE)
if(HALIDE_INCLUDE_DIRS)
include_directories(${HALIDE_INCLUDE_DIRS})
endif()
list(APPEND OPENCV_LINKER_LIBS ${HALIDE_LIBRARIES})
endif()
-3
View File
@@ -53,9 +53,6 @@
/* Geospatial Data Abstraction Library */
#cmakedefine HAVE_GDAL
/* Halide support */
#cmakedefine HAVE_HALIDE
/* Vulkan support */
#cmakedefine HAVE_VULKAN