ArmNN
 24.08
RefConstantWorkload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include "RefWorkloadUtils.hpp"
9 
10 #include <armnn/Types.hpp>
11 
12 #include <armnn/utility/Assert.hpp>
13 
14 #include <cstring>
15 
16 namespace armnn
17 {
18 
20  const ConstantQueueDescriptor& descriptor, const WorkloadInfo& info)
22 
24 {
26 }
27 
29 {
30  WorkingMemDescriptor* workingMemDescriptor = static_cast<WorkingMemDescriptor*>(executionData.m_Data);
31  Execute(workingMemDescriptor->m_Outputs);
32 }
33 
34 void RefConstantWorkload::Execute(std::vector<ITensorHandle*> outputs) const
35 {
36  ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID("RefConstantWorkload_Execute");
37  memcpy(outputs[0]->Map(), m_Data.m_LayerOutput->GetConstTensor<void>(), GetTensorInfo(outputs[0]).GetNumBytes());
38 }
39 
40 } //namespace armnn
armnn::experimental::ExecutionData::m_Data
void * m_Data
Definition: ExecutionData.hpp:16
RefConstantWorkload.hpp
armnn::RefConstantWorkload::ExecuteAsync
void ExecuteAsync(ExecutionData &executionData) override
Definition: RefConstantWorkload.cpp:28
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::ConstantQueueDescriptor
Definition: WorkloadData.hpp:368
Assert.hpp
armnn::ConstTensorHandle::GetConstTensor
const T * GetConstTensor() const
Definition: TensorHandle.hpp:28
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
armnn::GetTensorInfo
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
Definition: RefWorkloadUtils.hpp:33
armnn::RefConstantWorkload::Execute
void Execute() const override
Definition: RefConstantWorkload.cpp:23
armnn::RefConstantWorkload::RefConstantWorkload
RefConstantWorkload(const ConstantQueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: RefConstantWorkload.cpp:19
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::ConstantQueueDescriptor::m_LayerOutput
const ConstTensorHandle * m_LayerOutput
Definition: WorkloadData.hpp:375
RefWorkloadUtils.hpp
armnn::BaseWorkload< ConstantQueueDescriptor >::m_Data
ConstantQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn::LayerType::Map
@ Map
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
Types.hpp
armnn::experimental::WorkingMemDescriptor
Definition: WorkingMemDescriptor.hpp:18
armnn::RefBaseWorkload
Definition: RefBaseWorkload.hpp:13
armnn::experimental::WorkingMemDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkingMemDescriptor.hpp:21
armnn::experimental::ExecutionData
Definition: ExecutionData.hpp:14