From fb14ebbd68e04876809145296af96f6f41857418 Mon Sep 17 00:00:00 2001 From: James Ward Date: Thu, 26 Nov 2020 11:08:12 +0000 Subject: IVGCVSW-5348 Update Doxygen Docu * Update Doxygen Documentation for 20.11 release Signed-off-by: James Ward Change-Id: Ib47edac7923a642a277b1169d1085e5622021dc0 --- ...onvert_fp32_to_bf16_test_impl_8cpp_source.xhtml | 132 +++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 20.11/_convert_fp32_to_bf16_test_impl_8cpp_source.xhtml (limited to '20.11/_convert_fp32_to_bf16_test_impl_8cpp_source.xhtml') diff --git a/20.11/_convert_fp32_to_bf16_test_impl_8cpp_source.xhtml b/20.11/_convert_fp32_to_bf16_test_impl_8cpp_source.xhtml new file mode 100644 index 0000000000..368d0a4091 --- /dev/null +++ b/20.11/_convert_fp32_to_bf16_test_impl_8cpp_source.xhtml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + +ArmNN: src/backends/backendsCommon/test/layerTests/ConvertFp32ToBf16TestImpl.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.11 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ConvertFp32ToBf16TestImpl.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
10 
11 #include <test/TensorHelpers.hpp>
12 
14  armnn::IWorkloadFactory& workloadFactory,
16  const armnn::ITensorHandleFactory& tensorHandleFactory)
17 {
18  IgnoreUnused(memoryManager);
19 
20  const armnn::TensorInfo inputTensorInfo({1, 2, 4, 3}, armnn::DataType::Float32);
21  const armnn::TensorInfo outputTensorInfo({1, 2, 4, 3}, armnn::DataType::BFloat16);
22 
23  auto input = MakeTensor<float, 4>(inputTensorInfo,
24  { -37.5f, -15.2f, -8.76f,
25  -2.0f, -1.5f, -1.3f,
26  -0.5f, -0.4f, 0.0f,
27  1.0f, 0.4f, 0.5f,
28  1.3f, 1.5f, 2.0f,
29  8.76f, 15.2f, 37.5f,
30  3.8f, // 0x40733333 Round down
31  3.1055E+29f, // 0x707ADC3C Round up
32  9.149516E-10f, // 0x307B7FFF Round down
33  -3.8f, // 0xC0733333 Round down
34  -3.1055E+29f, // 0xF07ADC3C Round up
35  -9.149516E-10f // 0xB07B7FFF Round down
36  });
37 
38  std::vector<armnn::BFloat16> outputValues = armnnUtils::QuantizedVector<armnn::BFloat16>(
39  {
40  -37.5f, -15.2f, -8.76f,
41  -2.0f, -1.5f, -1.3f,
42  -0.5f, -0.4f, 0.0f,
43  1.0f, 0.4f, 0.5f,
44  1.3f, 1.5f, 2.0f,
45  8.76f, 15.2f, 37.5f,
46  3.796875f, // 0x4073
47  3.1072295E29f, // 0x707B
48  9.131327E-10f, // 0x307B
49  -3.796875f, // 0xC073
50  -3.1072295E29f, // 0xF07B
51  -9.131327E-10f // 0xB07B
52  },
53  1.0f, 0);
54 
55  LayerTestResult<armnn::BFloat16, 4> ret(outputTensorInfo);
56  ret.outputExpected = MakeTensor<armnn::BFloat16, 4>(outputTensorInfo, outputValues);
57 
58  std::unique_ptr<armnn::ITensorHandle> inputHandle = tensorHandleFactory.CreateTensorHandle(inputTensorInfo);
59  std::unique_ptr<armnn::ITensorHandle> outputHandle = tensorHandleFactory.CreateTensorHandle(outputTensorInfo);
60 
63  AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());
64  AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());
65 
66  std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateConvertFp32ToBf16(data, info);
67 
68  inputHandle->Allocate();
69  outputHandle->Allocate();
70 
71  CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]);
72 
73  workload->Execute();
74 
75  CopyDataFromITensorHandle(&ret.output[0][0][0][0], outputHandle.get());
76 
77  return ret;
78 }
+ + + +
void IgnoreUnused(Ts &&...)
+
virtual std::unique_ptr< IWorkload > CreateConvertFp32ToBf16(const ConvertFp32ToBf16QueueDescriptor &descriptor, const WorkloadInfo &info) const
+ +
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
+ +
void CopyDataFromITensorHandle(void *memory, const armnn::ITensorHandle *tensorHandle)
+ +
LayerTestResult< armnn::BFloat16, 4 > ConvertFp32ToBf16Test(armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
+ + + +
Contains information about inputs and outputs to a layer.
+ +
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const =0
+
void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)
+
+
+ + + + -- cgit v1.2.1