KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/arithmetics/add_api.cpp
Date: 2025-11-25 17:23:32
Exec Total Coverage
Lines: 8 8 100.0%
Functions: 8 8 100.0%
Branches: 48 48 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_add(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, size_t height);
17
18 } // namespace neon
19
20 namespace sve2 {
21
22 template <typename T>
23 kleidicv_error_t saturating_add(const T *src_a, size_t src_a_stride,
24 const T *src_b, size_t src_b_stride, T *dst,
25 size_t dst_stride, size_t width, size_t height);
26
27 } // namespace sve2
28
29 namespace sme {
30 template <typename T>
31 kleidicv_error_t saturating_add(const T *src_a, size_t src_a_stride,
32 const T *src_b, size_t src_b_stride, T *dst,
33 size_t dst_stride, size_t width, size_t height);
34
35 } // namespace sme
36
37 namespace sme2 {
38 template <typename T>
39 kleidicv_error_t saturating_add(const T *src_a, size_t src_a_stride,
40 const T *src_b, size_t src_b_stride, T *dst,
41 size_t dst_stride, size_t width, size_t height);
42
43 } // namespace sme2
44
45 } // namespace kleidicv
46
47 #define KLEIDICV_DEFINE_C_API(name, type) \
48 KLEIDICV_MULTIVERSION_C_API( \
49 name, &kleidicv::neon::saturating_add<type>, \
50 KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::saturating_add<type>), \
51 KLEIDICV_SME_IMPL_IF(&kleidicv::sme::saturating_add<type>), \
52 KLEIDICV_SME2_IMPL_IF(&kleidicv::sme2::saturating_add<type>))
53
54
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_add_s8, int8_t);
55
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_add_u8, uint8_t);
56
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_add_s16, int16_t);
57
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_add_u16, uint16_t);
58
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_add_s32, int32_t);
59
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_add_u32, uint32_t);
60
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_add_s64, int64_t);
61
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_add_u64, uint64_t);
62