aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/CompatibleTypes.hpp
blob: 4e31aed2aa255a61e6189b4e007655198d2e418d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#pragma once

#include "armnn/Types.hpp"
#include "Half.hpp"

namespace armnn
{

template<typename T>
bool CompatibleTypes(DataType dataType)
{
    return false;
}

template<>
inline bool CompatibleTypes<float>(DataType dataType)
{
    return dataType == DataType::Float32;
}

template<>
inline bool CompatibleTypes<Half>(DataType dataType)
{
    return dataType == DataType::Float16;
}

template<>
inline bool CompatibleTypes<uint8_t>(DataType dataType)
{
    return dataType == DataType::Boolean || dataType == DataType::QuantisedAsymm8;
}

template<>
inline bool CompatibleTypes<int16_t>(DataType dataType)
{
    return dataType == DataType::QuantisedSymm16;
}

template<>
inline bool CompatibleTypes<int32_t>(DataType dataType)
{
    return dataType == DataType::Signed32;
}

} //namespace armnn