aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/Utils.h
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2019-06-18 10:23:22 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-06-25 09:37:00 +0000
commit6997fc951e48a1bf8f7591f3b2c4c8d721331b96 (patch)
tree1cc2b28f5b2a5dbb8d7eb32755df4e8f28a1901d /arm_compute/core/Utils.h
parent944170e1591ff23c9e6ede2201f0f6aba0f3439b (diff)
downloadComputeLibrary-6997fc951e48a1bf8f7591f3b2c4c8d721331b96.tar.gz
COMPMID-2412: Add QSYMM16 support for ElementwiseAddition for CL
Arithmetic addition uses the same code as other element-wise operations. Hence, adding QSYMM16 support for addition automatically adds the same support for: - arithmetic subtraction - element-wise min - element-wise max - squared difference Change-Id: If986102844f62e29dd23c03f9245910db43f9043 Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-on: https://review.mlplatform.org/c/1384 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Manuel Bottini <manuel.bottini@arm.com> Reviewed-by: Giuseppe Rossini <giuseppe.rossini@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, 20 insertions, 1 deletions
diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h
index b711451453..a37559d269 100644
--- a/arm_compute/core/Utils.h
+++ b/arm_compute/core/Utils.h
@@ -1022,7 +1022,7 @@ inline bool is_data_type_quantized(DataType dt)
*
* @param[in] dt Input data type.
*
- * @return True if data type is of symmetric quantized type, else false.
+ * @return True if data type is of asymmetric quantized type, else false.
*/
inline bool is_data_type_quantized_asymmetric(DataType dt)
{
@@ -1035,6 +1035,25 @@ inline bool is_data_type_quantized_asymmetric(DataType dt)
}
}
+/** Check if a given data type is of symmetric quantized type
+ *
+ * @param[in] dt Input data type.
+ *
+ * @return True if data type is of symmetric quantized type, else false.
+ */
+inline bool is_data_type_quantized_symmetric(DataType dt)
+{
+ switch(dt)
+ {
+ case DataType::QSYMM8:
+ case DataType::QSYMM8_PER_CHANNEL:
+ case DataType::QSYMM16:
+ return true;
+ default:
+ return false;
+ }
+}
+
/** Create a string with the float in full precision.
*
* @param val Floating point value