Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 1 | /* |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 ARM Limited. |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +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 | */ |
| 24 | #include "arm_compute/core/NEON/kernels/NEQuantizationLayerKernel.h" |
| 25 | |
| 26 | #include "arm_compute/core/Error.h" |
| 27 | #include "arm_compute/core/Helpers.h" |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 28 | #include "arm_compute/core/NEON/NEAsymm.h" |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 29 | #include "arm_compute/core/NEON/NEMath.h" |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 30 | #include "arm_compute/core/NEON/wrapper/wrapper.h" |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 31 | #include "arm_compute/core/Utils.h" |
| 32 | #include "arm_compute/core/Validate.h" |
| 33 | #include "arm_compute/core/Window.h" |
| 34 | |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 35 | #include "arm_compute/core/CPP/Validate.h" |
| 36 | |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 37 | #include <arm_neon.h> |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 38 | #include <map> |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 39 | |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 40 | namespace arm_compute |
| 41 | { |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 42 | namespace |
| 43 | { |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 44 | constexpr auto window_step = 16; |
| 45 | |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 46 | Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output) |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 47 | { |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 48 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output); |
| 49 | ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(input); |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 50 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::F16, DataType::F32); |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 51 | ARM_COMPUTE_RETURN_ERROR_ON(output->tensor_shape().total_size() == 0); |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 52 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(output, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::QASYMM16); |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 53 | ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(input, output); |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 54 | |
| 55 | return Status{}; |
| 56 | } |
| 57 | |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 58 | template <typename T> |
| 59 | inline float32x4x4_t load_value(const T *input_ptr) |
| 60 | { |
| 61 | using Tx16_t = typename wrapper::traits::neon_vector<T, 16>::type; |
| 62 | return arm_compute::convert_to_float32x4x4<Tx16_t>(wrapper::vloadq(input_ptr)); |
| 63 | } |
| 64 | |
| 65 | template <> |
Michalis Spyrou | a4f378d | 2019-04-26 14:54:54 +0100 | [diff] [blame] | 66 | inline float32x4x4_t load_value(const float *input_ptr) |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 67 | { |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 68 | return { wrapper::vloadq(input_ptr), |
| 69 | wrapper::vloadq(input_ptr + 4), |
| 70 | wrapper::vloadq(input_ptr + 8), |
| 71 | wrapper::vloadq(input_ptr + 12) }; |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 72 | } |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 73 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 74 | template <> |
| 75 | inline float32x4x4_t load_value(const float16_t *input_ptr) |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 76 | { |
| 77 | return { vcvt_f32_f16(wrapper::vload(input_ptr)), |
| 78 | vcvt_f32_f16(wrapper::vload(input_ptr + 4)), |
| 79 | vcvt_f32_f16(wrapper::vload(input_ptr + 8)), |
| 80 | vcvt_f32_f16(wrapper::vload(input_ptr + 12)) }; |
| 81 | } |
| 82 | |
| 83 | #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 84 | |
| 85 | template <typename element_type> |
| 86 | using vector_type = wrapper::traits::neon_vector_t<element_type, window_step>; |
| 87 | |
| 88 | template <typename quantized_type> |
| 89 | vector_type<quantized_type> vquantize_qasymm8(const float32x4x4_t &qv, const UniformQuantizationInfo &qi); |
| 90 | |
| 91 | template <> |
| 92 | vector_type<uint8_t> vquantize_qasymm8<uint8_t>(const float32x4x4_t &qv, const UniformQuantizationInfo &qi) |
| 93 | { |
| 94 | return vquantize(qv, qi); |
| 95 | } |
| 96 | |
| 97 | template <> |
| 98 | vector_type<int8_t> vquantize_qasymm8<int8_t>(const float32x4x4_t &qv, const UniformQuantizationInfo &qi) |
| 99 | { |
| 100 | return vquantize_signed(qv, qi); |
| 101 | } |
| 102 | |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 103 | } // namespace |
| 104 | |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 105 | NEQuantizationLayerKernel::NEQuantizationLayerKernel() |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 106 | : _input(nullptr), _output(nullptr), _func(nullptr) |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 107 | { |
| 108 | } |
| 109 | |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 110 | void NEQuantizationLayerKernel::configure(const ITensor *input, ITensor *output) |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 111 | { |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 112 | ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); |
| 113 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info())); |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 114 | |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 115 | _input = input; |
| 116 | _output = output; |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 117 | |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 118 | static const std::map<std::string, QuantizationFunctionExecutorPtr> quant_map = |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 119 | { |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 120 | { "op_QASYMM8_QASYMM8", &NEQuantizationLayerKernel::run_quantize_qasymm8<uint8_t, uint8_t> }, |
| 121 | { "op_QASYMM8_QASYMM8_SIGNED", &NEQuantizationLayerKernel::run_quantize_qasymm8<uint8_t, int8_t> }, |
| 122 | { "op_QASYMM8_QASYMM16", &NEQuantizationLayerKernel::run_quantize_qasymm16<uint8_t> }, |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 123 | |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 124 | { "op_QASYMM8_SIGNED_QASYMM8", &NEQuantizationLayerKernel::run_quantize_qasymm8<int8_t, uint8_t> }, |
| 125 | { "op_QASYMM8_SIGNED_QASYMM8_SIGNED", &NEQuantizationLayerKernel::run_quantize_qasymm8<int8_t, int8_t> }, |
| 126 | { "op_QASYMM8_SIGNED_QASYMM16", &NEQuantizationLayerKernel::run_quantize_qasymm16<int8_t> }, |
| 127 | |
| 128 | { "op_F32_QASYMM8", &NEQuantizationLayerKernel::run_quantize_qasymm8<float, uint8_t> }, |
| 129 | { "op_F32_QASYMM8_SIGNED", &NEQuantizationLayerKernel::run_quantize_qasymm8<float, int8_t> }, |
| 130 | { "op_F32_QASYMM16", &NEQuantizationLayerKernel::run_quantize_qasymm16<float> }, |
| 131 | |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 132 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 133 | { "op_F16_QASYMM8", &NEQuantizationLayerKernel::run_quantize_qasymm8<float16_t, uint8_t> }, |
| 134 | { "op_F16_QASYMM8_SIGNED", &NEQuantizationLayerKernel::run_quantize_qasymm8<float16_t, int8_t> }, |
| 135 | { "op_F16_QASYMM16", &NEQuantizationLayerKernel::run_quantize_qasymm16<float16_t> }, |
| 136 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC*/ |
| 137 | }; |
| 138 | |
| 139 | std::string function_to_call("op_"); |
| 140 | function_to_call += string_from_data_type(_input->info()->data_type()) + "_"; |
| 141 | function_to_call += string_from_data_type(_output->info()->data_type()); |
| 142 | |
| 143 | auto it = quant_map.find(function_to_call); |
| 144 | |
| 145 | if(it == quant_map.end()) |
| 146 | { |
| 147 | ARM_COMPUTE_ERROR("Unsupported combination of input and output data types"); |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 148 | } |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 149 | _func = it->second; |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 150 | |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 151 | // Configure kernel window |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 152 | Window win_config = calculate_max_window(*input->info(), Steps()); |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 153 | |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 154 | Coordinates coord; |
| 155 | coord.set_num_dimensions(output->info()->num_dimensions()); |
| 156 | output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); |
Gian Marco Iodice | 06b184a | 2017-08-29 16:05:25 +0100 | [diff] [blame] | 157 | |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 158 | INEKernel::configure(win_config); |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 159 | } |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 160 | |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 161 | Status NEQuantizationLayerKernel::validate(const ITensorInfo *input, const ITensorInfo *output) |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 162 | { |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 163 | ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output)); |
Alex Gilday | 60954c6 | 2018-03-05 16:22:48 +0000 | [diff] [blame] | 164 | return Status{}; |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 165 | } |
| 166 | |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 167 | template <typename TIn, typename TOut> |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 168 | void NEQuantizationLayerKernel::run_quantize_qasymm8(const Window &window) |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 169 | { |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 170 | const auto window_start_x = static_cast<int>(window.x().start()); |
| 171 | const auto window_end_x = static_cast<int>(window.x().end()); |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 172 | |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 173 | const UniformQuantizationInfo uqinfo_in = _input->info()->quantization_info().uniform(); |
| 174 | UniformQuantizationInfo uqinfo = _output->info()->quantization_info().uniform(); |
| 175 | if(is_data_type_quantized_asymmetric(_input->info()->data_type())) |
| 176 | { |
| 177 | uqinfo = compute_requantization_scale_offset(uqinfo_in, uqinfo); |
| 178 | } |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 179 | #ifdef __aarch64__ |
| 180 | constexpr RoundingPolicy rounding_policy = RoundingPolicy::TO_NEAREST_EVEN; |
| 181 | #else //__aarch64__ |
| 182 | constexpr RoundingPolicy rounding_policy = RoundingPolicy::TO_ZERO; |
| 183 | #endif //__aarch64__ |
| 184 | |
| 185 | // Collapse window and reset first dimension to handle tail calculations manually |
| 186 | Window win_collapsed = window.collapse_if_possible(window, Window::DimZ); |
| 187 | win_collapsed.set(Window::DimX, Window::Dimension(0, 1, 1)); |
| 188 | |
| 189 | Iterator input(_input, win_collapsed); |
| 190 | Iterator output(_output, win_collapsed); |
Michalis Spyrou | a4f378d | 2019-04-26 14:54:54 +0100 | [diff] [blame] | 191 | execute_window_loop(win_collapsed, [&](const Coordinates &) |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 192 | { |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 193 | auto input_ptr = reinterpret_cast<const TIn *>(input.ptr()); |
| 194 | auto output_ptr = reinterpret_cast<TOut *>(output.ptr()); |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 195 | |
| 196 | int x = window_start_x; |
| 197 | for(; x <= (window_end_x - window_step); x += window_step) |
| 198 | { |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 199 | wrapper::vstore(&output_ptr[x], vquantize_qasymm8<TOut>(load_value(&input_ptr[x]), uqinfo)); |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 200 | } |
| 201 | // Compute left-over elements |
| 202 | for(; x < window_end_x; ++x) |
| 203 | { |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 204 | output_ptr[x] = Qasymm8QuantizationHelper<TOut>::quantize(input_ptr[x], uqinfo, rounding_policy); |
John Kesapides | adfb273 | 2019-03-04 16:29:22 +0000 | [diff] [blame] | 205 | } |
| 206 | }, |
| 207 | input, output); |
| 208 | } |
| 209 | |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 210 | template <typename T> |
| 211 | void NEQuantizationLayerKernel::run_quantize_qasymm16(const Window &window) |
| 212 | { |
Sang-Hoon Park | fb6aaeb | 2019-11-27 15:26:44 +0000 | [diff] [blame] | 213 | const auto window_start_x = static_cast<int>(window.x().start()); |
| 214 | const auto window_end_x = static_cast<int>(window.x().end()); |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 215 | |
Manuel Bottini | 4370cff | 2020-02-07 16:31:59 +0000 | [diff] [blame] | 216 | const UniformQuantizationInfo uqinfo_in = _input->info()->quantization_info().uniform(); |
| 217 | UniformQuantizationInfo uqinfo = _output->info()->quantization_info().uniform(); |
| 218 | if(is_data_type_quantized_asymmetric(_input->info()->data_type())) |
| 219 | { |
| 220 | uqinfo = compute_requantization_scale_offset(uqinfo_in, uqinfo); |
| 221 | } |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 222 | #ifdef __aarch64__ |
| 223 | constexpr RoundingPolicy rounding_policy = RoundingPolicy::TO_NEAREST_EVEN; |
| 224 | #else //__aarch64__ |
| 225 | constexpr RoundingPolicy rounding_policy = RoundingPolicy::TO_ZERO; |
| 226 | #endif //__aarch64__ |
| 227 | |
| 228 | // Collapse window and reset first dimension to handle tail calculations manually |
| 229 | Window win_collapsed = window.collapse_if_possible(window, Window::DimZ); |
| 230 | win_collapsed.set(Window::DimX, Window::Dimension(0, 1, 1)); |
| 231 | |
| 232 | Iterator input(_input, win_collapsed); |
| 233 | Iterator output(_output, win_collapsed); |
| 234 | execute_window_loop(win_collapsed, [&](const Coordinates &) |
| 235 | { |
| 236 | auto input_ptr = reinterpret_cast<const T *>(input.ptr()); |
| 237 | auto output_ptr = reinterpret_cast<uint16_t *>(output.ptr()); |
| 238 | |
| 239 | int x = window_start_x; |
| 240 | for(; x <= (window_end_x - window_step); x += window_step) |
| 241 | { |
| 242 | uint16x8x2_t tmp = vquantize_qasymm16(load_value(&input_ptr[x]), uqinfo); |
| 243 | vst1q_u16(&output_ptr[x], tmp.val[0]); |
| 244 | vst1q_u16(&output_ptr[x + 8], tmp.val[1]); |
| 245 | } |
| 246 | // Compute left-over elements |
| 247 | for(; x < window_end_x; ++x) |
| 248 | { |
| 249 | output_ptr[x] = quantize_qasymm16(input_ptr[x], uqinfo, rounding_policy); |
| 250 | } |
| 251 | }, |
| 252 | input, output); |
| 253 | } |
| 254 | |
Moritz Pflanzer | c186b57 | 2017-09-07 09:48:04 +0100 | [diff] [blame] | 255 | void NEQuantizationLayerKernel::run(const Window &window, const ThreadInfo &info) |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 256 | { |
Moritz Pflanzer | c186b57 | 2017-09-07 09:48:04 +0100 | [diff] [blame] | 257 | ARM_COMPUTE_UNUSED(info); |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 258 | ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); |
| 259 | ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(INEKernel::window(), window); |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 260 | ARM_COMPUTE_ERROR_ON(_func == nullptr); |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 261 | |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 262 | (this->*_func)(window); |
Michele Di Giorgio | 4e09b38 | 2017-07-05 18:20:02 +0100 | [diff] [blame] | 263 | } |
Michele Di Giorgio | d64a46c | 2019-10-01 12:25:49 +0100 | [diff] [blame] | 264 | } // namespace arm_compute |