KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/logical/bitwise_and_sc.h
Date: 2025-09-25 14:13:34
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 4 4 100.0%
Branches: 18 18 100.0%

Line Branch Exec Source
1 // SPDX-FileCopyrightText: 2024 - 2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
2 //
3 // SPDX-License-Identifier: Apache-2.0
4
5 #ifndef KLEIDICV_BITWISE_AND_SC_H
6 #define KLEIDICV_BITWISE_AND_SC_H
7
8 #include "kleidicv/kleidicv.h"
9 #include "kleidicv/sve2.h"
10
11 namespace KLEIDICV_TARGET_NAMESPACE {
12
13 template <typename ScalarType>
14 class BitwiseAnd final : public UnrollTwice {
15 public:
16 using ContextType = Context;
17 using VecTraits = KLEIDICV_TARGET_NAMESPACE::VecTraits<ScalarType>;
18 using VectorType = typename VecTraits::VectorType;
19
20 720 VectorType vector_path(ContextType ctx, VectorType src_a,
21 VectorType src_b) KLEIDICV_STREAMING {
22 720 return svand_x(ctx.predicate(), src_a, src_b);
23 }
24 }; // end of class BitwiseAnd<ScalarType>
25
26 template <typename T>
27 140 kleidicv_error_t bitwise_and_sc(const T *src_a, size_t src_a_stride,
28 const T *src_b, size_t src_b_stride, T *dst,
29 size_t dst_stride, size_t width,
30 size_t height) KLEIDICV_STREAMING {
31
4/4
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 138 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 138 times.
140 CHECK_POINTER_AND_STRIDE(src_a, src_a_stride, height);
32
4/4
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 136 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 136 times.
138 CHECK_POINTER_AND_STRIDE(src_b, src_b_stride, height);
33
4/4
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 134 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 134 times.
136 CHECK_POINTER_AND_STRIDE(dst, dst_stride, height);
34
6/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 132 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 130 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 130 times.
134 CHECK_IMAGE_SIZE(width, height);
35
36 130 BitwiseAnd<T> operation;
37 130 Rectangle rect{width, height};
38 130 Rows<const T> src_a_rows{src_a, src_a_stride};
39 130 Rows<const T> src_b_rows{src_b, src_b_stride};
40 130 Rows<T> dst_rows{dst, dst_stride};
41 130 apply_operation_by_rows(operation, rect, src_a_rows, src_b_rows, dst_rows);
42 130 return KLEIDICV_OK;
43 140 }
44
45 } // namespace KLEIDICV_TARGET_NAMESPACE
46
47 #endif // KLEIDICV_BITWISE_AND_SC_H
48