Nattapat Chaimanowong | cce11fc | 2018-10-12 16:30:56 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "NeonReshapeWorkload.hpp" |
| 7 | |
Matthew Bentham | d80a712 | 2019-01-08 17:52:37 +0000 | [diff] [blame] | 8 | #include "NeonWorkloadUtils.hpp" |
| 9 | |
| 10 | #include <arm_compute/runtime/NEON/functions/NEReshapeLayer.h> |
| 11 | |
| 12 | #include <boost/polymorphic_cast.hpp> |
| 13 | |
Nattapat Chaimanowong | cce11fc | 2018-10-12 16:30:56 +0100 | [diff] [blame] | 14 | namespace armnn |
| 15 | { |
| 16 | |
| 17 | NeonReshapeWorkload::NeonReshapeWorkload(const ReshapeQueueDescriptor& descriptor, |
| 18 | const WorkloadInfo& info) |
| 19 | : BaseWorkload<ReshapeQueueDescriptor>(descriptor, info) |
| 20 | { |
| 21 | m_Data.ValidateInputsOutputs("NeonReshapeWorkload", 1, 1); |
| 22 | |
Derek Lamberti | c81855f | 2019-06-13 17:34:19 +0100 | [diff] [blame] | 23 | arm_compute::ITensor& input = boost::polymorphic_downcast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor(); |
| 24 | arm_compute::ITensor& output = boost::polymorphic_downcast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor(); |
Nattapat Chaimanowong | cce11fc | 2018-10-12 16:30:56 +0100 | [diff] [blame] | 25 | |
Matthew Bentham | d80a712 | 2019-01-08 17:52:37 +0000 | [diff] [blame] | 26 | auto layer = std::make_unique<arm_compute::NEReshapeLayer>(); |
| 27 | layer->configure(&input, &output); |
| 28 | m_Layer.reset(layer.release()); |
Nattapat Chaimanowong | cce11fc | 2018-10-12 16:30:56 +0100 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | void NeonReshapeWorkload::Execute() const |
| 32 | { |
| 33 | ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonReshapeWorkload_Execute"); |
Matthew Bentham | d80a712 | 2019-01-08 17:52:37 +0000 | [diff] [blame] | 34 | m_Layer->run(); |
Nattapat Chaimanowong | cce11fc | 2018-10-12 16:30:56 +0100 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | } //namespace armnn |