giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | d9eaf61 | 2020-07-08 11:12:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2020 Arm Limited. |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
giuros01 | 1e6e1b8 | 2019-05-14 16:12:53 +0100 | [diff] [blame] | 24 | #include "arm_compute/runtime/CL/functions/CLElementwiseOperations.h" |
| 25 | |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 26 | #include "arm_compute/core/CL/ICLTensor.h" |
| 27 | #include "arm_compute/core/CL/kernels/CLElementwiseOperationKernel.h" |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 28 | #include "arm_compute/runtime/CL/CLScheduler.h" |
Matthew Bentham | 9204646 | 2020-03-07 22:15:55 +0000 | [diff] [blame] | 29 | #include "support/MemorySupport.h" |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 30 | |
| 31 | #include <utility> |
| 32 | |
| 33 | namespace arm_compute |
| 34 | { |
| 35 | namespace |
| 36 | { |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 37 | void configure_border_handler(const CLCompileContext &compile_context, CLFillBorderKernel &border_handler, BorderSize border_size, ITensorInfo *input1, ITensorInfo *input2, const ITensorInfo *output) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 38 | { |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 39 | if(output->dimension(0) > 1) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 40 | { |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 41 | ITensorInfo *broadcasted_info = (input1->dimension(0) == 1) ? input1 : input2; |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 42 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 43 | if(broadcasted_info->dimension(0) == 1) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 44 | { |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 45 | border_handler.configure(compile_context, broadcasted_info, border_size, BorderMode::REPLICATE); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 46 | } |
| 47 | } |
| 48 | } |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 49 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 50 | ITensorPack select_border_input(ITensorPack &tensors) |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 51 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 52 | ITensorPack pack; |
| 53 | if(tensors.get_tensor(TensorType::ACL_DST)->info()->dimension(0) > 1) |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 54 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 55 | if(tensors.get_const_tensor(TensorType::ACL_SRC_1)->info()->dimension(0) == 1) |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 56 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 57 | pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(TensorType::ACL_SRC_1)); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 58 | } |
| 59 | else |
| 60 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 61 | pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(TensorType::ACL_SRC_0)); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 62 | } |
| 63 | } |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 64 | return pack; |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 65 | } |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 66 | } // namespace |
| 67 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 68 | namespace experimental |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 69 | { |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 70 | CLArithmeticAddition::CLArithmeticAddition() |
| 71 | : _border_handler() |
| 72 | { |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 73 | } |
| 74 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 75 | void CLArithmeticAddition::configure(const CLCompileContext &compile_context, ITensorInfo *input1, ITensorInfo *input2, ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 76 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 77 | auto k = arm_compute::support::cpp14::make_unique<CLSaturatedArithmeticOperationKernel>(); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 78 | k->configure(compile_context, ArithmeticOperation::ADD, input1, input2, output, policy, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 79 | _kernel = std::move(k); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 80 | configure_border_handler(compile_context, _border_handler, _kernel->border_size(), input1, input2, output); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 81 | } |
| 82 | |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 83 | Status CLArithmeticAddition::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 84 | { |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 85 | return CLSaturatedArithmeticOperationKernel::validate(ArithmeticOperation::ADD, input1, input2, output, policy, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 86 | } |
| 87 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 88 | void CLArithmeticAddition::run(ITensorPack &tensors) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 89 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 90 | auto border_pack = select_border_input(tensors); |
| 91 | CLScheduler::get().enqueue_op(_border_handler, border_pack); |
| 92 | ICLOperator::run(tensors); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 93 | } |
| 94 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 95 | CLArithmeticSubtraction::CLArithmeticSubtraction() |
| 96 | : _border_handler() |
| 97 | { |
| 98 | } |
| 99 | void CLArithmeticSubtraction::configure(const CLCompileContext &compile_context, ITensorInfo *input1, ITensorInfo *input2, ITensorInfo *output, ConvertPolicy policy, |
| 100 | const ActivationLayerInfo &act_info) |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 101 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 102 | auto k = arm_compute::support::cpp14::make_unique<CLSaturatedArithmeticOperationKernel>(); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 103 | k->configure(compile_context, ArithmeticOperation::SUB, input1, input2, output, policy, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 104 | _kernel = std::move(k); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 105 | configure_border_handler(compile_context, _border_handler, _kernel->border_size(), input1, input2, output); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 106 | } |
| 107 | |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 108 | Status CLArithmeticSubtraction::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 109 | { |
| 110 | ARM_COMPUTE_UNUSED(policy); |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 111 | return CLSaturatedArithmeticOperationKernel::validate(ArithmeticOperation::SUB, input1, input2, output, policy, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 112 | } |
| 113 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 114 | void CLArithmeticSubtraction::run(ITensorPack &tensors) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 115 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 116 | auto border_pack = select_border_input(tensors); |
| 117 | CLScheduler::get().enqueue_op(_border_handler, border_pack); |
| 118 | ICLOperator::run(tensors); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 119 | } |
| 120 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 121 | CLArithmeticDivision::CLArithmeticDivision() |
| 122 | : _border_handler() |
| 123 | { |
| 124 | } |
| 125 | |
| 126 | void CLArithmeticDivision::configure(const CLCompileContext &compile_context, ITensorInfo *input1, ITensorInfo *input2, ITensorInfo *output, const ActivationLayerInfo &act_info) |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 127 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 128 | auto k = arm_compute::support::cpp14::make_unique<CLArithmeticOperationKernel>(); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 129 | k->configure(compile_context, ArithmeticOperation::DIV, input1, input2, output, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 130 | _kernel = std::move(k); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 131 | configure_border_handler(compile_context, _border_handler, _kernel->border_size(), input1, input2, output); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 132 | } |
| 133 | |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 134 | Status CLArithmeticDivision::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 135 | { |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 136 | return CLArithmeticOperationKernel::validate(ArithmeticOperation::DIV, input1, input2, output, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 137 | } |
| 138 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 139 | void CLArithmeticDivision::run(ITensorPack &tensors) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 140 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 141 | auto border_pack = select_border_input(tensors); |
| 142 | CLScheduler::get().enqueue_op(_border_handler, border_pack); |
| 143 | ICLOperator::run(tensors); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 144 | } |
| 145 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 146 | CLElementwiseMax::CLElementwiseMax() |
| 147 | : _border_handler() |
| 148 | { |
| 149 | } |
| 150 | |
| 151 | void CLElementwiseMax::configure(const CLCompileContext &compile_context, ITensorInfo *input1, ITensorInfo *input2, ITensorInfo *output, const ActivationLayerInfo &act_info) |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 152 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 153 | auto k = arm_compute::support::cpp14::make_unique<CLArithmeticOperationKernel>(); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 154 | k->configure(compile_context, ArithmeticOperation::MAX, input1, input2, output, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 155 | _kernel = std::move(k); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 156 | configure_border_handler(compile_context, _border_handler, _kernel->border_size(), input1, input2, output); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 157 | } |
| 158 | |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 159 | Status CLElementwiseMax::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 160 | { |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 161 | return CLArithmeticOperationKernel::validate(ArithmeticOperation::MAX, input1, input2, output, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 162 | } |
| 163 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 164 | void CLElementwiseMax::run(ITensorPack &tensors) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 165 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 166 | auto border_pack = select_border_input(tensors); |
| 167 | CLScheduler::get().enqueue_op(_border_handler, border_pack); |
| 168 | ICLOperator::run(tensors); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 169 | } |
| 170 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 171 | CLElementwiseMin::CLElementwiseMin() |
| 172 | : _border_handler() |
| 173 | { |
| 174 | } |
| 175 | |
| 176 | void CLElementwiseMin::configure(const CLCompileContext &compile_context, ITensorInfo *input1, ITensorInfo *input2, ITensorInfo *output, const ActivationLayerInfo &act_info) |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 177 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 178 | auto k = arm_compute::support::cpp14::make_unique<CLArithmeticOperationKernel>(); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 179 | k->configure(compile_context, ArithmeticOperation::MIN, input1, input2, output, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 180 | _kernel = std::move(k); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 181 | configure_border_handler(compile_context, _border_handler, _kernel->border_size(), input1, input2, output); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 182 | } |
| 183 | |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 184 | Status CLElementwiseMin::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 185 | { |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 186 | return CLArithmeticOperationKernel::validate(ArithmeticOperation::MIN, input1, input2, output, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 187 | } |
| 188 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 189 | void CLElementwiseMin::run(ITensorPack &tensors) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 190 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 191 | auto border_pack = select_border_input(tensors); |
| 192 | CLScheduler::get().enqueue_op(_border_handler, border_pack); |
| 193 | ICLOperator::run(tensors); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 194 | } |
| 195 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 196 | CLElementwiseSquaredDiff::CLElementwiseSquaredDiff() |
| 197 | : _border_handler() |
| 198 | { |
| 199 | } |
| 200 | |
| 201 | void CLElementwiseSquaredDiff::configure(const CLCompileContext &compile_context, ITensorInfo *input1, ITensorInfo *input2, ITensorInfo *output, const ActivationLayerInfo &act_info) |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 202 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 203 | auto k = arm_compute::support::cpp14::make_unique<CLArithmeticOperationKernel>(); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 204 | k->configure(compile_context, ArithmeticOperation::SQUARED_DIFF, input1, input2, output, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 205 | _kernel = std::move(k); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 206 | configure_border_handler(compile_context, _border_handler, _kernel->border_size(), input1, input2, output); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 207 | } |
| 208 | |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 209 | Status CLElementwiseSquaredDiff::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 210 | { |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 211 | return CLArithmeticOperationKernel::validate(ArithmeticOperation::SQUARED_DIFF, input1, input2, output, act_info); |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 212 | } |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 213 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 214 | void CLElementwiseSquaredDiff::run(ITensorPack &tensors) |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 215 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 216 | auto border_pack = select_border_input(tensors); |
| 217 | CLScheduler::get().enqueue_op(_border_handler, border_pack); |
| 218 | ICLOperator::run(tensors); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 219 | } |
| 220 | |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 221 | CLElementwisePower::CLElementwisePower() |
| 222 | : _border_handler() |
| 223 | { |
| 224 | } |
| 225 | |
| 226 | void CLElementwisePower::configure(const CLCompileContext &compile_context, ITensorInfo *input1, ITensorInfo *input2, ITensorInfo *output, const ActivationLayerInfo &act_info) |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 227 | { |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 228 | auto k = arm_compute::support::cpp14::make_unique<CLArithmeticOperationKernel>(); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 229 | k->configure(compile_context, ArithmeticOperation::POWER, input1, input2, output, act_info); |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 230 | _kernel = std::move(k); |
Manuel Bottini | 2b84be5 | 2020-04-08 10:15:51 +0100 | [diff] [blame] | 231 | configure_border_handler(compile_context, _border_handler, _kernel->border_size(), input1, input2, output); |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 232 | } |
| 233 | |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 234 | Status CLElementwisePower::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 235 | { |
Giorgio Arena | 8b2a7d3 | 2020-02-11 17:21:31 +0000 | [diff] [blame] | 236 | return CLArithmeticOperationKernel::validate(ArithmeticOperation::POWER, input1, input2, output, act_info); |
Usama Arif | 52c54f6 | 2019-05-14 10:22:36 +0100 | [diff] [blame] | 237 | } |
| 238 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 239 | void CLElementwisePower::run(ITensorPack &tensors) |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 240 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 241 | auto border_pack = select_border_input(tensors); |
| 242 | CLScheduler::get().enqueue_op(_border_handler, border_pack); |
| 243 | ICLOperator::run(tensors); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 244 | } |
| 245 | } // namespace experimental |
| 246 | |
| 247 | struct CLArithmeticAddition::Impl |
| 248 | { |
| 249 | const ICLTensor *src_0{ nullptr }; |
| 250 | const ICLTensor *src_1{ nullptr }; |
| 251 | ICLTensor *dst{ nullptr }; |
| 252 | std::unique_ptr<experimental::CLArithmeticAddition> op{ nullptr }; |
| 253 | }; |
| 254 | |
| 255 | CLArithmeticAddition::CLArithmeticAddition() |
| 256 | : _impl(support::cpp14::make_unique<Impl>()) |
| 257 | { |
| 258 | } |
| 259 | CLArithmeticAddition::CLArithmeticAddition(CLArithmeticAddition &&) = default; |
| 260 | CLArithmeticAddition &CLArithmeticAddition::operator=(CLArithmeticAddition &&) = default; |
| 261 | CLArithmeticAddition::~CLArithmeticAddition() = default; |
| 262 | |
| 263 | void CLArithmeticAddition::configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
| 264 | { |
| 265 | configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, policy, act_info); |
| 266 | } |
| 267 | |
| 268 | void CLArithmeticAddition::configure(const CLCompileContext &compile_context, const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, ConvertPolicy policy, |
| 269 | const ActivationLayerInfo &act_info) |
| 270 | { |
| 271 | _impl->src_0 = input1; |
| 272 | _impl->src_1 = input2; |
| 273 | _impl->dst = output; |
| 274 | _impl->op = arm_compute::support::cpp14::make_unique<experimental::CLArithmeticAddition>(); |
| 275 | _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), policy, act_info); |
| 276 | } |
| 277 | |
| 278 | Status CLArithmeticAddition::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
| 279 | { |
| 280 | return experimental::CLArithmeticAddition::validate(input1, input2, output, policy, act_info); |
| 281 | } |
| 282 | |
| 283 | void CLArithmeticAddition::run() |
| 284 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 285 | ITensorPack pack; |
| 286 | pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0); |
| 287 | pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1); |
| 288 | pack.add_tensor(TensorType::ACL_DST, _impl->dst); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 289 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 290 | _impl->op->run(pack); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | struct CLArithmeticSubtraction::Impl |
| 294 | { |
| 295 | const ICLTensor *src_0{ nullptr }; |
| 296 | const ICLTensor *src_1{ nullptr }; |
| 297 | ICLTensor *dst{ nullptr }; |
| 298 | std::unique_ptr<experimental::CLArithmeticSubtraction> op{ nullptr }; |
| 299 | }; |
| 300 | |
| 301 | CLArithmeticSubtraction::CLArithmeticSubtraction() |
| 302 | : _impl(support::cpp14::make_unique<Impl>()) |
| 303 | { |
| 304 | } |
| 305 | CLArithmeticSubtraction::CLArithmeticSubtraction(CLArithmeticSubtraction &&) = default; |
| 306 | CLArithmeticSubtraction &CLArithmeticSubtraction::operator=(CLArithmeticSubtraction &&) = default; |
| 307 | CLArithmeticSubtraction::~CLArithmeticSubtraction() = default; |
| 308 | |
| 309 | void CLArithmeticSubtraction::configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
| 310 | { |
| 311 | configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, policy, act_info); |
| 312 | } |
| 313 | |
| 314 | void CLArithmeticSubtraction::configure(const CLCompileContext &compile_context, const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, ConvertPolicy policy, |
| 315 | const ActivationLayerInfo &act_info) |
| 316 | { |
| 317 | _impl->src_0 = input1; |
| 318 | _impl->src_1 = input2; |
| 319 | _impl->dst = output; |
| 320 | _impl->op = arm_compute::support::cpp14::make_unique<experimental::CLArithmeticSubtraction>(); |
| 321 | _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), policy, act_info); |
| 322 | } |
| 323 | |
| 324 | Status CLArithmeticSubtraction::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
| 325 | { |
| 326 | return experimental::CLArithmeticSubtraction::validate(input1, input2, output, policy, act_info); |
| 327 | } |
| 328 | |
| 329 | void CLArithmeticSubtraction::run() |
| 330 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 331 | ITensorPack pack; |
| 332 | pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0); |
| 333 | pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1); |
| 334 | pack.add_tensor(TensorType::ACL_DST, _impl->dst); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 335 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 336 | _impl->op->run(pack); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | struct CLArithmeticDivision::Impl |
| 340 | { |
| 341 | const ICLTensor *src_0{ nullptr }; |
| 342 | const ICLTensor *src_1{ nullptr }; |
| 343 | ICLTensor *dst{ nullptr }; |
| 344 | std::unique_ptr<experimental::CLArithmeticDivision> op{ nullptr }; |
| 345 | }; |
| 346 | |
| 347 | CLArithmeticDivision::CLArithmeticDivision() |
| 348 | : _impl(support::cpp14::make_unique<Impl>()) |
| 349 | { |
| 350 | } |
| 351 | CLArithmeticDivision::CLArithmeticDivision(CLArithmeticDivision &&) = default; |
| 352 | CLArithmeticDivision &CLArithmeticDivision::operator=(CLArithmeticDivision &&) = default; |
| 353 | CLArithmeticDivision::~CLArithmeticDivision() = default; |
| 354 | |
| 355 | void CLArithmeticDivision::configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 356 | { |
| 357 | configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, act_info); |
| 358 | } |
| 359 | |
| 360 | void CLArithmeticDivision::configure(const CLCompileContext &compile_context, const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 361 | { |
| 362 | _impl->src_0 = input1; |
| 363 | _impl->src_1 = input2; |
| 364 | _impl->dst = output; |
| 365 | _impl->op = arm_compute::support::cpp14::make_unique<experimental::CLArithmeticDivision>(); |
| 366 | _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), act_info); |
| 367 | } |
| 368 | |
| 369 | Status CLArithmeticDivision::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
| 370 | { |
| 371 | return experimental::CLArithmeticDivision::validate(input1, input2, output, act_info); |
| 372 | } |
| 373 | |
| 374 | void CLArithmeticDivision::run() |
| 375 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 376 | ITensorPack pack; |
| 377 | pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0); |
| 378 | pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1); |
| 379 | pack.add_tensor(TensorType::ACL_DST, _impl->dst); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 380 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 381 | _impl->op->run(pack); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 382 | } |
| 383 | |
| 384 | struct CLElementwiseMax::Impl |
| 385 | { |
| 386 | const ICLTensor *src_0{ nullptr }; |
| 387 | const ICLTensor *src_1{ nullptr }; |
| 388 | ICLTensor *dst{ nullptr }; |
| 389 | std::unique_ptr<experimental::CLElementwiseMax> op{ nullptr }; |
| 390 | }; |
| 391 | |
| 392 | CLElementwiseMax::CLElementwiseMax() |
| 393 | : _impl(support::cpp14::make_unique<Impl>()) |
| 394 | { |
| 395 | } |
| 396 | CLElementwiseMax::CLElementwiseMax(CLElementwiseMax &&) = default; |
| 397 | CLElementwiseMax &CLElementwiseMax::operator=(CLElementwiseMax &&) = default; |
| 398 | CLElementwiseMax::~CLElementwiseMax() = default; |
| 399 | |
| 400 | void CLElementwiseMax::configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 401 | { |
| 402 | configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, act_info); |
| 403 | } |
| 404 | |
| 405 | void CLElementwiseMax::configure(const CLCompileContext &compile_context, ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 406 | { |
| 407 | _impl->src_0 = input1; |
| 408 | _impl->src_1 = input2; |
| 409 | _impl->dst = output; |
| 410 | _impl->op = arm_compute::support::cpp14::make_unique<experimental::CLElementwiseMax>(); |
| 411 | _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), act_info); |
| 412 | } |
| 413 | |
| 414 | Status CLElementwiseMax::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
| 415 | { |
| 416 | return experimental::CLElementwiseMax::validate(input1, input2, output, act_info); |
| 417 | } |
| 418 | |
| 419 | void CLElementwiseMax::run() |
| 420 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 421 | ITensorPack pack; |
| 422 | pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0); |
| 423 | pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1); |
| 424 | pack.add_tensor(TensorType::ACL_DST, _impl->dst); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 425 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 426 | _impl->op->run(pack); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 427 | } |
| 428 | |
| 429 | struct CLElementwiseMin::Impl |
| 430 | { |
| 431 | const ICLTensor *src_0{ nullptr }; |
| 432 | const ICLTensor *src_1{ nullptr }; |
| 433 | ICLTensor *dst{ nullptr }; |
| 434 | std::unique_ptr<experimental::CLElementwiseMin> op{ nullptr }; |
| 435 | }; |
| 436 | |
| 437 | CLElementwiseMin::CLElementwiseMin() |
| 438 | : _impl(support::cpp14::make_unique<Impl>()) |
| 439 | { |
| 440 | } |
| 441 | CLElementwiseMin::CLElementwiseMin(CLElementwiseMin &&) = default; |
| 442 | CLElementwiseMin &CLElementwiseMin::operator=(CLElementwiseMin &&) = default; |
| 443 | CLElementwiseMin::~CLElementwiseMin() = default; |
| 444 | |
| 445 | void CLElementwiseMin::configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 446 | { |
| 447 | configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, act_info); |
| 448 | } |
| 449 | |
| 450 | void CLElementwiseMin::configure(const CLCompileContext &compile_context, ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 451 | { |
| 452 | _impl->src_0 = input1; |
| 453 | _impl->src_1 = input2; |
| 454 | _impl->dst = output; |
| 455 | _impl->op = arm_compute::support::cpp14::make_unique<experimental::CLElementwiseMin>(); |
| 456 | _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), act_info); |
| 457 | } |
| 458 | |
| 459 | Status CLElementwiseMin::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
| 460 | { |
| 461 | return experimental::CLElementwiseMin::validate(input1, input2, output, act_info); |
| 462 | } |
| 463 | |
| 464 | void CLElementwiseMin::run() |
| 465 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 466 | ITensorPack pack; |
| 467 | pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0); |
| 468 | pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1); |
| 469 | pack.add_tensor(TensorType::ACL_DST, _impl->dst); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 470 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 471 | _impl->op->run(pack); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 472 | } |
| 473 | |
| 474 | struct CLElementwiseSquaredDiff::Impl |
| 475 | { |
| 476 | const ICLTensor *src_0{ nullptr }; |
| 477 | const ICLTensor *src_1{ nullptr }; |
| 478 | ICLTensor *dst{ nullptr }; |
| 479 | std::unique_ptr<experimental::CLElementwiseSquaredDiff> op{ nullptr }; |
| 480 | std::unique_ptr<CLFillBorderKernel> _border_handler{ nullptr }; |
| 481 | }; |
| 482 | |
| 483 | CLElementwiseSquaredDiff::CLElementwiseSquaredDiff() |
| 484 | : _impl(support::cpp14::make_unique<Impl>()) |
| 485 | { |
| 486 | } |
| 487 | CLElementwiseSquaredDiff::CLElementwiseSquaredDiff(CLElementwiseSquaredDiff &&) = default; |
| 488 | CLElementwiseSquaredDiff &CLElementwiseSquaredDiff::operator=(CLElementwiseSquaredDiff &&) = default; |
| 489 | CLElementwiseSquaredDiff::~CLElementwiseSquaredDiff() = default; |
| 490 | |
| 491 | void CLElementwiseSquaredDiff::configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 492 | { |
| 493 | configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, act_info); |
| 494 | } |
| 495 | |
| 496 | void CLElementwiseSquaredDiff::configure(const CLCompileContext &compile_context, ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 497 | { |
| 498 | _impl->src_0 = input1; |
| 499 | _impl->src_1 = input2; |
| 500 | _impl->dst = output; |
| 501 | _impl->op = arm_compute::support::cpp14::make_unique<experimental::CLElementwiseSquaredDiff>(); |
| 502 | _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), act_info); |
| 503 | } |
| 504 | |
| 505 | Status CLElementwiseSquaredDiff::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
| 506 | { |
| 507 | return experimental::CLElementwiseSquaredDiff::validate(input1, input2, output, act_info); |
| 508 | } |
| 509 | |
| 510 | void CLElementwiseSquaredDiff::run() |
| 511 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 512 | ITensorPack pack; |
| 513 | pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0); |
| 514 | pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1); |
| 515 | pack.add_tensor(TensorType::ACL_DST, _impl->dst); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 516 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 517 | _impl->op->run(pack); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 518 | } |
| 519 | |
| 520 | struct CLElementwisePower::Impl |
| 521 | { |
| 522 | const ICLTensor *src_0{ nullptr }; |
| 523 | const ICLTensor *src_1{ nullptr }; |
| 524 | ICLTensor *dst{ nullptr }; |
| 525 | std::unique_ptr<experimental::CLElementwisePower> op{ nullptr }; |
| 526 | }; |
| 527 | |
| 528 | CLElementwisePower::CLElementwisePower() |
| 529 | : _impl(support::cpp14::make_unique<Impl>()) |
| 530 | { |
| 531 | } |
| 532 | CLElementwisePower::CLElementwisePower(CLElementwisePower &&) = default; |
| 533 | CLElementwisePower &CLElementwisePower::operator=(CLElementwisePower &&) = default; |
| 534 | CLElementwisePower::~CLElementwisePower() = default; |
| 535 | |
| 536 | void CLElementwisePower::configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 537 | { |
| 538 | configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, act_info); |
| 539 | } |
| 540 | |
| 541 | void CLElementwisePower::configure(const CLCompileContext &compile_context, ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info) |
| 542 | { |
| 543 | _impl->src_0 = input1; |
| 544 | _impl->src_1 = input2; |
| 545 | _impl->dst = output; |
| 546 | _impl->op = arm_compute::support::cpp14::make_unique<experimental::CLElementwisePower>(); |
| 547 | _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), act_info); |
| 548 | } |
| 549 | |
| 550 | Status CLElementwisePower::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info) |
| 551 | { |
| 552 | return experimental::CLElementwisePower::validate(input1, input2, output, act_info); |
| 553 | } |
| 554 | |
| 555 | void CLElementwisePower::run() |
| 556 | { |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 557 | ITensorPack pack; |
| 558 | pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0); |
| 559 | pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1); |
| 560 | pack.add_tensor(TensorType::ACL_DST, _impl->dst); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 561 | |
Georgios Pinitas | 0499dff | 2020-07-31 22:21:38 +0100 | [diff] [blame] | 562 | _impl->op->run(pack); |
Michalis Spyrou | ad7515d | 2020-07-24 00:02:23 +0100 | [diff] [blame] | 563 | } |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 564 | } // namespace arm_compute |