ArmNN  NotReleased
FloatingPointConverter.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <cstddef>
9 
10 namespace armnnUtils
11 {
12 
14 {
15 public:
16  // Converts a buffer of FP32 values to FP16, and stores in the given dstFloat16Buffer.
17  // dstFloat16Buffer should be (numElements * 2) in size
18  static void ConvertFloat32To16(const float *srcFloat32Buffer, size_t numElements, void *dstFloat16Buffer);
19 
20  static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer);
21 };
22 
23 } // namespace armnnUtils
static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer)
static void ConvertFloat32To16(const float *srcFloat32Buffer, size_t numElements, void *dstFloat16Buffer)