ArmNN
 25.11
Loading...
Searching...
No Matches
ClReshapeWorkload.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
9
10#include "ClWorkloadUtils.hpp"
11
12namespace armnn
13{
14
15arm_compute::Status ClReshapeWorkloadValidate(const TensorInfo& input,
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)
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_CL_NAME_GUID("ClReshapeWorkload_configure");
36 m_Layer.configure(clCompileContext, &input, &output);
37 }
38}
39
41{
42 ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClReshapeWorkload_Execute");
43 RunClFunction(m_Layer, CHECK_LOCATION());
44}
45
46} //namespace armnn
#define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
#define CHECK_LOCATION()
ClBaseWorkload(const ReshapeQueueDescriptor &descriptor, const WorkloadInfo &info)
ClReshapeWorkload(const ReshapeQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
void Execute() const override
virtual arm_compute::ICLTensor & GetTensor()=0
Copyright (c) 2021 ARM Limited and Contributors.
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
arm_compute::Status ClReshapeWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
Contains information about TensorInfos of a layer.