diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2018-04-10 13:41:30 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:52:54 +0000 |
commit | 46da23fac3bba64f78f20192750aa094781efbb3 (patch) | |
tree | 929e8237c1efe2fcd93a4baf1b74e30383c54b4f /src/runtime/CL | |
parent | b940fd6a17b32ad87bdafc57adccb4433cf3fb75 (diff) | |
download | ComputeLibrary-46da23fac3bba64f78f20192750aa094781efbb3.tar.gz |
COMPMID-813 Add NHWC data format support for CL scale
Change-Id: Ie218447c4f3f94a37b5dd2d3b33488c7f5869adf
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128520
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/CL')
-rw-r--r-- | src/runtime/CL/functions/CLGaussianPyramid.cpp | 2 | ||||
-rw-r--r-- | src/runtime/CL/functions/CLScale.cpp | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/runtime/CL/functions/CLGaussianPyramid.cpp b/src/runtime/CL/functions/CLGaussianPyramid.cpp index ddce5fb8c3..fd82769004 100644 --- a/src/runtime/CL/functions/CLGaussianPyramid.cpp +++ b/src/runtime/CL/functions/CLGaussianPyramid.cpp @@ -166,7 +166,7 @@ void CLGaussianPyramidOrb::configure(ICLTensor *input, CLPyramid *pyramid, Borde _gauss5x5[i].configure(_pyramid->get_pyramid_level(i), _tmp.get_pyramid_level(i), border_mode, constant_border_value); /* Configure scale image kernel */ - _scale_nearest[i].configure(_tmp.get_pyramid_level(i), _pyramid->get_pyramid_level(i + 1), InterpolationPolicy::NEAREST_NEIGHBOR, border_mode == BorderMode::UNDEFINED, SamplingPolicy::CENTER); + _scale_nearest[i].configure(_tmp.get_pyramid_level(i), _pyramid->get_pyramid_level(i + 1), InterpolationPolicy::NEAREST_NEIGHBOR, border_mode, SamplingPolicy::CENTER); } _tmp.allocate(); diff --git a/src/runtime/CL/functions/CLScale.cpp b/src/runtime/CL/functions/CLScale.cpp index cb68481787..7ef55f9f08 100644 --- a/src/runtime/CL/functions/CLScale.cpp +++ b/src/runtime/CL/functions/CLScale.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -34,7 +34,14 @@ using namespace arm_compute; void CLScale::configure(ICLTensor *input, ICLTensor *output, InterpolationPolicy policy, BorderMode border_mode, PixelValue constant_border_value, SamplingPolicy sampling_policy) { auto k = arm_compute::support::cpp14::make_unique<CLScaleKernel>(); - k->configure(input, output, policy, border_mode == BorderMode::UNDEFINED, sampling_policy); + k->configure(input, output, policy, border_mode, sampling_policy); _kernel = std::move(k); + + // In the case of NHWC we can't have undefined border mode as this would require to access elements outside z dimension, + // so we treat it like border constant. + if(border_mode == BorderMode::UNDEFINED && input->info()->data_layout() == DataLayout::NHWC) + { + border_mode = BorderMode::CONSTANT; + } _border_handler.configure(input, _kernel->border_size(), border_mode, constant_border_value); } |