From adfb2737046028c042f0aecaff87733a442da29f Mon Sep 17 00:00:00 2001 From: John Kesapides Date: Mon, 4 Mar 2019 16:29:22 +0000 Subject: COMPMID-1935 Add support for QASYMM8 in NEQuantizeLayer Change-Id: I2b63a644d8e34f91c830d9ac398debcbdca3e497 Signed-off-by: John Kesapides Reviewed-on: https://review.mlplatform.org/c/829 Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins --- src/runtime/NEON/functions/NEQuantizationLayer.cpp | 35 ++++------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'src/runtime/NEON') diff --git a/src/runtime/NEON/functions/NEQuantizationLayer.cpp b/src/runtime/NEON/functions/NEQuantizationLayer.cpp index 8f7db96de8..65873b1b14 100644 --- a/src/runtime/NEON/functions/NEQuantizationLayer.cpp +++ b/src/runtime/NEON/functions/NEQuantizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -26,22 +26,13 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/NEON/NEScheduler.h" using namespace arm_compute; -NEQuantizationLayer::NEQuantizationLayer() - : _quantize_kernel(), _min_max_kernel(), _min_max() -{ -} - Status NEQuantizationLayer::validate(const ITensorInfo *input, const ITensorInfo *output) { ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output); - - TensorInfo min_max{ input->num_channels(), input->data_type() }; - ARM_COMPUTE_RETURN_ON_ERROR(NEMinMaxLayerKernel::validate(input, &min_max)); - ARM_COMPUTE_RETURN_ON_ERROR(NEQuantizationLayerKernel::validate(input, output, &min_max)); + ARM_COMPUTE_RETURN_ON_ERROR(NEQuantizationLayerKernel::validate(input, output)); return Status{}; } @@ -50,24 +41,8 @@ void NEQuantizationLayer::configure(const ITensor *input, ITensor *output) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); - // Configure min-max kernel. _min_max tensor will be auto-configured within the kernel - _min_max_kernel.configure(input, &_min_max); - // Configure quantize kernel - _quantize_kernel.configure(input, output, &_min_max); - - // Allocate min_max tensor - _min_max.allocator()->allocate(); -} - -void NEQuantizationLayer::run() -{ - // Reset min and max - _min_max_kernel.reset(); - - // Run min and max kernel - NEScheduler::get().schedule(&_min_max_kernel, Window::DimY); - - // Run quantize kernel - NEScheduler::get().schedule(&_quantize_kernel, Window::DimY); + auto k = arm_compute::support::cpp14::make_unique(); + k->configure(input, output); + _kernel = std::move(k); } -- cgit v1.2.1