| 158 | } |
| 159 | |
| 160 | void load_from(const TInput *input, |
| 161 | const unsigned int ld_row, |
| 162 | const unsigned int ld_col, |
| 163 | const unsigned int n_rows, |
| 164 | const unsigned int n_cols, |
| 165 | const int input_i, |
| 166 | const int input_j, |
| 167 | const unsigned int channel_multiplier) const |
| 168 | { |
| 169 | const auto pad_top = input_i < 0 ? -input_i : 0; |
| 170 | const auto pad_left = input_j < 0 ? -input_j : 0; |
| 171 | |
| 172 | const auto padded_rows = std::min(n_rows - input_i, tile_rows) - pad_top; |
| 173 | const auto padded_cols = std::min(n_cols - input_j, tile_cols) - pad_left; |
| 174 | |
| 175 | if (padded_rows < tile_rows || padded_cols < tile_cols) |
| 176 | { |
| 177 | memset(array, 0, tile_rows * tile_cols * tile_channels * sizeof(TInput)); |
| 178 | } |
| 179 | |
| 180 | do_premultiply<TInput>((TInput *)input + std::max(input_i, 0) * ld_row + std::max(input_j, 0) * ld_col, ld_row, |
| 181 | ld_col, array + pad_top * tile_cols * tile_channels + pad_left * tile_channels, |
| 182 | tile_cols * tile_channels, tile_channels, padded_rows, padded_cols, |
| 183 | tile_channels / channel_multiplier, channel_multiplier); |
| 184 | } |
| 185 | }; |
| 186 | |
| 187 | template <typename TInput, typename TWeight, typename TOutput> |
no outgoing calls
no test coverage detected