blob: 7f2056c8e2bc01c506daba0782ef0e6c70ff555a [file] [log] [blame]
Nattapat Chaimanowongcce11fc2018-10-12 16:30:56 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "NeonReshapeWorkload.hpp"
7
Matthew Benthamd80a7122019-01-08 17:52:37 +00008#include "NeonWorkloadUtils.hpp"
9
10#include <arm_compute/runtime/NEON/functions/NEReshapeLayer.h>
11
12#include <boost/polymorphic_cast.hpp>
13
Nattapat Chaimanowongcce11fc2018-10-12 16:30:56 +010014namespace armnn
15{
16
17NeonReshapeWorkload::NeonReshapeWorkload(const ReshapeQueueDescriptor& descriptor,
18 const WorkloadInfo& info)
19 : BaseWorkload<ReshapeQueueDescriptor>(descriptor, info)
20{
21 m_Data.ValidateInputsOutputs("NeonReshapeWorkload", 1, 1);
22
Derek Lambertic81855f2019-06-13 17:34:19 +010023 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 Chaimanowongcce11fc2018-10-12 16:30:56 +010025
Matthew Benthamd80a7122019-01-08 17:52:37 +000026 auto layer = std::make_unique<arm_compute::NEReshapeLayer>();
27 layer->configure(&input, &output);
28 m_Layer.reset(layer.release());
Nattapat Chaimanowongcce11fc2018-10-12 16:30:56 +010029}
30
31void NeonReshapeWorkload::Execute() const
32{
33 ARMNN_SCOPED_PROFILING_EVENT_NEON("NeonReshapeWorkload_Execute");
Matthew Benthamd80a7122019-01-08 17:52:37 +000034 m_Layer->run();
Nattapat Chaimanowongcce11fc2018-10-12 16:30:56 +010035}
36
37} //namespace armnn