From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- ...quantization_float32_workload_8cpp_source.xhtml | 131 +++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 21.02/_ref_fake_quantization_float32_workload_8cpp_source.xhtml (limited to '21.02/_ref_fake_quantization_float32_workload_8cpp_source.xhtml') diff --git a/21.02/_ref_fake_quantization_float32_workload_8cpp_source.xhtml b/21.02/_ref_fake_quantization_float32_workload_8cpp_source.xhtml new file mode 100644 index 0000000000..2f18f96437 --- /dev/null +++ b/21.02/_ref_fake_quantization_float32_workload_8cpp_source.xhtml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + +ArmNN: src/backends/reference/workloads/RefFakeQuantizationFloat32Workload.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
RefFakeQuantizationFloat32Workload.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include "RefWorkloadUtils.hpp"
9 
10 #include "Profiling.hpp"
11 
13 
14 namespace armnn
15 {
16 
17 void FakeQuantization(const float* inputData, float* outputData, uint32_t numElements, float min, float max)
18 {
19  float scale = (max - min) / 255.f;
20  int32_t offset = armnn::numeric_cast<int32_t>((-min * 255.f) / (max - min));
21 
22  for (uint32_t i = 0; i < numElements; i++)
23  {
24  outputData[i] = static_cast<float>(armnn::Quantize<uint8_t>(inputData[i], scale, offset));
25  }
26 
27 }
28 
30 {
31  ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefFakeQuantizationFloat32Workload_Execute");
32 
33  const TensorInfo& inputInfo = GetTensorInfo(m_Data.m_Inputs[0]);
34 
35  const float* inputData = GetInputTensorDataFloat(0, m_Data);
36  float* outputData = GetOutputTensorDataFloat(0, m_Data);
37  FakeQuantization(inputData, outputData, inputInfo.GetNumElements(),
38  m_Data.m_Parameters.m_Min,
39  m_Data.m_Parameters.m_Max);
40 }
41 
42 } //namespace armnn
const float * GetInputTensorDataFloat(unsigned int idx, const PayloadType &data)
+
CPU Execution: Reference C++ kernels.
+ + + +
const QueueDescriptor m_Data
Definition: Workload.hpp:46
+
Copyright (c) 2021 ARM Limited and Contributors.
+
void FakeQuantization(const float *inputData, float *outputData, uint32_t numElements, float min, float max)
+
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:173
+ +
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:35
+ +
std::vector< ITensorHandle * > m_Inputs
+
float * GetOutputTensorDataFloat(unsigned int idx, const PayloadType &data)
+
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
+ + +
unsigned int GetNumElements() const
Definition: Tensor.hpp:192
+
+
+ + + + -- cgit v1.2.1