KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/arithmetics/absdiff_api.cpp
Date: 2025-11-25 17:23:32
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 5 5 100.0%
Branches: 30 30 100.0%

Line Branch Exec Source
1 // SPDX-FileCopyrightText: 2023 - 2025 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/types.h"
8
9 namespace kleidicv {
10
11 namespace neon {
12
13 template <typename T>
14 kleidicv_error_t saturating_absdiff(const T *src_a, size_t src_a_stride,
15 const T *src_b, size_t src_b_stride, T *dst,
16 size_t dst_stride, size_t width,
17 size_t height);
18
19 } // namespace neon
20
21 namespace sve2 {
22
23 template <typename T>
24 kleidicv_error_t saturating_absdiff(const T *src_a, size_t src_a_stride,
25 const T *src_b, size_t src_b_stride, T *dst,
26 size_t dst_stride, size_t width,
27 size_t height);
28
29 } // namespace sve2
30
31 namespace sme {
32 template <typename T>
33 kleidicv_error_t saturating_absdiff(const T *src_a, size_t src_a_stride,
34 const T *src_b, size_t src_b_stride, T *dst,
35 size_t dst_stride, size_t width,
36 size_t height);
37
38 } // namespace sme
39
40 namespace sme2 {
41 template <typename T>
42 kleidicv_error_t saturating_absdiff(const T *src_a, size_t src_a_stride,
43 const T *src_b, size_t src_b_stride, T *dst,
44 size_t dst_stride, size_t width,
45 size_t height);
46
47 } // namespace sme2
48
49 } // namespace kleidicv
50
51 #define KLEIDICV_DEFINE_C_API(name, type) \
52 KLEIDICV_MULTIVERSION_C_API( \
53 name, &kleidicv::neon::saturating_absdiff<type>, \
54 KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::saturating_absdiff<type>), \
55 KLEIDICV_SME_IMPL_IF(&kleidicv::sme::saturating_absdiff<type>), \
56 KLEIDICV_SME2_IMPL_IF(&kleidicv::sme2::saturating_absdiff<type>))
57
58 #define KLEIDICV_DEFINE_C_API_WITH_DEFAULT_SME2(name, type) \
59 KLEIDICV_MULTIVERSION_C_API( \
60 name, &kleidicv::neon::saturating_absdiff<type>, \
61 KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::saturating_absdiff<type>), \
62 KLEIDICV_SME_IMPL_IF(&kleidicv::sme::saturating_absdiff<type>), \
63 &kleidicv::sme2::saturating_absdiff<type>)
64
65
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_saturating_absdiff_u8, uint8_t);
66
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_saturating_absdiff_s8, int8_t);
67
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_WITH_DEFAULT_SME2(kleidicv_saturating_absdiff_u16,
68 uint16_t);
69
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_WITH_DEFAULT_SME2(kleidicv_saturating_absdiff_s16,
70 int16_t);
71
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_saturating_absdiff_s32, int32_t);
72