ArmNN
 24.08
ClFillWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "ClFillWorkload.hpp"
7 
8 #include "ClWorkloadUtils.hpp"
9 
10 #include <cl/ClTensorHandle.hpp>
12 #include <arm_compute/core/Types.h>
13 
14 namespace armnn
15 {
16 using namespace armcomputetensorutils;
17 
19  const WorkloadInfo& info,
20  const arm_compute::CLCompileContext& clCompileContext)
22 {
23  // Report Profiling Details
24  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClFillWorkload_Construct",
25  descriptor.m_Parameters,
26  info,
27  this->GetGuid());
28 
29  m_Data.ValidateInputsOutputs("ClFillWorkload", 1, 1);
30 
31  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(this->m_Data.m_Outputs[0])->GetTensor();
32  arm_compute::PixelValue pixelValue = GetPixelValue(output.info(), descriptor.m_Parameters.m_Value);
33 
34  {
35  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClFillWorkload_configure");
36  m_Layer.configure(clCompileContext, &output, pixelValue);
37  }
38 }
39 
41 {
42  ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID("ClFillWorkload_Execute");
43  RunClFunction(m_Layer, CHECK_LOCATION());
44 }
45 
46 } // namespace armnn
armnn::QueueDescriptor::ValidateInputsOutputs
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Definition: WorkloadData.cpp:447
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::ClBaseWorkload
Definition: ClBaseWorkload.hpp:13
armnn::ClFillWorkload::ClFillWorkload
ClFillWorkload(const FillQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
Definition: ClFillWorkload.cpp:18
armnn::FillDescriptor::m_Value
float m_Value
Definition: Descriptors.hpp:940
armnn::ClFillWorkload::Execute
void Execute() const override
Definition: ClFillWorkload.cpp:40
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_CL_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: ClWorkloadUtils.hpp:36
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
ClWorkloadUtils.hpp
armnn::FillQueueDescriptor
Definition: WorkloadData.hpp:174
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
ARMNN_REPORT_PROFILING_WORKLOAD_DESC
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
armnn::IClTensorHandle
Definition: IClTensorHandle.hpp:13
ClTensorHandle.hpp
armnn::BaseWorkload< FillQueueDescriptor >::m_Data
FillQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::RunClFunction
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
Definition: ClWorkloadUtils.hpp:167
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
ArmComputeTensorUtils.hpp
ClFillWorkload.hpp