diff options
Diffstat (limited to 'src/armnnUtils/FloatingPointConverter.hpp')
-rw-r--r-- | src/armnnUtils/FloatingPointConverter.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/armnnUtils/FloatingPointConverter.hpp b/src/armnnUtils/FloatingPointConverter.hpp new file mode 100644 index 0000000000..e879c819f4 --- /dev/null +++ b/src/armnnUtils/FloatingPointConverter.hpp @@ -0,0 +1,21 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +#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 |