aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2020-06-23 17:25:43 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2020-06-25 13:14:06 +0000
commit173ba9bbb19ea83f951318d9989e440768b4de8f (patch)
tree840a28e1cc4d0adf47097c8ab27092531c8e0958 /src/runtime/NEON/functions/NEArithmeticSubtraction.cpp
parent0f954eb6c8bf2f6c8600c56f21fec6aa9ebf082e (diff)
downloadComputeLibrary-173ba9bbb19ea83f951318d9989e440768b4de8f.tar.gz
COMPMID-3373: Async support to NEArithmetic* kernels/functions (Pt. 1)
Added support on NEArithmeticAddition and NEArithmeticSubtraction Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Change-Id: Ifa805f8455ef6eff1ee627752dc1c7fe9740ec47 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3451 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NEArithmeticSubtraction.cpp')
-rw-r--r--src/runtime/NEON/functions/NEArithmeticSubtraction.cpp47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp b/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp
index 20f930a286..043250ca68 100644
--- a/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp
+++ b/src/runtime/NEON/functions/NEArithmeticSubtraction.cpp
@@ -31,7 +31,9 @@
namespace arm_compute
{
-void NEArithmeticSubtraction::configure(ITensor *input1, ITensor *input2, ITensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info)
+namespace experimental
+{
+void NEArithmeticSubtraction::configure(const ITensorInfo *input1, const ITensorInfo *input2, ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info)
{
ARM_COMPUTE_UNUSED(act_info);
auto k = arm_compute::support::cpp14::make_unique<NEArithmeticSubtractionKernel>();
@@ -44,4 +46,47 @@ Status NEArithmeticSubtraction::validate(const ITensorInfo *input1, const ITenso
ARM_COMPUTE_RETURN_ERROR_ON(act_info.enabled());
return NEArithmeticSubtractionKernel::validate(input1, input2, output, policy);
}
+
+MemoryRequirements NEArithmeticSubtraction::workspace() const
+{
+ return MemoryRequirements{};
+}
+} // namespace experimental
+
+struct NEArithmeticSubtraction::Impl
+{
+ const ITensor *src_0{ nullptr };
+ const ITensor *src_1{ nullptr };
+ ITensor *dst{ nullptr };
+ std::unique_ptr<experimental::NEArithmeticSubtraction> op{ nullptr };
+};
+
+NEArithmeticSubtraction::NEArithmeticSubtraction()
+ : _impl(support::cpp14::make_unique<Impl>())
+{
+}
+NEArithmeticSubtraction::NEArithmeticSubtraction(NEArithmeticSubtraction &&) = default;
+NEArithmeticSubtraction &NEArithmeticSubtraction::operator=(NEArithmeticSubtraction &&) = default;
+NEArithmeticSubtraction::~NEArithmeticSubtraction() = default;
+
+Status NEArithmeticSubtraction::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info)
+{
+ return experimental::NEArithmeticSubtraction::validate(input1, input2, output, policy, act_info);
+}
+
+void NEArithmeticSubtraction::configure(const ITensor *input1, const ITensor *input2, ITensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info)
+{
+ _impl->src_0 = input1;
+ _impl->src_1 = input2;
+ _impl->dst = output;
+ _impl->op = arm_compute::support::cpp14::make_unique<experimental::NEArithmeticSubtraction>();
+ _impl->op->configure(input1->info(), input2->info(), output->info(), policy, act_info);
+}
+
+void NEArithmeticSubtraction::run()
+{
+ const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
+ const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ _impl->op->run(src, dst, {});
+}
} // namespace arm_compute