diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-09-10 15:07:45 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | cbf39c63a6eb89a2c80b2338afc374081803d79d (patch) | |
tree | afe1c55d5e3bbf0e111ec0dce9a564304844a55f /src/runtime/CL/functions | |
parent | d7647d4ebd0f0b5253b7f31ffcd48a851ba62947 (diff) | |
download | ComputeLibrary-cbf39c63a6eb89a2c80b2338afc374081803d79d.tar.gz |
COMPMID-1566: Add broadcast to CLArithmeticSubtraction
Change-Id: I05d21f9a92013ecfd1128d12cf1561cfd6e5c5e9
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/147983
Tested-by: bsgcomp <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/CL/functions')
-rw-r--r-- | src/runtime/CL/functions/CLArithmeticSubtraction.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/runtime/CL/functions/CLArithmeticSubtraction.cpp b/src/runtime/CL/functions/CLArithmeticSubtraction.cpp index 5fca30c4f9..e661f6adc1 100644 --- a/src/runtime/CL/functions/CLArithmeticSubtraction.cpp +++ b/src/runtime/CL/functions/CLArithmeticSubtraction.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -23,6 +23,7 @@ */ #include "arm_compute/runtime/CL/functions/CLArithmeticSubtraction.h" +#include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/CL/kernels/CLArithmeticSubtractionKernel.h" #include "support/ToolchainSupport.h" @@ -30,11 +31,21 @@ using namespace arm_compute; -void CLArithmeticSubtraction::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, ConvertPolicy policy) +void CLArithmeticSubtraction::configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ConvertPolicy policy) { auto k = arm_compute::support::cpp14::make_unique<CLArithmeticSubtractionKernel>(); k->configure(input1, input2, output, policy); _kernel = std::move(k); + + if(output->info()->dimension(0) > 1) + { + ICLTensor *broadcasted_info = (input1->info()->dimension(0) == 1) ? input1 : input2; + + if(broadcasted_info->info()->dimension(0) == 1) + { + _border_handler.configure(broadcasted_info, _kernel->border_size(), BorderMode::REPLICATE); + } + } } Status CLArithmeticSubtraction::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy) |