diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-06-16 17:44:46 +0100 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2020-06-17 09:29:40 +0000 |
commit | 1fd2c80692ed8ecefc4d8deb783564ad19eaf70c (patch) | |
tree | b44219bdc8bdc17cb2906dd50a5ba1ee1e6b12fc /src/runtime/NEON/functions/NEReshapeLayer.cpp | |
parent | 27a9e4f10516679bc6e92bec104ae219e1fa7f15 (diff) | |
download | ComputeLibrary-1fd2c80692ed8ecefc4d8deb783564ad19eaf70c.tar.gz |
COMPMID-3375: Port NEActivationLayer functions/kernels to run on
different tensors.
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I98782bb73e9dc0899ffb1796aca6f99714adea94
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3343
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NEReshapeLayer.cpp')
-rw-r--r-- | src/runtime/NEON/functions/NEReshapeLayer.cpp | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/runtime/NEON/functions/NEReshapeLayer.cpp b/src/runtime/NEON/functions/NEReshapeLayer.cpp index 680abef026..daf358e7db 100644 --- a/src/runtime/NEON/functions/NEReshapeLayer.cpp +++ b/src/runtime/NEON/functions/NEReshapeLayer.cpp @@ -44,7 +44,7 @@ void NEReshapeLayer::configure(const ITensorInfo *input, ITensorInfo *output) Status NEReshapeLayer::validate(const ITensorInfo *input, const ITensorInfo *output) { - return arm_compute::NEReshapeLayer::validate(input, output); + return arm_compute::NEReshapeLayerKernel::validate(input, output); } MemoryRequirements NEReshapeLayer::workspace() const @@ -53,32 +53,44 @@ MemoryRequirements NEReshapeLayer::workspace() const } } // namespace experimental -void NEReshapeLayer::configure(const ITensor *input, ITensor *output) +struct NEReshapeLayer::Impl { - _input = input; - _output = output; + const ITensor *src{ nullptr }; + ITensor *dst{ nullptr }; + std::unique_ptr<experimental::NEReshapeLayer> op{ nullptr }; +}; - auto k = arm_compute::support::cpp14::make_unique<NEReshapeLayerKernel>(); - k->configure(input->info(), output->info()); - _kernel = std::move(k); +NEReshapeLayer::NEReshapeLayer() + : _impl(support::cpp14::make_unique<Impl>()) +{ +} + +NEReshapeLayer::NEReshapeLayer(NEReshapeLayer &&) = default; + +NEReshapeLayer &NEReshapeLayer::operator=(NEReshapeLayer &&) = default; + +NEReshapeLayer::~NEReshapeLayer() = default; + +void NEReshapeLayer::configure(const ITensor *input, ITensor *output) +{ + _impl->src = input; + _impl->dst = output; + _impl->op = arm_compute::support::cpp14::make_unique<experimental::NEReshapeLayer>(); + _impl->op->configure(input->info(), output->info()); } 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)); + ARM_COMPUTE_RETURN_ON_ERROR(experimental::NEReshapeLayer::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); + const InputTensor src{ TensorType::ACL_SRC, _impl->src }; + OutputTensor dst{ TensorType::ACL_DST, _impl->dst }; + _impl->op->run({ src }, { dst }, {}); } } // namespace arm_compute |