KleidiCV Coverage Report


Directory: ./
File: kleidicv/include/kleidicv/filters/filter_2d_window_loader_3x3.h
Date: 2026-01-20 20:58:59
Exec Total Coverage
Lines: 30 30 100.0%
Functions: 84 84 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 // SPDX-FileCopyrightText: 2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
2 //
3 // SPDX-License-Identifier: Apache-2.0
4
5 #ifndef KLEIDICV_FILTER_2D_WINDOW_LOADER_3X3_H
6 #define KLEIDICV_FILTER_2D_WINDOW_LOADER_3X3_H
7
8 #include "kleidicv/types.h"
9 #include "kleidicv/workspace/border_3x3.h"
10
11 namespace KLEIDICV_TARGET_NAMESPACE {
12 template <typename SourceType>
13 class Filter2dWindowLoader3x3 {
14 public:
15 using BorderInfoType =
16 typename KLEIDICV_TARGET_NAMESPACE::FixedBorderInfo3x3<SourceType>;
17 using BorderOffsets = typename BorderInfoType::Offsets;
18
19 template <typename LoadArrayElementFunctionType, typename KernelWindowFunctor>
20 44708 static void load_window(KernelWindowFunctor& KernelWindow,
21 LoadArrayElementFunctionType load_array_element,
22 Rows<const SourceType> src_rows,
23 BorderOffsets window_row_offsets,
24 BorderOffsets window_col_offsets,
25 size_t index) KLEIDICV_STREAMING {
26 44708 KernelWindow(0, 0) = load_array_element(
27 44708 src_rows.at(window_row_offsets.c0(), window_col_offsets.c0())[index]);
28 44708 KernelWindow(0, 1) = load_array_element(
29 44708 src_rows.at(window_row_offsets.c0(), window_col_offsets.c1())[index]);
30 44708 KernelWindow(0, 2) = load_array_element(
31 44708 src_rows.at(window_row_offsets.c0(), window_col_offsets.c2())[index]);
32
33 44708 KernelWindow(1, 0) = load_array_element(
34 44708 src_rows.at(window_row_offsets.c1(), window_col_offsets.c0())[index]);
35 44708 KernelWindow(1, 1) = load_array_element(
36 44708 src_rows.at(window_row_offsets.c1(), window_col_offsets.c1())[index]);
37 44708 KernelWindow(1, 2) = load_array_element(
38 44708 src_rows.at(window_row_offsets.c1(), window_col_offsets.c2())[index]);
39
40 44708 KernelWindow(2, 0) = load_array_element(
41 44708 src_rows.at(window_row_offsets.c2(), window_col_offsets.c0())[index]);
42 44708 KernelWindow(2, 1) = load_array_element(
43 44708 src_rows.at(window_row_offsets.c2(), window_col_offsets.c1())[index]);
44 44708 KernelWindow(2, 2) = load_array_element(
45 44708 src_rows.at(window_row_offsets.c2(), window_col_offsets.c2())[index]);
46 44708 }
47
48 template <typename LoadArrayElementFunctionType, typename KernelWindowFunctor>
49 36388 static void load_window_to_handle_dual_rows(
50 KernelWindowFunctor& KernelWindow,
51 LoadArrayElementFunctionType load_array_element,
52 Rows<const SourceType> src_rows, BorderOffsets window_row_offsets_0,
53 BorderOffsets window_row_offsets_1, BorderOffsets window_col_offsets,
54 size_t index) KLEIDICV_STREAMING {
55 72776 load_window(KernelWindow, load_array_element, src_rows,
56 36388 window_row_offsets_0, window_col_offsets, index);
57
58 109164 KernelWindow(3, 0) = load_array_element(src_rows.at(
59 72776 window_row_offsets_1.c2() + 1, window_col_offsets.c0())[index]);
60 109164 KernelWindow(3, 1) = load_array_element(src_rows.at(
61 72776 window_row_offsets_1.c2() + 1, window_col_offsets.c1())[index]);
62 109164 KernelWindow(3, 2) = load_array_element(src_rows.at(
63 72776 window_row_offsets_1.c2() + 1, window_col_offsets.c2())[index]);
64 36388 }
65 };
66 } // namespace KLEIDICV_TARGET_NAMESPACE
67
68 #endif // KLEIDICV_FILTER_2D_WINDOW_LOADER_3X3_BASE_H
69