KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/arithmetics/multiply_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
8 namespace kleidicv {
9
10 namespace neon {
11
12 template <typename T>
13 kleidicv_error_t saturating_multiply(const T *src_a, size_t src_a_stride,
14 const T *src_b, size_t src_b_stride,
15 T *dst, size_t dst_stride, size_t width,
16 size_t height, double scale);
17
18 } // namespace neon
19
20 namespace sve2 {
21
22 template <typename T>
23 kleidicv_error_t saturating_multiply(const T *src_a, size_t src_a_stride,
24 const T *src_b, size_t src_b_stride,
25 T *dst, size_t dst_stride, size_t width,
26 size_t height, double scale);
27
28 } // namespace sve2
29
30 namespace sme {
31
32 template <typename T>
33 kleidicv_error_t saturating_multiply(const T *src_a, size_t src_a_stride,
34 const T *src_b, size_t src_b_stride,
35 T *dst, size_t dst_stride, size_t width,
36 size_t height, double scale);
37
38 } // namespace sme
39
40 namespace sme2 {
41
42 template <typename T>
43 kleidicv_error_t saturating_multiply(const T *src_a, size_t src_a_stride,
44 const T *src_b, size_t src_b_stride,
45 T *dst, size_t dst_stride, size_t width,
46 size_t height, double scale);
47
48 } // namespace sme2
49
50 } // namespace kleidicv
51
52 #define KLEIDICV_DEFINE_C_API(name, type) \
53 KLEIDICV_MULTIVERSION_C_API( \
54 name, &kleidicv::neon::saturating_multiply<type>, \
55 KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::saturating_multiply<type>), \
56 KLEIDICV_SME_IMPL_IF(&kleidicv::sme::saturating_multiply<type>), \
57 KLEIDICV_SME2_IMPL_IF(&kleidicv::sme2::saturating_multiply<type>))
58
59 #define KLEIDICV_DEFINE_C_API_WITH_DEFAULT_SME(name, type) \
60 KLEIDICV_MULTIVERSION_C_API( \
61 name, &kleidicv::neon::saturating_multiply<type>, \
62 KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::saturating_multiply<type>), \
63 &kleidicv::sme::saturating_multiply<type>, \
64 &kleidicv::sme2::saturating_multiply<type>)
65
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_WITH_DEFAULT_SME(kleidicv_saturating_multiply_u8,
67 uint8_t);
68
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_SME(kleidicv_saturating_multiply_s8, int8_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_SME(kleidicv_saturating_multiply_u16,
70 uint16_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_WITH_DEFAULT_SME(kleidicv_saturating_multiply_s16,
72 int16_t);
73
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_multiply_s32, int32_t);
74