aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/Utils.h
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2019-08-22 11:44:04 +0100
committerMichalis Spyrou <michalis.spyrou@arm.com>2019-08-22 15:28:03 +0000
commitc8530210c17b391f27ace95523e9590e8166fcd8 (patch)
tree7ab0ea38b730a194aba2da91440a991a7614be8f /arm_compute/core/Utils.h
parent57a896172ff77c13655b1dc5acc9cfb2930e0570 (diff)
downloadComputeLibrary-c8530210c17b391f27ace95523e9590e8166fcd8.tar.gz
COMPMID-2417: Add new QASYMM8_PER_CHANNEL data type
Change-Id: I6825320909a553513b98cf9b262fc90e37a2fa30 Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/1790 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/core/Utils.h')
-rw-r--r--arm_compute/core/Utils.h21
1 files changed, 21 insertions, 0 deletions
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