blob: cf573a2ee8284b70f9c603c027a15f511eab42b4 [file] [log] [blame]
telsoa01c577f2c2018-08-31 09:22:23 +01001//
Matteo Martincighe011d202019-11-28 11:35:47 +00002// Copyright © 2019 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa01c577f2c2018-08-31 09:22:23 +01004//
5
6#pragma once
7
8#include <cstddef>
9
10namespace armnnUtils
11{
Matteo Martincighe011d202019-11-28 11:35:47 +000012
telsoa01c577f2c2018-08-31 09:22:23 +010013class FloatingPointConverter
14{
15public:
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};
Matteo Martincighe011d202019-11-28 11:35:47 +000022
23} // namespace armnnUtils