KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/morphology/morphology_api.cpp
Date: 2026-03-05 15:57:40
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 2 2 100.0%
Branches: 12 12 100.0%

Line Branch Exec Source
1 // SPDX-FileCopyrightText: 2023 - 2026 Arm Limited and/or its affiliates <open-source-office@arm.com>
2 //
3 // SPDX-License-Identifier: Apache-2.0
4
5 #include "kleidicv/dispatch.h"
6 #include "kleidicv/kleidicv.h"
7 #include "kleidicv/morphology/workspace.h"
8
9 namespace kleidicv {
10
11 namespace neon {
12
13 template <typename T>
14 kleidicv_error_t dilate(const T *src, size_t src_stride, T *dst,
15 size_t dst_stride, size_t width, size_t height,
16 size_t channels, size_t kernel_width,
17 size_t kernel_height, size_t anchor_x, size_t anchor_y,
18 kleidicv_border_type_t border_type,
19 const uint8_t *border_value, size_t iterations);
20
21 template <typename T>
22 kleidicv_error_t erode(const T *src, size_t src_stride, T *dst,
23 size_t dst_stride, size_t width, size_t height,
24 size_t channels, size_t kernel_width,
25 size_t kernel_height, size_t anchor_x, size_t anchor_y,
26 kleidicv_border_type_t border_type,
27 const uint8_t *border_value, size_t iterations);
28
29 } // namespace neon
30
31 namespace sve2 {
32
33 template <typename T>
34 kleidicv_error_t dilate(const T *src, size_t src_stride, T *dst,
35 size_t dst_stride, size_t width, size_t height,
36 size_t channels, size_t kernel_width,
37 size_t kernel_height, size_t anchor_x, size_t anchor_y,
38 kleidicv_border_type_t border_type,
39 const uint8_t *border_value, size_t iterations);
40
41 template <typename T>
42 kleidicv_error_t erode(const T *src, size_t src_stride, T *dst,
43 size_t dst_stride, size_t width, size_t height,
44 size_t channels, size_t kernel_width,
45 size_t kernel_height, size_t anchor_x, size_t anchor_y,
46 kleidicv_border_type_t border_type,
47 const uint8_t *border_value, size_t iterations);
48
49 } // namespace sve2
50
51 namespace sme {
52
53 template <typename T>
54 kleidicv_error_t dilate(const T *src, size_t src_stride, T *dst,
55 size_t dst_stride, size_t width, size_t height,
56 size_t channels, size_t kernel_width,
57 size_t kernel_height, size_t anchor_x, size_t anchor_y,
58 kleidicv_border_type_t border_type,
59 const uint8_t *border_value, size_t iterations);
60
61 template <typename T>
62 kleidicv_error_t erode(const T *src, size_t src_stride, T *dst,
63 size_t dst_stride, size_t width, size_t height,
64 size_t channels, size_t kernel_width,
65 size_t kernel_height, size_t anchor_x, size_t anchor_y,
66 kleidicv_border_type_t border_type,
67 const uint8_t *border_value, size_t iterations);
68
69 } // namespace sme
70
71 namespace sme2 {
72
73 template <typename T>
74 kleidicv_error_t dilate(const T *src, size_t src_stride, T *dst,
75 size_t dst_stride, size_t width, size_t height,
76 size_t channels, size_t kernel_width,
77 size_t kernel_height, size_t anchor_x, size_t anchor_y,
78 kleidicv_border_type_t border_type,
79 const uint8_t *border_value, size_t iterations);
80
81 template <typename T>
82 kleidicv_error_t erode(const T *src, size_t src_stride, T *dst,
83 size_t dst_stride, size_t width, size_t height,
84 size_t channels, size_t kernel_width,
85 size_t kernel_height, size_t anchor_x, size_t anchor_y,
86 kleidicv_border_type_t border_type,
87 const uint8_t *border_value, size_t iterations);
88
89 } // namespace sme2
90
91 } // namespace kleidicv
92
93 #define KLEIDICV_DEFINE_C_API(name, tname, type) \
94 KLEIDICV_MULTIVERSION_C_API( \
95 name, &kleidicv::neon::tname<type>, \
96 KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::tname<type>), \
97 KLEIDICV_SME_IMPL_IF(&kleidicv::sme::tname<type>), \
98 KLEIDICV_SME2_IMPL_IF(&kleidicv::sme2::tname<type>))
99
100
6/6
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
10 KLEIDICV_DEFINE_C_API(kleidicv_dilate_u8, dilate, uint8_t);
101
6/6
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 times.
10 KLEIDICV_DEFINE_C_API(kleidicv_erode_u8, erode, uint8_t);
102