From 20e984f442483493ece882c3040785368eb31c96 Mon Sep 17 00:00:00 2001 From: ruoyan01 Date: Wed, 12 Dec 2018 18:11:25 +0000 Subject: IVGCVSW-2348 Support boolean data type Change-Id: Ifd28e049192e6f5fe5c0f5d358afb2b530eef882 --- include/armnn/Types.hpp | 5 +++-- include/armnn/TypesUtils.hpp | 15 +++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp index d815005f5b..baf74437dc 100644 --- a/include/armnn/Types.hpp +++ b/include/armnn/Types.hpp @@ -26,9 +26,10 @@ enum class Status enum class DataType { Float16 = 0, - Float32 = 1, + Float32 = 1, QuantisedAsymm8 = 2, - Signed32 = 3 + Signed32 = 3, + Boolean = 4 }; enum class DataLayout diff --git a/include/armnn/TypesUtils.hpp b/include/armnn/TypesUtils.hpp index 68ad45546d..7eacc00a93 100644 --- a/include/armnn/TypesUtils.hpp +++ b/include/armnn/TypesUtils.hpp @@ -79,11 +79,12 @@ constexpr unsigned int GetDataTypeSize(DataType dataType) { switch (dataType) { - case DataType::Float16: return 2U; + case DataType::Float16: return 2U; case DataType::Float32: - case DataType::Signed32: return 4U; - case DataType::QuantisedAsymm8: return 1U; - default: return 0U; + case DataType::Signed32: return 4U; + case DataType::QuantisedAsymm8: return 1U; + case DataType::Boolean: return 1U; + default: return 0U; } } @@ -167,6 +168,12 @@ struct GetDataTypeImpl static constexpr DataType Value = DataType::Signed32; }; +template<> +struct GetDataTypeImpl +{ + static constexpr DataType Value = DataType::Boolean; +}; + template constexpr DataType GetDataType() { -- cgit v1.2.1