ArmNN
 22.05.01
ClReshapeWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "ClReshapeWorkload.hpp"
7 #include <cl/ClTensorHandle.hpp>
9 
10 #include "ClWorkloadUtils.hpp"
11 
12 namespace armnn
13 {
14 
16  const TensorInfo& output)
17 {
18  const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input);
19  const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output);
20 
21  return arm_compute::CLReshapeLayer::validate(&aclInputInfo, &aclOutputInfo);
22 }
23 
25  const WorkloadInfo& info,
26  const arm_compute::CLCompileContext& clCompileContext)
27  : ClBaseWorkload<ReshapeQueueDescriptor>(descriptor, info)
28 {
29  m_Data.ValidateInputsOutputs("ClReshapeWorkload", 1, 1);
30 
31  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
32  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
33 
34  {
35  ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClReshapeWorkload_configure");
36  m_Layer.configure(clCompileContext, &input, &output);
37  }
38 }
39 
41 {
42  ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClReshapeWorkload_Execute", this->GetGuid());
43  RunClFunction(m_Layer, CHECK_LOCATION());
44 }
45 
46 } //namespace armnn
void Execute() const override
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
ClReshapeWorkload(const ReshapeQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
arm::pipe::ProfilingGuid GetGuid() const final
Definition: Workload.hpp:59
arm_compute::Status ClReshapeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Copyright (c) 2021 ARM Limited and Contributors.
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
Status
enumeration
Definition: Types.hpp:42
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
std::vector< ITensorHandle * > m_Outputs
Contains information about TensorInfos of a layer.
std::vector< ITensorHandle * > m_Inputs