aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NEReshapeLayer.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2020-05-21 15:02:36 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2020-06-16 11:42:09 +0000
commitbcd2352d7fd99a2f6aab220fa0c3b3f3119a1a4c (patch)
treea3e1880071bca828b1c58be71805ccce4b205e53 /src/runtime/NEON/functions/NEReshapeLayer.cpp
parenteae658453199d67a41deccbeb78e55b8eea9e966 (diff)
downloadComputeLibrary-bcd2352d7fd99a2f6aab220fa0c3b3f3119a1a4c.tar.gz
COMPMID-3391: Implement Async interfaces
Change-Id: I8168cea5056ff48a0253ebb8c88ea549a3ea69a2 Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3335 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NEReshapeLayer.cpp')
-rw-r--r--src/runtime/NEON/functions/NEReshapeLayer.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/runtime/NEON/functions/NEReshapeLayer.cpp b/src/runtime/NEON/functions/NEReshapeLayer.cpp
index 0a9f42d510..680abef026 100644
--- a/src/runtime/NEON/functions/NEReshapeLayer.cpp
+++ b/src/runtime/NEON/functions/NEReshapeLayer.cpp
@@ -25,13 +25,17 @@
#include "arm_compute/core/NEON/kernels/NEReshapeLayerKernel.h"
#include "arm_compute/core/Validate.h"
+#include "arm_compute/runtime/NEON/NEScheduler.h"
+#include "arm_compute/runtime/Types.h"
#include "support/MemorySupport.h"
#include <utility>
namespace arm_compute
{
-void NEReshapeLayer::configure(const ITensor *input, ITensor *output)
+namespace experimental
+{
+void NEReshapeLayer::configure(const ITensorInfo *input, ITensorInfo *output)
{
auto k = arm_compute::support::cpp14::make_unique<NEReshapeLayerKernel>();
k->configure(input, output);
@@ -40,9 +44,41 @@ void NEReshapeLayer::configure(const ITensor *input, ITensor *output)
Status NEReshapeLayer::validate(const ITensorInfo *input, const ITensorInfo *output)
{
+ return arm_compute::NEReshapeLayer::validate(input, output);
+}
+
+MemoryRequirements NEReshapeLayer::workspace() const
+{
+ return MemoryRequirements{};
+}
+} // namespace experimental
+
+void NEReshapeLayer::configure(const ITensor *input, ITensor *output)
+{
+ _input = input;
+ _output = output;
+
+ auto k = arm_compute::support::cpp14::make_unique<NEReshapeLayerKernel>();
+ k->configure(input->info(), output->info());
+ _kernel = std::move(k);
+}
+
+Status NEReshapeLayer::validate(const ITensorInfo *input, const ITensorInfo *output)
+{
ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output);
ARM_COMPUTE_RETURN_ON_ERROR(NEReshapeLayerKernel::validate(input, output));
return Status{};
}
+
+void NEReshapeLayer::run()
+{
+ InputOperatorTensors src_0 = std::make_pair(TensorType::ACL_SRC, _input);
+ OutputOperatorTensors dst_0 = std::make_pair(TensorType::ACL_DST, _output);
+
+ std::vector<InputOperatorTensors *> inputs = { &src_0 };
+ std::vector<OutputOperatorTensors *> outputs = { &dst_0 };
+
+ NEScheduler::get().schedule_op(_kernel.get(), Window::DimY, inputs, outputs);
+}
} // namespace arm_compute