ArmNN
 24.08
CompatibleTypes.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019-2021, 2024 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include <armnn/Types.hpp>
7 
8 #include "BFloat16.hpp"
9 #include "Half.hpp"
10 
11 using namespace armnn;
12 
13 namespace armnnUtils
14 {
15 
16 template<typename T>
18 {
19  return false;
20 }
21 
22 template<>
24 {
25  return dataType == DataType::Float32;
26 }
27 
28 template<>
30 {
31  return dataType == DataType::Float16;
32 }
33 
34 template<>
36 {
37  return dataType == DataType::BFloat16;
38 }
39 
40 template<>
42 {
43  return dataType == DataType::Boolean || dataType == DataType::QAsymmU8;
44 }
45 
46 template<>
48 {
49  return dataType == DataType::QSymmS8
50  || dataType == DataType::QAsymmS8;
51 }
52 
53 template<>
55 {
56  return dataType == DataType::QSymmS16;
57 }
58 
59 template<>
61 {
62  return dataType == DataType::Signed32;
63 }
64 
65 template<>
67 {
68  return dataType == DataType::Signed64;
69 }
70 
71 } //namespace armnnUtils
armnnUtils::CompatibleTypes< int16_t >
bool CompatibleTypes< int16_t >(DataType dataType)
Definition: CompatibleTypes.cpp:54
armnn::DataType::Boolean
@ Boolean
armnnUtils::CompatibleTypes< int8_t >
bool CompatibleTypes< int8_t >(DataType dataType)
Definition: CompatibleTypes.cpp:47
armnnUtils::CompatibleTypes< uint8_t >
bool CompatibleTypes< uint8_t >(DataType dataType)
Definition: CompatibleTypes.cpp:41
armnnUtils::CompatibleTypes
bool CompatibleTypes(armnn::DataType)
Definition: CompatibleTypes.cpp:17
armnnUtils::CompatibleTypes< Half >
bool CompatibleTypes< Half >(DataType dataType)
Definition: CompatibleTypes.cpp:29
armnn::DataType::Float32
@ Float32
armnn::DataType::QAsymmU8
@ QAsymmU8
armnn::DataType::QSymmS8
@ QSymmS8
armnnUtils::CompatibleTypes< int64_t >
bool CompatibleTypes< int64_t >(DataType dataType)
Definition: CompatibleTypes.cpp:66
armnn::DataType::QSymmS16
@ QSymmS16
armnn::DataType::BFloat16
@ BFloat16
armnn::DataType::Float16
@ Float16
armnnUtils::CompatibleTypes< float >
bool CompatibleTypes< float >(DataType dataType)
Definition: CompatibleTypes.cpp:23
armnn::DataType
DataType
Definition: Types.hpp:48
CompatibleTypes.hpp
armnnUtils
Definition: CompatibleTypes.hpp:10
armnn::DataType::Signed32
@ Signed32
armnn::DataType::QAsymmS8
@ QAsymmS8
armnnUtils::CompatibleTypes< BFloat16 >
bool CompatibleTypes< BFloat16 >(DataType dataType)
Definition: CompatibleTypes.cpp:35
Half.hpp
armnnUtils::CompatibleTypes< int32_t >
bool CompatibleTypes< int32_t >(DataType dataType)
Definition: CompatibleTypes.cpp:60
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
Types.hpp
BFloat16.hpp
armnn::DataType::Signed64
@ Signed64