diff options
Diffstat (limited to 'include/armnnUtils/FloatingPointConverter.hpp')
-rw-r--r-- | include/armnnUtils/FloatingPointConverter.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
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 <cstddef> + +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 |