blob: 40fbef652071da444a016555c593e998b1e7aef6 [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
23 arm_compute::ITensor& input = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
24 arm_compute::ITensor& output = boost::polymorphic_downcast<INeonTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
25
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