Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | a4f378d | 2019-04-26 14:54:54 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 ARM Limited. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 24 | #include "arm_compute/core/NEON/kernels/NEDirectConvolutionLayerOutputStageKernel.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 25 | |
| 26 | #include "arm_compute/core/AccessWindowStatic.h" |
Anthony Barbier | eaefd00 | 2018-07-20 17:49:35 +0100 | [diff] [blame] | 27 | #include "arm_compute/core/CPP/Validate.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 28 | #include "arm_compute/core/Error.h" |
| 29 | #include "arm_compute/core/Helpers.h" |
| 30 | #include "arm_compute/core/ITensor.h" |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 31 | #include "arm_compute/core/NEON/NEAsymm.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 32 | #include "arm_compute/core/NEON/NEFixedPoint.h" |
| 33 | #include "arm_compute/core/Types.h" |
| 34 | #include "arm_compute/core/Validate.h" |
| 35 | #include "arm_compute/core/Window.h" |
| 36 | |
| 37 | #include <arm_neon.h> |
| 38 | #include <cstddef> |
| 39 | #include <cstdint> |
| 40 | |
| 41 | using namespace arm_compute; |
| 42 | |
| 43 | namespace |
| 44 | { |
Michele Di Giorgio | ff27192 | 2019-07-17 15:59:32 +0100 | [diff] [blame] | 45 | Status validate_arguments(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, |
| 46 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 47 | { |
Michele Di Giorgio | ff27192 | 2019-07-17 15:59:32 +0100 | [diff] [blame] | 48 | ARM_COMPUTE_UNUSED(result_fixedpoint_multiplier); |
| 49 | ARM_COMPUTE_UNUSED(result_offset_after_shift); |
Anthony Barbier | eaefd00 | 2018-07-20 17:49:35 +0100 | [diff] [blame] | 50 | ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(input); |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 51 | ARM_COMPUTE_RETURN_ERROR_ON(input->data_layout() == DataLayout::UNKNOWN); |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 52 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QASYMM8, |
| 53 | DataType::F16, |
Vidhya Sudhan Loganathan | f4cb81b | 2018-07-04 15:13:14 +0100 | [diff] [blame] | 54 | DataType::S32, DataType::F32); |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 55 | |
Michele Di Giorgio | ff27192 | 2019-07-17 15:59:32 +0100 | [diff] [blame] | 56 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(result_shift < 0, "Result shift must be a non negative integer"); |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 57 | if(bias != nullptr) |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 58 | { |
Vidhya Sudhan Loganathan | f4cb81b | 2018-07-04 15:13:14 +0100 | [diff] [blame] | 59 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(bias, 1, DataType::F16, DataType::S32, DataType::F32); |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 60 | |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 61 | if(is_data_type_quantized_asymmetric(input->data_type())) |
Georgios Pinitas | 19d0547 | 2018-02-01 16:44:12 +0000 | [diff] [blame] | 62 | { |
| 63 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(bias, 1, DataType::S32); |
| 64 | } |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 65 | else |
| 66 | { |
| 67 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, bias); |
| 68 | } |
| 69 | |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 70 | ARM_COMPUTE_RETURN_ERROR_ON(bias->dimension(0) != input->dimension(get_data_layout_dimension_index(input->data_layout(), DataLayoutDimension::CHANNEL))); |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 71 | ARM_COMPUTE_RETURN_ERROR_ON(bias->num_dimensions() > 1); |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 72 | } |
| 73 | else |
| 74 | { |
Georgios Pinitas | 19d0547 | 2018-02-01 16:44:12 +0000 | [diff] [blame] | 75 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(is_data_type_float(input->data_type()), "Calling output stage kernel with floating point arguments"); |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 76 | } |
| 77 | |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 78 | // Checks performed when output is configured |
| 79 | if((output != nullptr) && (output->total_size() != 0)) |
| 80 | { |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 81 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, 1, DataType::QASYMM8, DataType::F32); |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 82 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(input, output); |
| 83 | |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 84 | if(is_data_type_quantized_asymmetric(output->data_type())) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 85 | { |
| 86 | ARM_COMPUTE_RETURN_ERROR_ON_MSG(input->data_type() == DataType::S32 && output->data_type() != DataType::QASYMM8, "Wrong data type for bias"); |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 87 | } |
| 88 | else |
| 89 | { |
| 90 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output); |
| 91 | } |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 92 | } |
| 93 | |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 94 | return Status{}; |
| 95 | } |
| 96 | |
| 97 | std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITensorInfo *bias, ITensorInfo *output) |
| 98 | { |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 99 | ARM_COMPUTE_ERROR_ON(input->data_layout() == DataLayout::UNKNOWN); |
| 100 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 101 | bool window_changed = false; |
| 102 | unsigned int num_elems_processed_per_iteration = 16 / element_size_from_data_type(input->data_type()); |
| 103 | |
| 104 | // Update processed elements when input is S32 (comes from quantization input) |
| 105 | if(input->data_type() == DataType::S32) |
| 106 | { |
| 107 | num_elems_processed_per_iteration = 16; |
| 108 | } |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 109 | |
| 110 | // Configure kernel window |
| 111 | Window win = calculate_max_window(*input, Steps(num_elems_processed_per_iteration)); |
| 112 | AccessWindowHorizontal input_access(input, 0, num_elems_processed_per_iteration); |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 113 | |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 114 | if(output != nullptr && (output->total_size() != 0)) |
| 115 | { |
| 116 | AccessWindowHorizontal output_access(output, 0, num_elems_processed_per_iteration); |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 117 | |
| 118 | if(bias == nullptr) |
| 119 | { |
| 120 | window_changed = update_window_and_padding(win, input_access, output_access); |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | AccessWindowStatic bias_access(bias, 0, 0, bias->dimension(0), bias->dimension(1)); |
| 125 | window_changed = update_window_and_padding(win, input_access, output_access, bias_access); |
| 126 | } |
| 127 | |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 128 | output_access.set_valid_region(win, ValidRegion(Coordinates(), output->tensor_shape())); |
| 129 | } |
| 130 | else |
| 131 | { |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 132 | if(bias == nullptr) |
| 133 | { |
| 134 | window_changed = update_window_and_padding(win, input_access); |
| 135 | } |
| 136 | else |
| 137 | { |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 138 | if(input->data_layout() == DataLayout::NCHW) |
| 139 | { |
| 140 | AccessWindowStatic bias_access(bias, 0, 0, bias->dimension(0), bias->dimension(1)); |
| 141 | window_changed = update_window_and_padding(win, input_access, bias_access); |
| 142 | } |
| 143 | else |
| 144 | { |
| 145 | AccessWindowHorizontal bias_access(bias, 0, num_elems_processed_per_iteration); |
| 146 | window_changed = update_window_and_padding(win, input_access, bias_access); |
| 147 | } |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 148 | } |
| 149 | |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 150 | input_access.set_valid_region(win, ValidRegion(Coordinates(), input->tensor_shape())); |
| 151 | } |
| 152 | |
| 153 | Status err = (window_changed) ? ARM_COMPUTE_CREATE_ERROR(ErrorCode::RUNTIME_ERROR, "Insufficient Padding!") : Status{}; |
| 154 | return std::make_pair(err, win); |
| 155 | } |
| 156 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 157 | // Internal load |
| 158 | inline float32x4_t internal_vld1q(const float *in) |
| 159 | { |
| 160 | return vld1q_f32(in); |
| 161 | } |
Pablo Tello | f87cc7f | 2017-07-26 10:28:40 +0100 | [diff] [blame] | 162 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 163 | // Internal store |
| 164 | inline void internal_vst1q(float *p, const float32x4_t &v) |
| 165 | { |
| 166 | vst1q_f32(p, v); |
| 167 | } |
Pablo Tello | f87cc7f | 2017-07-26 10:28:40 +0100 | [diff] [blame] | 168 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 169 | // Internal vdup |
| 170 | inline float32x4_t internal_vdupq_n(float v) |
| 171 | { |
| 172 | return vdupq_n_f32(v); |
| 173 | } |
Pablo Tello | f87cc7f | 2017-07-26 10:28:40 +0100 | [diff] [blame] | 174 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 175 | // Internal vadd |
| 176 | inline float32x4_t internal_vqaddq(const float32x4_t &x, const float32x4_t &y) |
| 177 | { |
| 178 | return vaddq_f32(x, y); |
| 179 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 180 | |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 181 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Pablo Tello | 0d17614 | 2017-07-06 16:43:14 +0100 | [diff] [blame] | 182 | inline float16x8_t internal_vld1q(const float16_t *in) |
| 183 | { |
| 184 | return vld1q_f16(in); |
| 185 | } |
| 186 | inline void internal_vst1q(float16_t *p, const float16x8_t &v) |
| 187 | { |
| 188 | vst1q_f16(p, v); |
| 189 | } |
| 190 | inline float16x8_t internal_vdupq_n(float16_t v) |
| 191 | { |
| 192 | return vdupq_n_f16(v); |
| 193 | } |
| 194 | inline float16x8_t internal_vqaddq(const float16x8_t &x, const float16x8_t &y) |
| 195 | { |
| 196 | return vaddq_f16(x, y); |
| 197 | } |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 198 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
Pablo Tello | 0d17614 | 2017-07-06 16:43:14 +0100 | [diff] [blame] | 199 | |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 200 | template <typename T1, typename T2, bool in_place, bool has_bias> |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 201 | void output_stage_nchw(ITensor *input, const ITensor *bias, const Window &window, ITensor *output, |
| 202 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 203 | { |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 204 | ARM_COMPUTE_ERROR_ON(input->info()->data_layout() == DataLayout::UNKNOWN); |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 205 | ARM_COMPUTE_UNUSED(result_fixedpoint_multiplier); |
| 206 | ARM_COMPUTE_UNUSED(result_shift); |
| 207 | ARM_COMPUTE_UNUSED(result_offset_after_shift); |
| 208 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 209 | Iterator in(input, window); |
| 210 | |
| 211 | if(in_place) // In place accumulate |
| 212 | { |
| 213 | execute_window_loop(window, [&](const Coordinates & id) |
| 214 | { |
| 215 | // Get bias and pointer to input |
| 216 | const auto in_ptr = reinterpret_cast<T1 *>(in.ptr()); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 217 | |
| 218 | // Accumulate bias |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 219 | if(has_bias) |
| 220 | { |
| 221 | const auto vb = internal_vdupq_n(static_cast<T1>(*reinterpret_cast<const T2 *>(bias->ptr_to_element(Coordinates(id.z()))))); |
| 222 | internal_vst1q(in_ptr, internal_vqaddq(internal_vld1q(in_ptr), vb)); |
| 223 | } |
| 224 | else |
| 225 | { |
| 226 | internal_vst1q(in_ptr, internal_vld1q(in_ptr)); |
| 227 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 228 | }, |
| 229 | in); |
| 230 | } |
| 231 | else // Out of place accumulate |
| 232 | { |
| 233 | Iterator out(output, window); |
| 234 | execute_window_loop(window, [&](const Coordinates & id) |
| 235 | { |
| 236 | // Get bias and pointer to input |
| 237 | const auto in_ptr = reinterpret_cast<const T1 *>(in.ptr()); |
| 238 | const auto out_ptr = reinterpret_cast<T2 *>(out.ptr()); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 239 | |
| 240 | // Accumulate bias |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 241 | if(has_bias) |
| 242 | { |
| 243 | const auto vb = internal_vdupq_n(static_cast<T1>(*reinterpret_cast<const T2 *>(bias->ptr_to_element(Coordinates(id.z()))))); |
| 244 | internal_vst1q(out_ptr, internal_vqaddq(internal_vld1q(in_ptr), vb)); |
| 245 | } |
| 246 | else |
| 247 | { |
| 248 | internal_vst1q(out_ptr, internal_vld1q(in_ptr)); |
| 249 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 250 | }, |
| 251 | in, out); |
| 252 | } |
| 253 | } |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 254 | |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 255 | template <typename T1, typename T2, bool in_place, bool has_bias> |
| 256 | void output_stage_nhwc(ITensor *input, const ITensor *bias, const Window &window, ITensor *output, |
| 257 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
| 258 | { |
| 259 | ARM_COMPUTE_UNUSED(result_fixedpoint_multiplier); |
| 260 | ARM_COMPUTE_UNUSED(result_shift); |
| 261 | ARM_COMPUTE_UNUSED(result_offset_after_shift); |
| 262 | |
| 263 | Window window_bias = window; |
| 264 | window_bias.set(Window::DimY, Window::Dimension(0, 0, 0)); |
| 265 | window_bias.set(Window::DimZ, Window::Dimension(0, 0, 0)); |
| 266 | window_bias.set(3, Window::Dimension(0, 0, 0)); |
| 267 | |
| 268 | Iterator in(input, window); |
| 269 | Iterator bi(bias, window_bias); |
| 270 | |
| 271 | if(in_place) // In place accumulate |
| 272 | { |
Michalis Spyrou | a4f378d | 2019-04-26 14:54:54 +0100 | [diff] [blame] | 273 | execute_window_loop(window, [&](const Coordinates &) |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 274 | { |
| 275 | // Get bias and pointer to input |
| 276 | const auto in_ptr = reinterpret_cast<T1 *>(in.ptr()); |
| 277 | const auto bias_ptr = reinterpret_cast<T2 *>(bi.ptr()); |
| 278 | |
| 279 | // Accumulate bias |
| 280 | if(has_bias) |
| 281 | { |
| 282 | internal_vst1q(in_ptr, internal_vqaddq(internal_vld1q(in_ptr), internal_vld1q(bias_ptr))); |
| 283 | } |
| 284 | else |
| 285 | { |
| 286 | internal_vst1q(in_ptr, internal_vld1q(in_ptr)); |
| 287 | } |
| 288 | }, |
| 289 | in, bi); |
| 290 | } |
| 291 | else // Out of place accumulate |
| 292 | { |
| 293 | Iterator out(output, window); |
Michalis Spyrou | a4f378d | 2019-04-26 14:54:54 +0100 | [diff] [blame] | 294 | execute_window_loop(window, [&](const Coordinates &) |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 295 | { |
| 296 | // Get bias and pointer to input |
| 297 | const auto in_ptr = reinterpret_cast<T1 *>(in.ptr()); |
| 298 | const auto out_ptr = reinterpret_cast<T2 *>(out.ptr()); |
| 299 | const auto bias_ptr = reinterpret_cast<T2 *>(bi.ptr()); |
| 300 | |
| 301 | // Accumulate bias |
| 302 | if(has_bias) |
| 303 | { |
| 304 | internal_vst1q(out_ptr, internal_vqaddq(internal_vld1q(in_ptr), internal_vld1q(bias_ptr))); |
| 305 | } |
| 306 | else |
| 307 | { |
| 308 | internal_vst1q(out_ptr, internal_vld1q(in_ptr)); |
| 309 | } |
| 310 | }, |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 311 | in, bi, out); |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 312 | } |
| 313 | } |
| 314 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 315 | // QASYMM8 specializations |
| 316 | template <> |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 317 | void output_stage_nchw<int32_t, uint8_t, false, true>(ITensor *input, const ITensor *bias, const Window &window, ITensor *output, |
| 318 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 319 | { |
| 320 | const int32x4_t result_offset_after_shift_s32 = vdupq_n_s32(result_offset_after_shift); |
| 321 | uint8x16_t min = vdupq_n_u8(0); |
| 322 | uint8x16_t max = vdupq_n_u8(255); |
| 323 | |
| 324 | Iterator in(input, window); |
| 325 | Iterator out(output, window); |
| 326 | |
| 327 | execute_window_loop(window, [&](const Coordinates & id) |
| 328 | { |
| 329 | // Get bias and pointer to input |
| 330 | const auto in_ptr = reinterpret_cast<int32_t *>(in.ptr()); |
| 331 | int32x4x4_t v_in = |
| 332 | { |
| 333 | { |
| 334 | vld1q_s32(in_ptr), |
| 335 | vld1q_s32(in_ptr + 4), |
| 336 | vld1q_s32(in_ptr + 8), |
| 337 | vld1q_s32(in_ptr + 12) |
| 338 | } |
| 339 | }; |
| 340 | |
| 341 | // Accumulate bias |
| 342 | const auto vb = vdupq_n_s32(*reinterpret_cast<const int32_t *>(bias->ptr_to_element(Coordinates(id.z())))); |
| 343 | v_in = |
| 344 | { |
| 345 | { |
| 346 | vaddq_s32(v_in.val[0], vb), |
| 347 | vaddq_s32(v_in.val[1], vb), |
| 348 | vaddq_s32(v_in.val[2], vb), |
| 349 | vaddq_s32(v_in.val[3], vb) |
| 350 | } |
| 351 | }; |
| 352 | |
| 353 | const auto out_ptr = reinterpret_cast<uint8_t *>(out.ptr()); |
| 354 | vst1q_u8(out_ptr, finalize_quantization<false>(v_in, result_fixedpoint_multiplier, result_shift, result_offset_after_shift_s32, min, max)); |
| 355 | }, |
| 356 | in, out); |
| 357 | } |
| 358 | template <> |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 359 | void output_stage_nchw<int32_t, uint8_t, false, false>(ITensor *input, const ITensor *bias, const Window &window, ITensor *output, |
| 360 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 361 | { |
| 362 | ARM_COMPUTE_UNUSED(bias); |
| 363 | |
| 364 | const int32x4_t result_offset_after_shift_s32 = vdupq_n_s32(result_offset_after_shift); |
| 365 | uint8x16_t min = vdupq_n_u8(0); |
| 366 | uint8x16_t max = vdupq_n_u8(255); |
| 367 | |
| 368 | Iterator in(input, window); |
| 369 | Iterator out(output, window); |
Michalis Spyrou | a4f378d | 2019-04-26 14:54:54 +0100 | [diff] [blame] | 370 | execute_window_loop(window, [&](const Coordinates &) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 371 | { |
| 372 | // Get bias and pointer to input |
| 373 | const auto in_ptr = reinterpret_cast<int32_t *>(in.ptr()); |
| 374 | int32x4x4_t v_in = |
| 375 | { |
| 376 | { |
| 377 | vld1q_s32(in_ptr), |
| 378 | vld1q_s32(in_ptr + 4), |
| 379 | vld1q_s32(in_ptr + 8), |
| 380 | vld1q_s32(in_ptr + 12) |
| 381 | } |
| 382 | }; |
| 383 | |
| 384 | const auto out_ptr = reinterpret_cast<uint8_t *>(out.ptr()); |
| 385 | vst1q_u8(out_ptr, finalize_quantization<false>(v_in, result_fixedpoint_multiplier, result_shift, result_offset_after_shift_s32, min, max)); |
| 386 | }, |
| 387 | in, out); |
| 388 | } |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 389 | template <> |
| 390 | void output_stage_nhwc<int32_t, uint8_t, false, true>(ITensor *input, const ITensor *bias, const Window &window, ITensor *output, |
| 391 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
| 392 | { |
| 393 | const int32x4_t result_offset_after_shift_s32 = vdupq_n_s32(result_offset_after_shift); |
| 394 | uint8x16_t min = vdupq_n_u8(0); |
| 395 | uint8x16_t max = vdupq_n_u8(255); |
| 396 | |
| 397 | Window window_bias = window; |
| 398 | window_bias.set(Window::DimY, Window::Dimension(0, 0, 0)); |
| 399 | window_bias.set(Window::DimZ, Window::Dimension(0, 0, 0)); |
| 400 | window_bias.set(3, Window::Dimension(0, 0, 0)); |
| 401 | |
| 402 | Iterator in(input, window); |
| 403 | Iterator bi(bias, window_bias); |
| 404 | |
| 405 | Iterator out(output, window); |
Michalis Spyrou | a4f378d | 2019-04-26 14:54:54 +0100 | [diff] [blame] | 406 | execute_window_loop(window, [&](const Coordinates &) |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 407 | { |
| 408 | // Get bias and pointer to input |
| 409 | const auto in_ptr = reinterpret_cast<int32_t *>(in.ptr()); |
| 410 | const auto bias_ptr = reinterpret_cast<int32_t *>(bi.ptr()); |
| 411 | |
| 412 | // Accumulate bias |
| 413 | int32x4x4_t v_in = |
| 414 | { |
| 415 | { |
| 416 | vaddq_s32(vld1q_s32(in_ptr), vld1q_s32(bias_ptr)), |
| 417 | vaddq_s32(vld1q_s32(in_ptr + 4), vld1q_s32(bias_ptr + 4)), |
| 418 | vaddq_s32(vld1q_s32(in_ptr + 8), vld1q_s32(bias_ptr + 8)), |
| 419 | vaddq_s32(vld1q_s32(in_ptr + 12), vld1q_s32(bias_ptr + 12)) |
| 420 | } |
| 421 | }; |
| 422 | |
| 423 | const auto out_ptr = out.ptr(); |
| 424 | vst1q_u8(out_ptr, finalize_quantization<false>(v_in, result_fixedpoint_multiplier, result_shift, result_offset_after_shift_s32, min, max)); |
| 425 | }, |
| 426 | in, bi, out); |
| 427 | } |
| 428 | template <> |
| 429 | void output_stage_nhwc<int32_t, uint8_t, false, false>(ITensor *input, const ITensor *bias, const Window &window, ITensor *output, |
| 430 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
| 431 | { |
| 432 | ARM_COMPUTE_UNUSED(bias); |
| 433 | |
| 434 | const int32x4_t result_offset_after_shift_s32 = vdupq_n_s32(result_offset_after_shift); |
| 435 | uint8x16_t min = vdupq_n_u8(0); |
| 436 | uint8x16_t max = vdupq_n_u8(255); |
| 437 | |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 438 | Iterator in(input, window); |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 439 | Iterator out(output, window); |
Michalis Spyrou | a4f378d | 2019-04-26 14:54:54 +0100 | [diff] [blame] | 440 | execute_window_loop(window, [&](const Coordinates &) |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 441 | { |
Georgios Pinitas | 551852f | 2018-11-29 13:58:31 +0000 | [diff] [blame] | 442 | // Get pointer to input |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 443 | const auto in_ptr = reinterpret_cast<int32_t *>(in.ptr()); |
| 444 | |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 445 | int32x4x4_t v_in = |
| 446 | { |
| 447 | { |
| 448 | vld1q_s32(in_ptr), |
| 449 | vld1q_s32(in_ptr + 4), |
| 450 | vld1q_s32(in_ptr + 8), |
| 451 | vld1q_s32(in_ptr + 12) |
| 452 | } |
| 453 | }; |
| 454 | |
| 455 | const auto out_ptr = out.ptr(); |
| 456 | vst1q_u8(out_ptr, finalize_quantization<false>(v_in, result_fixedpoint_multiplier, result_shift, result_offset_after_shift_s32, min, max)); |
| 457 | }, |
Georgios Pinitas | 551852f | 2018-11-29 13:58:31 +0000 | [diff] [blame] | 458 | in, out); |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 459 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 460 | } // namespace |
| 461 | |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 462 | NEDirectConvolutionLayerOutputStageKernel::NEDirectConvolutionLayerOutputStageKernel() |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 463 | : _func(nullptr), _input(nullptr), _bias(nullptr), _output(nullptr), _result_fixedpoint_multiplier(0), _result_shift(0), _result_offset_after_shift(0) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 464 | { |
| 465 | } |
| 466 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 467 | void NEDirectConvolutionLayerOutputStageKernel::configure(ITensor *input, const ITensor *bias, ITensor *output, |
| 468 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 469 | { |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 470 | ARM_COMPUTE_ERROR_ON_NULLPTR(input); |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 471 | |
Georgios Pinitas | 0223a78 | 2017-12-12 11:44:44 +0000 | [diff] [blame] | 472 | // Auto-initialize output output if required |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 473 | if(output != nullptr) |
| 474 | { |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 475 | // Work out expected output data type |
| 476 | const DataType output_dt = (input->info()->data_type() == DataType::S32) ? DataType::QASYMM8 : input->info()->data_type(); |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 477 | // Output tensor auto initialization if not yet initialized |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 478 | auto_init_if_empty(*output->info(), input->info()->clone()->set_data_type(output_dt)); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 479 | } |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 480 | |
| 481 | // Perform validation step |
Michele Di Giorgio | ff27192 | 2019-07-17 15:59:32 +0100 | [diff] [blame] | 482 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), (bias == nullptr) ? nullptr : bias->info(), (output == nullptr) ? nullptr : output->info(), |
| 483 | result_fixedpoint_multiplier, result_shift, result_offset_after_shift)); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 484 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 485 | _func = nullptr; |
| 486 | _bias = bias; |
| 487 | _input = input; |
| 488 | _output = output; |
| 489 | _result_fixedpoint_multiplier = result_fixedpoint_multiplier; |
| 490 | _result_shift = result_shift; |
| 491 | _result_offset_after_shift = result_offset_after_shift; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 492 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 493 | // Configure kernel window |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 494 | auto win_config = validate_and_configure_window(input->info(), (bias == nullptr) ? nullptr : bias->info(), (output == nullptr) ? nullptr : output->info()); |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 495 | ARM_COMPUTE_ERROR_THROW_ON(win_config.first); |
| 496 | INEKernel::configure(win_config.second); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 497 | |
Gian Marco Iodice | 618493d | 2018-11-27 16:38:33 +0000 | [diff] [blame] | 498 | const bool has_bias = bias != nullptr; |
| 499 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 500 | // Set appropriate function |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 501 | if(input->info()->data_layout() == DataLayout::NCHW) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 502 | { |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 503 | switch(input->info()->data_type()) |
Pablo Tello | f87cc7f | 2017-07-26 10:28:40 +0100 | [diff] [blame] | 504 | { |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 505 | case DataType::S32: |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 506 | { |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 507 | _func = (bias == nullptr) ? &output_stage_nchw<int32_t, uint8_t, false, false> : &output_stage_nchw<int32_t, uint8_t, false, true>; |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 508 | break; |
Pablo Tello | f87cc7f | 2017-07-26 10:28:40 +0100 | [diff] [blame] | 509 | } |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 510 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 511 | case DataType::F16: |
| 512 | { |
Gian Marco Iodice | 618493d | 2018-11-27 16:38:33 +0000 | [diff] [blame] | 513 | if(has_bias) |
| 514 | { |
| 515 | _func = (output == nullptr) ? &output_stage_nchw<float16_t, float16_t, true, true> : &output_stage_nchw<float16_t, float16_t, false, true>; |
| 516 | } |
| 517 | else |
| 518 | { |
| 519 | _func = (output == nullptr) ? &output_stage_nchw<float16_t, float16_t, true, false> : &output_stage_nchw<float16_t, float16_t, false, false>; |
| 520 | } |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 521 | break; |
| 522 | } |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 523 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 524 | case DataType::F32: |
| 525 | { |
Gian Marco Iodice | 618493d | 2018-11-27 16:38:33 +0000 | [diff] [blame] | 526 | if(has_bias) |
| 527 | { |
| 528 | _func = (output == nullptr) ? &output_stage_nchw<float, float, true, true> : &output_stage_nchw<float, float, false, true>; |
| 529 | } |
| 530 | else |
| 531 | { |
| 532 | _func = (output == nullptr) ? &output_stage_nchw<float, float, true, false> : &output_stage_nchw<float, float, false, false>; |
| 533 | } |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 534 | break; |
| 535 | } |
| 536 | default: |
| 537 | { |
| 538 | ARM_COMPUTE_ERROR("Unsupported combination of types among the inputs."); |
| 539 | } |
Pablo Tello | f87cc7f | 2017-07-26 10:28:40 +0100 | [diff] [blame] | 540 | } |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 541 | } |
| 542 | else |
| 543 | { |
| 544 | switch(input->info()->data_type()) |
Pablo Tello | f87cc7f | 2017-07-26 10:28:40 +0100 | [diff] [blame] | 545 | { |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 546 | case DataType::S32: |
| 547 | { |
Gian Marco Iodice | 618493d | 2018-11-27 16:38:33 +0000 | [diff] [blame] | 548 | _func = (bias == nullptr) ? &output_stage_nhwc<int32_t, uint8_t, false, false> : &output_stage_nhwc<int32_t, uint8_t, false, true>; |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 549 | break; |
| 550 | } |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 551 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 552 | case DataType::F16: |
| 553 | { |
Gian Marco Iodice | 618493d | 2018-11-27 16:38:33 +0000 | [diff] [blame] | 554 | if(has_bias) |
| 555 | { |
| 556 | _func = (output == nullptr) ? &output_stage_nhwc<float16_t, float16_t, true, true> : &output_stage_nhwc<float16_t, float16_t, false, true>; |
| 557 | } |
| 558 | else |
| 559 | { |
| 560 | _func = (output == nullptr) ? &output_stage_nhwc<float16_t, float16_t, true, false> : &output_stage_nhwc<float16_t, float16_t, false, false>; |
| 561 | } |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 562 | break; |
| 563 | } |
| 564 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 565 | case DataType::F32: |
| 566 | { |
Gian Marco Iodice | 618493d | 2018-11-27 16:38:33 +0000 | [diff] [blame] | 567 | if(has_bias) |
| 568 | { |
| 569 | _func = (output == nullptr) ? &output_stage_nhwc<float, float, true, true> : &output_stage_nhwc<float, float, false, true>; |
| 570 | } |
| 571 | else |
| 572 | { |
| 573 | _func = (output == nullptr) ? &output_stage_nhwc<float, float, true, false> : &output_stage_nhwc<float, float, false, false>; |
| 574 | } |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 575 | break; |
| 576 | } |
| 577 | default: |
| 578 | { |
| 579 | ARM_COMPUTE_ERROR("Unsupported combination of types among the inputs."); |
| 580 | } |
Pablo Tello | f87cc7f | 2017-07-26 10:28:40 +0100 | [diff] [blame] | 581 | } |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 582 | } |
| 583 | } |
| 584 | |
Michele Di Giorgio | ff27192 | 2019-07-17 15:59:32 +0100 | [diff] [blame] | 585 | Status NEDirectConvolutionLayerOutputStageKernel::validate(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, |
| 586 | int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift) |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 587 | { |
Michele Di Giorgio | ff27192 | 2019-07-17 15:59:32 +0100 | [diff] [blame] | 588 | ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, bias, output, result_fixedpoint_multiplier, result_shift, result_offset_after_shift)); |
Anthony Barbier | de01468 | 2018-07-03 15:10:48 +0100 | [diff] [blame] | 589 | ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(input->clone().get(), bias == nullptr ? nullptr : bias->clone().get(), output == nullptr ? nullptr : output->clone().get()).first); |
Michalis Spyrou | afa5d81 | 2017-11-30 14:25:57 +0000 | [diff] [blame] | 590 | |
| 591 | return Status{}; |
| 592 | } |
| 593 | |
Michalis Spyrou | b91e34c | 2017-12-20 15:50:55 +0000 | [diff] [blame] | 594 | void NEDirectConvolutionLayerOutputStageKernel::run(const Window &window, const ThreadInfo &info) |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 595 | { |
Moritz Pflanzer | c186b57 | 2017-09-07 09:48:04 +0100 | [diff] [blame] | 596 | ARM_COMPUTE_UNUSED(info); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 597 | ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); |
| 598 | ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(INEKernel::window(), window); |
| 599 | ARM_COMPUTE_ERROR_ON(_func == nullptr); |
| 600 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 601 | (*_func)(_input, _bias, window, _output, _result_fixedpoint_multiplier, _result_shift, _result_offset_after_shift); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 602 | } |