aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Bottini <manuel.bottini@arm.com>2021-01-26 12:09:38 +0000
committerManuel Bottini <manuel.bottini@arm.com>2021-01-27 10:32:21 +0000
commit26cf7985b8afb940be6678823e3f4f99c8d8558c (patch)
tree7fbc46cf82a7ca51afc2d1b7b762c2cd7c8c41f0
parent4cfab1886549d7582e3867c51278132e5d37681b (diff)
downloadComputeLibrary-26cf7985b8afb940be6678823e3f4f99c8d8558c.tar.gz
Fix NEON/CL CustomConvolution failures
Properly handle UNDEFINED border mode as done in the reference Change-Id: I23b117be3ee5cd0e566f6161681d38493627fc9b Resolves: COMPMID-4133 Signed-off-by: Manuel Bottini <manuel.bottini@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4919 Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-by: Giorgio Arena <giorgio.arena@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--src/runtime/CL/functions/CLConvolution.cpp7
-rw-r--r--src/runtime/NEON/functions/NEConvolution.cpp7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/runtime/CL/functions/CLConvolution.cpp b/src/runtime/CL/functions/CLConvolution.cpp
index 49dae49146..ffc7cda034 100644
--- a/src/runtime/CL/functions/CLConvolution.cpp
+++ b/src/runtime/CL/functions/CLConvolution.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2020 Arm Limited.
+ * Copyright (c) 2016-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -136,8 +136,9 @@ void CLConvolutionRectangle::configure(ICLTensor *input, ICLTensor *output, cons
void CLConvolutionRectangle::configure(const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, const int16_t *conv, uint32_t rows, uint32_t cols, uint32_t scale,
BorderMode border_mode, uint8_t constant_border_value)
{
- auto k = std::make_unique<CLConvolutionRectangleKernel>();
- k->configure(compile_context, input, output, conv, rows, cols, scale, border_mode == BorderMode::UNDEFINED);
+ border_mode = (border_mode == BorderMode::UNDEFINED) ? BorderMode::CONSTANT : border_mode;
+ auto k = std::make_unique<CLConvolutionRectangleKernel>();
+ k->configure(compile_context, input, output, conv, rows, cols, scale, false);
_kernel = std::move(k);
_border_handler->configure(compile_context, input, _kernel->border_size(), border_mode, PixelValue(constant_border_value));
}
diff --git a/src/runtime/NEON/functions/NEConvolution.cpp b/src/runtime/NEON/functions/NEConvolution.cpp
index 680d8f628f..ad62a2254a 100644
--- a/src/runtime/NEON/functions/NEConvolution.cpp
+++ b/src/runtime/NEON/functions/NEConvolution.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2020 Arm Limited.
+ * Copyright (c) 2016-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -137,8 +137,9 @@ NEConvolutionRectangle::~NEConvolutionRectangle() = default;
void NEConvolutionRectangle::configure(ITensor *input, ITensor *output, const int16_t *conv, uint32_t rows, uint32_t cols, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value)
{
- auto k = std::make_unique<NEConvolutionRectangleKernel>();
- k->configure(input, output, conv, rows, cols, scale, border_mode == BorderMode::UNDEFINED);
+ border_mode = (border_mode == BorderMode::UNDEFINED) ? BorderMode::CONSTANT : border_mode;
+ auto k = std::make_unique<NEConvolutionRectangleKernel>();
+ k->configure(input, output, conv, rows, cols, scale, false);
_kernel = std::move(k);
auto b = std::make_unique<NEFillBorderKernel>();