• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "armnn/Types.hpp"
9 #include "BFloat16.hpp"
10 #include "Half.hpp"
11 
12 namespace armnn
13 {
14 
15 template<DataType DT>
16 struct ResolveTypeImpl;
17 
18 template <>
19 struct ResolveTypeImpl<DataType::Float16>
20 {
21     using Type = Half;
22 };
23 
24 template<>
25 struct ResolveTypeImpl<DataType::Float32>
26 {
27     using Type = float;
28 };
29 
30 template<>
31 struct ResolveTypeImpl<DataType::QAsymmU8>
32 {
33     using Type = uint8_t;
34 };
35 
36 template<>
37 struct ResolveTypeImpl<DataType::QAsymmS8>
38 {
39     using Type = int8_t;
40 };
41 
42 template<>
43 struct ResolveTypeImpl<DataType::QSymmS8>
44 {
45     using Type = int8_t;
46 };
47 
48 template<>
49 struct ResolveTypeImpl<DataType::QSymmS16>
50 {
51     using Type = int16_t;
52 };
53 
54 template<>
55 struct ResolveTypeImpl<DataType::Signed32>
56 {
57     using Type = int32_t;
58 };
59 
60 template<>
61 struct ResolveTypeImpl<DataType::Signed64>
62 {
63     using Type = int64_t;
64 };
65 
66 template<>
67 struct ResolveTypeImpl<DataType::Boolean>
68 {
69     using Type = uint8_t;
70 };
71 
72 template<>
73 struct ResolveTypeImpl<DataType::BFloat16>
74 {
75     using Type = BFloat16;
76 };
77 
78 template<DataType DT>
79 using ResolveType = typename ResolveTypeImpl<DT>::Type;
80 
81 } //namespace armnn
82