ArmNN
 24.08
RefFillWorkload.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 "RefFillWorkload.hpp"
7 #include "Fill.hpp"
8 
9 #include "Decoders.hpp"
10 #include "Encoders.hpp"
11 #include "RefWorkloadUtils.hpp"
12 #include "Profiling.hpp"
13 
14 namespace armnn
15 {
16 
18 {
20 }
21 
23 {
24  WorkingMemDescriptor* workingMemDescriptor = static_cast<WorkingMemDescriptor*>(executionData.m_Data);
25  Execute(workingMemDescriptor->m_Outputs);
26 }
27 
28 void RefFillWorkload::Execute(std::vector<ITensorHandle*> outputs) const
29 {
30  ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID("RefFillWorkload_Execute");
31 
32  const TensorInfo &outputTensorInfo = GetTensorInfo(outputs[0]);
33 
34  std::unique_ptr<Encoder<float>> encoderPtr = MakeEncoder<float>(outputTensorInfo, outputs[0]->Map());
35  Encoder<float> &encoder = *encoderPtr;
36 
37  Fill(encoder, outputTensorInfo.GetShape(), m_Data.m_Parameters.m_Value);
38 }
39 
40 } //namespace armnn
armnn::experimental::ExecutionData::m_Data
void * m_Data
Definition: ExecutionData.hpp:16
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::RefFillWorkload::ExecuteAsync
void ExecuteAsync(ExecutionData &executionData) override
Definition: RefFillWorkload.cpp:22
Profiling.hpp
armnn::RefFillWorkload::Execute
void Execute() const override
Definition: RefFillWorkload.cpp:17
ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID
#define ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
Definition: RefWorkloadUtils.hpp:22
armnn::FillDescriptor::m_Value
float m_Value
Definition: Descriptors.hpp:940
armnn::Fill
void Fill(Encoder< float > &output, const TensorShape &desiredOutputShape, const float value)
Creates a tensor and fills it with a scalar value.
Definition: Fill.cpp:13
armnn::Encoder< float >
armnn::QueueDescriptorWithParameters::m_Parameters
LayerDescriptor m_Parameters
Definition: WorkloadData.hpp:66
RefFillWorkload.hpp
armnn::GetTensorInfo
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
Definition: RefWorkloadUtils.hpp:33
Fill.hpp
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
RefWorkloadUtils.hpp
armnn::BaseWorkload< FillQueueDescriptor >::m_Data
FillQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::TensorInfo::GetShape
const TensorShape & GetShape() const
Definition: Tensor.hpp:193
Decoders.hpp
armnn::LayerType::Map
@ Map
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::experimental::WorkingMemDescriptor
Definition: WorkingMemDescriptor.hpp:18
Encoders.hpp
armnn::experimental::WorkingMemDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkingMemDescriptor.hpp:21
armnn::experimental::ExecutionData
Definition: ExecutionData.hpp:14