aboutsummaryrefslogtreecommitdiff
path: root/include
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 /include
parent382e21ce95c04479a6900afca81a57949b369f1e (diff)
downloadarmnn-649dd9515ddf4bd00a0bff64d51dfd835a6c7b39.tar.gz
IVGCVSW-2467 Remove GetDataType<T> function
Change-Id: I7359617a307b9abb4c30b3d5f2364dc6d0f828f0
Diffstat (limited to 'include')
-rw-r--r--include/armnn/TypesUtils.hpp46
1 files changed, 3 insertions, 43 deletions
diff --git a/include/armnn/TypesUtils.hpp b/include/armnn/TypesUtils.hpp
index 8c4ceb8d4f..3ed1dfbcb5 100644
--- a/include/armnn/TypesUtils.hpp
+++ b/include/armnn/TypesUtils.hpp
@@ -151,45 +151,6 @@ struct IsHalfType
: std::integral_constant<bool, std::is_floating_point<T>::value && sizeof(T) == 2>
{};
-template<typename T, typename U=T>
-struct GetDataTypeImpl;
-
-template<typename T>
-struct GetDataTypeImpl<T, typename std::enable_if_t<IsHalfType<T>::value, T>>
-{
- static constexpr DataType Value = DataType::Float16;
-};
-
-template<>
-struct GetDataTypeImpl<float>
-{
- static constexpr DataType Value = DataType::Float32;
-};
-
-template<>
-struct GetDataTypeImpl<uint8_t>
-{
- static constexpr DataType Value = DataType::QuantisedAsymm8;
-};
-
-template<>
-struct GetDataTypeImpl<int32_t>
-{
- static constexpr DataType Value = DataType::Signed32;
-};
-
-template<>
-struct GetDataTypeImpl<bool>
-{
- static constexpr DataType Value = DataType::Boolean;
-};
-
-template <typename T>
-constexpr DataType GetDataType()
-{
- return GetDataTypeImpl<T>::Value;
-}
-
template<typename T>
constexpr bool IsQuantizedType()
{
@@ -257,16 +218,15 @@ inline float Dequantize(QuantizedType value, float scale, int32_t offset)
return dequantized;
}
-template <typename DataType>
+template <armnn::DataType DataType>
void VerifyTensorInfoDataType(const armnn::TensorInfo & info)
{
- auto expectedType = armnn::GetDataType<DataType>();
- if (info.GetDataType() != expectedType)
+ if (info.GetDataType() != DataType)
{
std::stringstream ss;
ss << "Unexpected datatype:" << armnn::GetDataTypeName(info.GetDataType())
<< " for tensor:" << info.GetShape()
- << ". The type expected to be: " << armnn::GetDataTypeName(expectedType);
+ << ". The type expected to be: " << armnn::GetDataTypeName(DataType);
throw armnn::Exception(ss.str());
}
}