ArmNN
 25.11
Loading...
Searching...
No Matches
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
9
11
12#include <arm_compute/runtime/NEON/functions/NEReshapeLayer.h>
13
14namespace armnn
15{
16
17arm_compute::Status NeonReshapeWorkloadValidate(const TensorInfo& input,
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
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
NeonBaseWorkload(const ReshapeQueueDescriptor &descriptor, const WorkloadInfo &info)
NeonReshapeWorkload(const ReshapeQueueDescriptor &descriptor, const WorkloadInfo &info)
virtual void Execute() const override
Copyright (c) 2021 ARM Limited and Contributors.
arm_compute::Status NeonReshapeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
DestType PolymorphicDowncast(SourceType *value)
Polymorphic downcast for build in pointers only.
Contains information about TensorInfos of a layer.