diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-01-08 17:37:12 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:43:10 +0000 |
commit | 5518671926c2c493e023a2e0d78b4aef4cb0dcec (patch) | |
tree | 3f2a7c39cc037fdb055c202ee7833d616f77563f /src/runtime/CL/functions/CLPoolingLayer.cpp | |
parent | 1ff480b9537b19d0226e54d9f0027486a3465bbb (diff) | |
download | ComputeLibrary-5518671926c2c493e023a2e0d78b4aef4cb0dcec.tar.gz |
COMPMID-785: Add QASYMM8 support for pooling layer
Adds generic pooling case for QASYMM8
Change-Id: I37d38a92ca61651e915fbbbb6da88e180390b4ab
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/115439
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLPoolingLayer.cpp')
-rw-r--r-- | src/runtime/CL/functions/CLPoolingLayer.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/runtime/CL/functions/CLPoolingLayer.cpp b/src/runtime/CL/functions/CLPoolingLayer.cpp index 2341633362..201bf87b47 100644 --- a/src/runtime/CL/functions/CLPoolingLayer.cpp +++ b/src/runtime/CL/functions/CLPoolingLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -40,16 +40,14 @@ void CLPoolingLayer::configure(ICLTensor *input, ICLTensor *output, const Poolin k->configure(input, output, pool_info); _kernel = std::move(k); - // Configure border depending on operation required + // Configure border depending on operation required (quantize border in case of asymmetric data_type) BorderMode border_mode = (PoolingType::MAX == pool_info.pool_type()) ? BorderMode::REPLICATE : BorderMode::CONSTANT; - // Quantize border in case data type is quantized asymmetric data type - uint32_t border_value = 0; + PixelValue zero_value(0.f); if(is_data_type_quantized_asymmetric(input->info()->data_type()) && !pool_info.exclude_padding()) { - border_value = static_cast<uint32_t>(input->info()->quantization_info().quantize(0.f, RoundingPolicy::TO_NEAREST_UP)); + zero_value = PixelValue(static_cast<uint32_t>(input->info()->quantization_info().offset)); } - - _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(border_value)); + _border_handler.configure(input, _kernel->border_size(), border_mode, zero_value); } Status CLPoolingLayer::validate(const ITensorInfo *input, const ITensorInfo *output, const PoolingLayerInfo &pool_info) |