aboutsummaryrefslogtreecommitdiff
path: root/include/armnnUtils/FloatingPointConverter.hpp
blob: cf573a2ee8284b70f9c603c027a15f511eab42b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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