ArmNN
 24.02
NeonReshapeWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include "NeonWorkloadUtils.hpp"
9 
11 
12 #include <arm_compute/runtime/NEON/functions/NEReshapeLayer.h>
13 
14 namespace armnn
15 {
16 
18  const TensorInfo& output)
19 {
20  const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input);
21  const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output);
22 
23  return arm_compute::NEReshapeLayer::validate(&aclInputInfo, &aclOutputInfo);
24 }
25 
27  const WorkloadInfo& info)
29 {
30  m_Data.ValidateInputsOutputs("NeonReshapeWorkload", 1, 1);
31 
32  arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
33  arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
34 
35  auto layer = std::make_unique<arm_compute::NEReshapeLayer>();
36  layer->configure(&input, &output);
37  m_Layer.reset(layer.release());
38 }
39 
41 {
42  ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID("NeonReshapeWorkload_Execute");
43  m_Layer->run();
44 }
45 
46 } //namespace armnn
armnn::NeonReshapeWorkload::NeonReshapeWorkload
NeonReshapeWorkload(const ReshapeQueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: NeonReshapeWorkload.cpp:26
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:446
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::NeonReshapeWorkload::Execute
virtual void Execute() const override
Definition: NeonReshapeWorkload.cpp:40
NeonReshapeWorkload.hpp
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
PolymorphicDowncast.hpp
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::ReshapeQueueDescriptor
Definition: WorkloadData.hpp:380
armnn::Status
Status
Definition: Types.hpp:42
armnn::BaseWorkload< ReshapeQueueDescriptor >::m_Data
ReshapeQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::NeonReshapeWorkloadValidate
arm_compute::Status NeonReshapeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
Definition: NeonReshapeWorkload.cpp:17
NeonWorkloadUtils.hpp
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: NeonWorkloadUtils.hpp:32
armnn::NeonBaseWorkload
Definition: NeonBaseWorkload.hpp:13
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26