KleidiCV Coverage Report


Directory: ./
File: kleidicv/include/kleidicv/filters/filter_2d_window_loader_7x7.h
Date: 2025-11-25 17:23:32
Exec Total Coverage
Lines: 100 100 100.0%
Functions: 28 28 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_7X7_H
6 #define KLEIDICV_FILTER_2D_WINDOW_LOADER_7X7_H
7
8 #include "kleidicv/workspace/border_7x7.h"
9
10 namespace KLEIDICV_TARGET_NAMESPACE {
11 template <typename SourceType>
12 class Filter2dWindowLoader7x7 {
13 public:
14 using BorderInfoType =
15 typename KLEIDICV_TARGET_NAMESPACE::FixedBorderInfo7x7<SourceType>;
16 using BorderOffsets = typename BorderInfoType::Offsets;
17
18 template <typename LoadArrayElementFunctionType, typename KernelWindowFunctor>
19 245840 static void load_window(KernelWindowFunctor& KernelWindow,
20 LoadArrayElementFunctionType load_array_element,
21 Rows<const SourceType> src_rows,
22 BorderOffsets window_row_offsets,
23 BorderOffsets window_col_offsets,
24 size_t index) KLEIDICV_STREAMING {
25 // first row
26 245840 KernelWindow(0, 0) = load_array_element(
27 245840 src_rows.at(window_row_offsets.c0(), window_col_offsets.c0())[index]);
28 245840 KernelWindow(0, 1) = load_array_element(
29 245840 src_rows.at(window_row_offsets.c0(), window_col_offsets.c1())[index]);
30 245840 KernelWindow(0, 2) = load_array_element(
31 245840 src_rows.at(window_row_offsets.c0(), window_col_offsets.c2())[index]);
32 245840 KernelWindow(0, 3) = load_array_element(
33 245840 src_rows.at(window_row_offsets.c0(), window_col_offsets.c3())[index]);
34 245840 KernelWindow(0, 4) = load_array_element(
35 245840 src_rows.at(window_row_offsets.c0(), window_col_offsets.c4())[index]);
36 245840 KernelWindow(0, 5) = load_array_element(
37 245840 src_rows.at(window_row_offsets.c0(), window_col_offsets.c5())[index]);
38 245840 KernelWindow(0, 6) = load_array_element(
39 245840 src_rows.at(window_row_offsets.c0(), window_col_offsets.c6())[index]);
40 // second row
41 245840 KernelWindow(1, 0) = load_array_element(
42 245840 src_rows.at(window_row_offsets.c1(), window_col_offsets.c0())[index]);
43 245840 KernelWindow(1, 1) = load_array_element(
44 245840 src_rows.at(window_row_offsets.c1(), window_col_offsets.c1())[index]);
45 245840 KernelWindow(1, 2) = load_array_element(
46 245840 src_rows.at(window_row_offsets.c1(), window_col_offsets.c2())[index]);
47 245840 KernelWindow(1, 3) = load_array_element(
48 245840 src_rows.at(window_row_offsets.c1(), window_col_offsets.c3())[index]);
49 245840 KernelWindow(1, 4) = load_array_element(
50 245840 src_rows.at(window_row_offsets.c1(), window_col_offsets.c4())[index]);
51 245840 KernelWindow(1, 5) = load_array_element(
52 245840 src_rows.at(window_row_offsets.c1(), window_col_offsets.c5())[index]);
53 245840 KernelWindow(1, 6) = load_array_element(
54 245840 src_rows.at(window_row_offsets.c1(), window_col_offsets.c6())[index]);
55 // 3
56 245840 KernelWindow(2, 0) = load_array_element(
57 245840 src_rows.at(window_row_offsets.c2(), window_col_offsets.c0())[index]);
58 245840 KernelWindow(2, 1) = load_array_element(
59 245840 src_rows.at(window_row_offsets.c2(), window_col_offsets.c1())[index]);
60 245840 KernelWindow(2, 2) = load_array_element(
61 245840 src_rows.at(window_row_offsets.c2(), window_col_offsets.c2())[index]);
62 245840 KernelWindow(2, 3) = load_array_element(
63 245840 src_rows.at(window_row_offsets.c2(), window_col_offsets.c3())[index]);
64 245840 KernelWindow(2, 4) = load_array_element(
65 245840 src_rows.at(window_row_offsets.c2(), window_col_offsets.c4())[index]);
66 245840 KernelWindow(2, 5) = load_array_element(
67 245840 src_rows.at(window_row_offsets.c2(), window_col_offsets.c5())[index]);
68 245840 KernelWindow(2, 6) = load_array_element(
69 245840 src_rows.at(window_row_offsets.c2(), window_col_offsets.c6())[index]);
70 // 4
71 245840 KernelWindow(3, 0) = load_array_element(
72 245840 src_rows.at(window_row_offsets.c3(), window_col_offsets.c0())[index]);
73 245840 KernelWindow(3, 1) = load_array_element(
74 245840 src_rows.at(window_row_offsets.c3(), window_col_offsets.c1())[index]);
75 245840 KernelWindow(3, 2) = load_array_element(
76 245840 src_rows.at(window_row_offsets.c3(), window_col_offsets.c2())[index]);
77 245840 KernelWindow(3, 3) = load_array_element(
78 245840 src_rows.at(window_row_offsets.c3(), window_col_offsets.c3())[index]);
79 245840 KernelWindow(3, 4) = load_array_element(
80 245840 src_rows.at(window_row_offsets.c3(), window_col_offsets.c4())[index]);
81 245840 KernelWindow(3, 5) = load_array_element(
82 245840 src_rows.at(window_row_offsets.c3(), window_col_offsets.c5())[index]);
83 245840 KernelWindow(3, 6) = load_array_element(
84 245840 src_rows.at(window_row_offsets.c3(), window_col_offsets.c6())[index]);
85 // 5
86 245840 KernelWindow(4, 0) = load_array_element(
87 245840 src_rows.at(window_row_offsets.c4(), window_col_offsets.c0())[index]);
88 245840 KernelWindow(4, 1) = load_array_element(
89 245840 src_rows.at(window_row_offsets.c4(), window_col_offsets.c1())[index]);
90 245840 KernelWindow(4, 2) = load_array_element(
91 245840 src_rows.at(window_row_offsets.c4(), window_col_offsets.c2())[index]);
92 245840 KernelWindow(4, 3) = load_array_element(
93 245840 src_rows.at(window_row_offsets.c4(), window_col_offsets.c3())[index]);
94 245840 KernelWindow(4, 4) = load_array_element(
95 245840 src_rows.at(window_row_offsets.c4(), window_col_offsets.c4())[index]);
96 245840 KernelWindow(4, 5) = load_array_element(
97 245840 src_rows.at(window_row_offsets.c4(), window_col_offsets.c5())[index]);
98 245840 KernelWindow(4, 6) = load_array_element(
99 245840 src_rows.at(window_row_offsets.c4(), window_col_offsets.c6())[index]);
100 // 6
101 245840 KernelWindow(5, 0) = load_array_element(
102 245840 src_rows.at(window_row_offsets.c5(), window_col_offsets.c0())[index]);
103 245840 KernelWindow(5, 1) = load_array_element(
104 245840 src_rows.at(window_row_offsets.c5(), window_col_offsets.c1())[index]);
105 245840 KernelWindow(5, 2) = load_array_element(
106 245840 src_rows.at(window_row_offsets.c5(), window_col_offsets.c2())[index]);
107 245840 KernelWindow(5, 3) = load_array_element(
108 245840 src_rows.at(window_row_offsets.c5(), window_col_offsets.c3())[index]);
109 245840 KernelWindow(5, 4) = load_array_element(
110 245840 src_rows.at(window_row_offsets.c5(), window_col_offsets.c4())[index]);
111 245840 KernelWindow(5, 5) = load_array_element(
112 245840 src_rows.at(window_row_offsets.c5(), window_col_offsets.c5())[index]);
113 245840 KernelWindow(5, 6) = load_array_element(
114 245840 src_rows.at(window_row_offsets.c5(), window_col_offsets.c6())[index]);
115 // 7
116 245840 KernelWindow(6, 0) = load_array_element(
117 245840 src_rows.at(window_row_offsets.c6(), window_col_offsets.c0())[index]);
118 245840 KernelWindow(6, 1) = load_array_element(
119 245840 src_rows.at(window_row_offsets.c6(), window_col_offsets.c1())[index]);
120 245840 KernelWindow(6, 2) = load_array_element(
121 245840 src_rows.at(window_row_offsets.c6(), window_col_offsets.c2())[index]);
122 245840 KernelWindow(6, 3) = load_array_element(
123 245840 src_rows.at(window_row_offsets.c6(), window_col_offsets.c3())[index]);
124 245840 KernelWindow(6, 4) = load_array_element(
125 245840 src_rows.at(window_row_offsets.c6(), window_col_offsets.c4())[index]);
126 245840 KernelWindow(6, 5) = load_array_element(
127 245840 src_rows.at(window_row_offsets.c6(), window_col_offsets.c5())[index]);
128 245840 KernelWindow(6, 6) = load_array_element(
129 245840 src_rows.at(window_row_offsets.c6(), window_col_offsets.c6())[index]);
130 245840 }
131 };
132
133 } // namespace KLEIDICV_TARGET_NAMESPACE
134
135 #endif // KLEIDICV_FILTER_2D_WINDOW_LOADER_7X7_H
136