From c8530210c17b391f27ace95523e9590e8166fcd8 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 22 Aug 2019 11:44:04 +0100 Subject: COMPMID-2417: Add new QASYMM8_PER_CHANNEL data type Change-Id: I6825320909a553513b98cf9b262fc90e37a2fa30 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/1790 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- arm_compute/core/Utils.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'arm_compute/core/Utils.h') diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index bc461e7ba9..eb4cf05ae9 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -115,6 +115,7 @@ inline size_t data_size_from_type(DataType data_type) case DataType::QSYMM8: case DataType::QASYMM8: case DataType::QSYMM8_PER_CHANNEL: + case DataType::QASYMM8_PER_CHANNEL: return 1; case DataType::U16: case DataType::S16: @@ -1014,6 +1015,7 @@ inline bool is_data_type_quantized(DataType dt) case DataType::QSYMM8: case DataType::QASYMM8: case DataType::QSYMM8_PER_CHANNEL: + case DataType::QASYMM8_PER_CHANNEL: case DataType::QSYMM16: return true; default: @@ -1032,6 +1034,7 @@ inline bool is_data_type_quantized_asymmetric(DataType dt) switch(dt) { case DataType::QASYMM8: + case DataType::QASYMM8_PER_CHANNEL: return true; default: return false; @@ -1057,6 +1060,24 @@ inline bool is_data_type_quantized_symmetric(DataType dt) } } +/** Check if a given data type is of per channel type + * + * @param[in] dt Input data type. + * + * @return True if data type is of per channel type, else false. + */ +inline bool is_data_type_quantized_per_channel(DataType dt) +{ + switch(dt) + { + case DataType::QSYMM8_PER_CHANNEL: + case DataType::QASYMM8_PER_CHANNEL: + return true; + default: + return false; + } +} + /** Create a string with the float in full precision. * * @param val Floating point value -- cgit v1.2.1