diff options
Diffstat (limited to 'src/runtime/CL/functions/CLPoolingLayer.cpp')
-rw-r--r-- | src/runtime/CL/functions/CLPoolingLayer.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/runtime/CL/functions/CLPoolingLayer.cpp b/src/runtime/CL/functions/CLPoolingLayer.cpp index 6ca1a33b0c..ac360fbb3d 100644 --- a/src/runtime/CL/functions/CLPoolingLayer.cpp +++ b/src/runtime/CL/functions/CLPoolingLayer.cpp @@ -23,21 +23,33 @@ */ #include "arm_compute/runtime/CL/functions/CLPoolingLayer.h" +#include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/CL/kernels/CLPoolingLayerKernel.h" +#include "arm_compute/runtime/CL/CLScheduler.h" #include "support/ToolchainSupport.h" using namespace arm_compute; void CLPoolingLayer::configure(ICLTensor *input, ICLTensor *output, const PoolingLayerInfo &pool_info) { + ARM_COMPUTE_ERROR_ON_NULLPTR(input); + // Configure pooling kernel auto k = arm_compute::support::cpp14::make_unique<CLPoolingLayerKernel>(); + k->set_target(CLScheduler::get().target()); k->configure(input, output, pool_info); _kernel = std::move(k); // Configure border depending on operation required BorderMode border_mode = (PoolingType::MAX == pool_info.pool_type()) ? BorderMode::REPLICATE : BorderMode::CONSTANT; - _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(0)); + // Quantize border in case data type is quantized asymmetric data type + uint32_t border_value = 0; + 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)); + } + + _border_handler.configure(input, _kernel->border_size(), border_mode, PixelValue(border_value)); } Error CLPoolingLayer::validate(const ITensorInfo *input, const ITensorInfo *output, const PoolingLayerInfo &pool_info) |