From e011d20f279e6e67e899bc6930b0266fc357bc1c Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Thu, 28 Nov 2019 11:35:47 +0000 Subject: IVGCVSW-4209 Create a public API for the ArmNN Utils * Moved the relevant armnnUtils headers to the new location: include/armnnUtils * Update the header usage throughout the source code !android-nn-driver:2387 Signed-off-by: Matteo Martincigh Change-Id: I2ba15cebcacafad2b5a1a7b9c3312ffc585e09d6 --- include/armnnUtils/FloatingPointConverter.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/armnnUtils/FloatingPointConverter.hpp (limited to 'include/armnnUtils/FloatingPointConverter.hpp') diff --git a/include/armnnUtils/FloatingPointConverter.hpp b/include/armnnUtils/FloatingPointConverter.hpp new file mode 100644 index 0000000000..cf573a2ee8 --- /dev/null +++ b/include/armnnUtils/FloatingPointConverter.hpp @@ -0,0 +1,23 @@ +// +// Copyright © 2019 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include + +namespace armnnUtils +{ + +class FloatingPointConverter +{ +public: + // Converts a buffer of FP32 values to FP16, and stores in the given dstFloat16Buffer. + // dstFloat16Buffer should be (numElements * 2) in size + static void ConvertFloat32To16(const float *srcFloat32Buffer, size_t numElements, void *dstFloat16Buffer); + + static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer); +}; + +} // namespace armnnUtils -- cgit v1.2.1