| 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 | 920 | VectorType vector_path(ContextType ctx, VectorType src_a, | |
| 21 | VectorType src_b) KLEIDICV_STREAMING { | ||
| 22 | 920 | return svand_x(ctx.predicate(), src_a, src_b); | |
| 23 | } | ||
| 24 | }; // end of class BitwiseAnd<ScalarType> | ||
| 25 | |||
| 26 | template <typename T> | ||
| 27 | 210 | 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 3 times.
✓ Branch 1 taken 207 times.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 207 times.
|
210 | CHECK_POINTER_AND_STRIDE(src_a, src_a_stride, height); |
| 32 |
4/4✓ Branch 0 taken 3 times.
✓ Branch 1 taken 204 times.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 204 times.
|
207 | CHECK_POINTER_AND_STRIDE(src_b, src_b_stride, height); |
| 33 |
4/4✓ Branch 0 taken 3 times.
✓ Branch 1 taken 201 times.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 201 times.
|
204 | CHECK_POINTER_AND_STRIDE(dst, dst_stride, height); |
| 34 |
6/6✓ Branch 0 taken 3 times.
✓ Branch 1 taken 198 times.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 195 times.
✓ Branch 4 taken 6 times.
✓ Branch 5 taken 195 times.
|
201 | CHECK_IMAGE_SIZE(width, height); |
| 35 | |||
| 36 | 195 | BitwiseAnd<T> operation; | |
| 37 | 195 | Rectangle rect{width, height}; | |
| 38 | 195 | Rows<const T> src_a_rows{src_a, src_a_stride}; | |
| 39 | 195 | Rows<const T> src_b_rows{src_b, src_b_stride}; | |
| 40 | 195 | Rows<T> dst_rows{dst, dst_stride}; | |
| 41 | 195 | apply_operation_by_rows(operation, rect, src_a_rows, src_b_rows, dst_rows); | |
| 42 | 195 | return KLEIDICV_OK; | |
| 43 | 210 | } | |
| 44 | |||
| 45 | } // namespace KLEIDICV_TARGET_NAMESPACE | ||
| 46 | |||
| 47 | #endif // KLEIDICV_BITWISE_AND_SC_H | ||
| 48 |