KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/arithmetics/sub_api.cpp
Date: 2025-09-25 14:13:34
Exec Total Coverage
Lines: 8 8 100.0%
Functions: 8 8 100.0%
Branches: 32 32 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
8 namespace kleidicv {
9
10 namespace neon {
11
12 template <typename T>
13 kleidicv_error_t saturating_sub(const T *src_a, size_t src_a_stride,
14 const T *src_b, size_t src_b_stride, T *dst,
15 size_t dst_stride, size_t width, size_t height);
16
17 } // namespace neon
18
19 namespace sve2 {
20
21 template <typename T>
22 kleidicv_error_t saturating_sub(const T *src_a, size_t src_a_stride,
23 const T *src_b, size_t src_b_stride, T *dst,
24 size_t dst_stride, size_t width, size_t height);
25
26 } // namespace sve2
27
28 namespace sme {
29 template <typename T>
30 kleidicv_error_t saturating_sub(const T *src_a, size_t src_a_stride,
31 const T *src_b, size_t src_b_stride, T *dst,
32 size_t dst_stride, size_t width, size_t height);
33
34 } // namespace sme
35
36 } // namespace kleidicv
37
38 #define KLEIDICV_DEFINE_C_API(name, type) \
39 KLEIDICV_MULTIVERSION_C_API( \
40 name, &kleidicv::neon::saturating_sub<type>, \
41 KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::saturating_sub<type>), \
42 KLEIDICV_SME_IMPL_IF(&kleidicv::sme::saturating_sub<type>), nullptr)
43
44
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_s8, int8_t);
45
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_u8, uint8_t);
46
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_s16, int16_t);
47
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_u16, uint16_t);
48
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_s32, int32_t);
49
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_u32, uint32_t);
50
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_s64, int64_t);
51
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_saturating_sub_u64, uint64_t);
52