ArmNN
 22.05
ClAbsWorkload.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 "ClAbsWorkload.hpp"
7 
8 #include "ClWorkloadUtils.hpp"
9 
11 
13 
14 #include <cl/ClTensorHandle.hpp>
15 
16 namespace armnn
17 {
18 
20 {
21  const arm_compute::TensorInfo aclInput = armcomputetensorutils::BuildArmComputeTensorInfo(input);
22  const arm_compute::TensorInfo aclOutput = armcomputetensorutils::BuildArmComputeTensorInfo(output);
23 
24  return arm_compute::CLAbsLayer::validate(&aclInput, &aclOutput);
25 }
26 
28  const WorkloadInfo& info,
29  const arm_compute::CLCompileContext& clCompileContext)
30  : ClBaseWorkload<AbsQueueDescriptor>(descriptor, info)
31 {
32  m_Data.ValidateInputsOutputs("ClAbsWorkload", 1, 1);
33 
34  arm_compute::ICLTensor& input = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
35  arm_compute::ICLTensor& output = PolymorphicDowncast<ClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
36  {
37  ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClAbsWorkload_configure");
38  m_AbsLayer.configure(clCompileContext, &input, &output);
39  }
40 }
41 
43 {
44  ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClAbsWorkload_Execute", this->GetGuid());
45  RunClFunction(m_AbsLayer, CHECK_LOCATION());
46 }
47 
48 } // namespace armnn
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
arm::pipe::ProfilingGuid GetGuid() const final
Definition: Workload.hpp:59
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
virtual void Execute() const override
Status
enumeration
Definition: Types.hpp:42
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
ClAbsWorkload(const AbsQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
std::vector< ITensorHandle * > m_Outputs
arm_compute::Status ClAbsWorkloadValidate(const TensorInfo &input, const TensorInfo &output)
Contains information about TensorInfos of a layer.
std::vector< ITensorHandle * > m_Inputs