telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <cstddef> |
| 9 | |
| 10 | namespace armnnUtils |
| 11 | { |
| 12 | class FloatingPointConverter |
| 13 | { |
| 14 | public: |
| 15 | // Converts a buffer of FP32 values to FP16, and stores in the given dstFloat16Buffer. |
| 16 | // dstFloat16Buffer should be (numElements * 2) in size |
| 17 | static void ConvertFloat32To16(const float *srcFloat32Buffer, size_t numElements, void *dstFloat16Buffer); |
| 18 | |
| 19 | static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer); |
| 20 | }; |
| 21 | } //namespace armnnUtils |