aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/CompatibleTypes.hpp
diff options
context:
space:
mode:
authorNattapat Chaimanowong <nattapat.chaimanowong@arm.com>2019-01-22 16:10:44 +0000
committerNattapat Chaimanowong <nattapat.chaimanowong@arm.com>2019-01-22 16:10:44 +0000
commit649dd9515ddf4bd00a0bff64d51dfd835a6c7b39 (patch)
treec938bc8eb11dd24223c0cb00a57d4372a907b943 /src/armnn/CompatibleTypes.hpp
parent382e21ce95c04479a6900afca81a57949b369f1e (diff)
downloadarmnn-649dd9515ddf4bd00a0bff64d51dfd835a6c7b39.tar.gz
IVGCVSW-2467 Remove GetDataType<T> function
Change-Id: I7359617a307b9abb4c30b3d5f2364dc6d0f828f0
Diffstat (limited to 'src/armnn/CompatibleTypes.hpp')
-rw-r--r--src/armnn/CompatibleTypes.hpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/armnn/CompatibleTypes.hpp b/src/armnn/CompatibleTypes.hpp
new file mode 100644
index 0000000000..2449876544
--- /dev/null
+++ b/src/armnn/CompatibleTypes.hpp
@@ -0,0 +1,44 @@
+//
+// 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<int32_t>(DataType dataType)
+{
+ return dataType == DataType::Signed32;
+}
+
+} //namespace armnn