| 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_5X5_H | ||
| 6 | #define KLEIDICV_FILTER_2D_WINDOW_LOADER_5X5_H | ||
| 7 | |||
| 8 | #include "kleidicv/workspace/border_5x5.h" | ||
| 9 | |||
| 10 | namespace KLEIDICV_TARGET_NAMESPACE { | ||
| 11 | template <typename SourceType> | ||
| 12 | class Filter2dWindowLoader5x5 { | ||
| 13 | public: | ||
| 14 | using BorderInfoType = | ||
| 15 | typename KLEIDICV_TARGET_NAMESPACE::FixedBorderInfo5x5<SourceType>; | ||
| 16 | using BorderOffsets = typename BorderInfoType::Offsets; | ||
| 17 | |||
| 18 | template <typename LoadArrayElementFunctionType, typename KernelWindowFunctor> | ||
| 19 | 153348 | 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 | 153348 | KernelWindow(0, 0) = load_array_element( | |
| 26 | 153348 | src_rows.at(window_row_offsets.c0(), window_col_offsets.c0())[index]); | |
| 27 | 153348 | KernelWindow(0, 1) = load_array_element( | |
| 28 | 153348 | src_rows.at(window_row_offsets.c0(), window_col_offsets.c1())[index]); | |
| 29 | 153348 | KernelWindow(0, 2) = load_array_element( | |
| 30 | 153348 | src_rows.at(window_row_offsets.c0(), window_col_offsets.c2())[index]); | |
| 31 | 153348 | KernelWindow(0, 3) = load_array_element( | |
| 32 | 153348 | src_rows.at(window_row_offsets.c0(), window_col_offsets.c3())[index]); | |
| 33 | 153348 | KernelWindow(0, 4) = load_array_element( | |
| 34 | 153348 | src_rows.at(window_row_offsets.c0(), window_col_offsets.c4())[index]); | |
| 35 | 153348 | KernelWindow(1, 0) = load_array_element( | |
| 36 | 153348 | src_rows.at(window_row_offsets.c1(), window_col_offsets.c0())[index]); | |
| 37 | 153348 | KernelWindow(1, 1) = load_array_element( | |
| 38 | 153348 | src_rows.at(window_row_offsets.c1(), window_col_offsets.c1())[index]); | |
| 39 | 153348 | KernelWindow(1, 2) = load_array_element( | |
| 40 | 153348 | src_rows.at(window_row_offsets.c1(), window_col_offsets.c2())[index]); | |
| 41 | 153348 | KernelWindow(1, 3) = load_array_element( | |
| 42 | 153348 | src_rows.at(window_row_offsets.c1(), window_col_offsets.c3())[index]); | |
| 43 | 153348 | KernelWindow(1, 4) = load_array_element( | |
| 44 | 153348 | src_rows.at(window_row_offsets.c1(), window_col_offsets.c4())[index]); | |
| 45 | 153348 | KernelWindow(2, 0) = load_array_element( | |
| 46 | 153348 | src_rows.at(window_row_offsets.c2(), window_col_offsets.c0())[index]); | |
| 47 | 153348 | KernelWindow(2, 1) = load_array_element( | |
| 48 | 153348 | src_rows.at(window_row_offsets.c2(), window_col_offsets.c1())[index]); | |
| 49 | 153348 | KernelWindow(2, 2) = load_array_element( | |
| 50 | 153348 | src_rows.at(window_row_offsets.c2(), window_col_offsets.c2())[index]); | |
| 51 | 153348 | KernelWindow(2, 3) = load_array_element( | |
| 52 | 153348 | src_rows.at(window_row_offsets.c2(), window_col_offsets.c3())[index]); | |
| 53 | 153348 | KernelWindow(2, 4) = load_array_element( | |
| 54 | 153348 | src_rows.at(window_row_offsets.c2(), window_col_offsets.c4())[index]); | |
| 55 | 153348 | KernelWindow(3, 0) = load_array_element( | |
| 56 | 153348 | src_rows.at(window_row_offsets.c3(), window_col_offsets.c0())[index]); | |
| 57 | 153348 | KernelWindow(3, 1) = load_array_element( | |
| 58 | 153348 | src_rows.at(window_row_offsets.c3(), window_col_offsets.c1())[index]); | |
| 59 | 153348 | KernelWindow(3, 2) = load_array_element( | |
| 60 | 153348 | src_rows.at(window_row_offsets.c3(), window_col_offsets.c2())[index]); | |
| 61 | 153348 | KernelWindow(3, 3) = load_array_element( | |
| 62 | 153348 | src_rows.at(window_row_offsets.c3(), window_col_offsets.c3())[index]); | |
| 63 | 153348 | KernelWindow(3, 4) = load_array_element( | |
| 64 | 153348 | src_rows.at(window_row_offsets.c3(), window_col_offsets.c4())[index]); | |
| 65 | 153348 | KernelWindow(4, 0) = load_array_element( | |
| 66 | 153348 | src_rows.at(window_row_offsets.c4(), window_col_offsets.c0())[index]); | |
| 67 | 153348 | KernelWindow(4, 1) = load_array_element( | |
| 68 | 153348 | src_rows.at(window_row_offsets.c4(), window_col_offsets.c1())[index]); | |
| 69 | 153348 | KernelWindow(4, 2) = load_array_element( | |
| 70 | 153348 | src_rows.at(window_row_offsets.c4(), window_col_offsets.c2())[index]); | |
| 71 | 153348 | KernelWindow(4, 3) = load_array_element( | |
| 72 | 153348 | src_rows.at(window_row_offsets.c4(), window_col_offsets.c3())[index]); | |
| 73 | 153348 | KernelWindow(4, 4) = load_array_element( | |
| 74 | 153348 | src_rows.at(window_row_offsets.c4(), window_col_offsets.c4())[index]); | |
| 75 | 153348 | } | |
| 76 | }; | ||
| 77 | } // namespace KLEIDICV_TARGET_NAMESPACE | ||
| 78 | |||
| 79 | #endif // KLEIDICV_FILTER_2D_WINDOW_LOADER_5X5_H | ||
| 80 |