Skip to content

Commit 542e22a

Browse files
committed
Merge branch 4.x
2 parents 02a72d1 + ab82106 commit 542e22a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2362
-398
lines changed

modules/cannops/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ ocv_include_directories(${CMAKE_SOURCE_DIR}/modules/ts/include)
1515
ocv_add_accuracy_tests(DEPENDS_ON opencv_cannops)
1616
ocv_add_perf_tests(DEPENDS_ON opencv_cannops)
1717
ocv_add_samples(opencv_cannops)
18+
19+
# compile ascnedc kernels.
20+
add_subdirectory(ascendc_kernels)
21+
ocv_include_directories(${CMAKE_BINARY_DIR}/include/ascendc_kernels)
22+
ocv_target_link_libraries(opencv_cannops PRIVATE ascendc_kernels)
23+
ocv_target_link_libraries(opencv_test_cannops PRIVATE ascendc_kernels)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set(SOC_VERSION "ascend310p3" CACHE STRING "system on chip type")
2+
set(ASCEND_CANN_PACKAGE_PATH "/usr/local/Ascend/ascend-toolkit/latest" CACHE PATH "ASCEND CANN package installation directory")
3+
set(RUN_MODE "npu" CACHE STRING "run mode: npu/sim/cpu")
4+
5+
if(EXISTS ${ASCEND_CANN_PACKAGE_PATH}/compiler/tikcpp/ascendc_kernel_cmake)
6+
set(ASCENDC_CMAKE_DIR ${ASCEND_CANN_PACKAGE_PATH}/compiler/tikcpp/ascendc_kernel_cmake)
7+
elseif(EXISTS ${ASCEND_CANN_PACKAGE_PATH}/ascendc_devkit/tikcpp/samples/cmake)
8+
set(ASCENDC_CMAKE_DIR ${ASCEND_CANN_PACKAGE_PATH}/ascendc_devkit/tikcpp/samples/cmake)
9+
else()
10+
message(FATAL_ERROR "ascendc_kernel_cmake does not exist, please check whether the compiler package is installed.")
11+
endif()
12+
13+
include(${ASCENDC_CMAKE_DIR}/ascendc.cmake)
14+
15+
ascendc_library(ascendc_kernels STATIC
16+
threshold_opencv_kernel.cpp
17+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef KERNEL_TILING_H
2+
#define KERNEL_TILING_H
3+
4+
/*
5+
* threshType:
6+
* THRESH_BINARY = 0,
7+
* THRESH_BINARY_INV = 1,
8+
* THRESH_TRUNC = 2,
9+
* THRESH_TOZERO = 3,
10+
* THRESH_TOZERO_INV = 4,
11+
*/
12+
#pragma pack(push, 8)
13+
struct ThresholdOpencvTilingData
14+
{
15+
float maxVal;
16+
float thresh;
17+
uint32_t totalLength;
18+
uint8_t threshType;
19+
uint8_t dtype;
20+
};
21+
#pragma pack(pop)
22+
#endif // KERNEL_TILING_H

0 commit comments

Comments
 (0)