ArmNN
 24.02
RefConvertFp16ToFp32Workload.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2019,2021-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include "RefWorkloadUtils.hpp"
8 
10 
11 #include <Half.hpp>
12 
13 namespace armnn
14 {
15 
17 {
19 }
20 
22 {
23  WorkingMemDescriptor* workingMemDescriptor = static_cast<WorkingMemDescriptor*>(executionData.m_Data);
24  Execute(workingMemDescriptor->m_Inputs, workingMemDescriptor->m_Outputs);
25 }
26 
27 void RefConvertFp16ToFp32Workload::Execute(std::vector<ITensorHandle*> inputs,
28  std::vector<ITensorHandle*> outputs) const
29 {
30  ARMNN_SCOPED_PROFILING_EVENT_REF_NAME_GUID("RefConvertFp16ToFp32Workload_Execute");
31 
32  const Half* const input = reinterpret_cast<const Half*>(inputs[0]->Map());
33  float* const output = reinterpret_cast<float*>(outputs[0]->Map());
34 
35  unsigned int numElements = GetTensorInfo(inputs[0]).GetNumElements();
37 }
38 
39 } //namespace armnn
armnn::TensorInfo::GetNumElements
unsigned int GetNumElements() const
Definition: Tensor.hpp:198
armnn::experimental::ExecutionData::m_Data
void * m_Data
Definition: ExecutionData.hpp:16
armnn::RefConvertFp16ToFp32Workload::Execute
void Execute() const override
Definition: RefConvertFp16ToFp32Workload.cpp:16
RefConvertFp16ToFp32Workload.hpp
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::Half
half_float::half Half
Definition: Half.hpp:22
armnnUtils::FloatingPointConverter::ConvertFloat16To32
static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer)
Definition: FloatingPointConverter.cpp:43
armnn::GetTensorInfo
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
Definition: RefWorkloadUtils.hpp:33
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
Half.hpp
RefWorkloadUtils.hpp
armnn::BaseWorkload::m_Data
QueueDescriptor m_Data
Definition: Workload.hpp:89
FloatingPointConverter.hpp
armnn::RefConvertFp16ToFp32Workload::ExecuteAsync
void ExecuteAsync(ExecutionData &executionData) override
Definition: RefConvertFp16ToFp32Workload.cpp:21
armnn::experimental::WorkingMemDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkingMemDescriptor.hpp:20
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::experimental::WorkingMemDescriptor
Definition: WorkingMemDescriptor.hpp:18
armnn::experimental::WorkingMemDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkingMemDescriptor.hpp:21
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26
armnn::experimental::ExecutionData
Definition: ExecutionData.hpp:14