aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils/quantization/AsymmHelpers.h
diff options
context:
space:
mode:
authorSang-Hoon Park <sang-hoon.park@arm.com>2020-03-13 14:56:05 +0000
committerSang-Hoon Park <sang-hoon.park@arm.com>2020-04-07 09:00:09 +0000
commit0d008f77b0085619c446d0ab5dc1228a80776706 (patch)
treee1f6e91bf8da63e8ef98e11ab8eb6a6972a284f2 /arm_compute/core/utils/quantization/AsymmHelpers.h
parent4df2cf3177129d10500d30056bf8404418f703d6 (diff)
downloadComputeLibrary-0d008f77b0085619c446d0ab5dc1228a80776706.tar.gz
COMPMID-3281: Implement QSYMM16 Layer Normalization for NEON QLSTM
- Reference kernel is modified to use the same algorithm as NEON kernel. - NEON kernel is implemented. - Tests for validation and run are added. Change-Id: I3533bc2bd12c6e9cc75d837ecf193f74ceddf796 Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2948 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'arm_compute/core/utils/quantization/AsymmHelpers.h')
-rw-r--r--arm_compute/core/utils/quantization/AsymmHelpers.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/arm_compute/core/utils/quantization/AsymmHelpers.h b/arm_compute/core/utils/quantization/AsymmHelpers.h
index 0f0ec72b60..a7bbf9b137 100644
--- a/arm_compute/core/utils/quantization/AsymmHelpers.h
+++ b/arm_compute/core/utils/quantization/AsymmHelpers.h
@@ -128,7 +128,7 @@ int32_t saturating_rounding_doubling_highmul(int32_t a, int32_t b);
*
* @return The multiplied value
*/
-int32_t multiply_by_quantized_multipler(int32_t input, int32_t qmul, int32_t shift);
+int32_t multiply_by_quantized_multiplier(int32_t input, int32_t qmul, int32_t shift);
/** Compute the value multiplied the power-of-two
*
@@ -137,7 +137,18 @@ int32_t multiply_by_quantized_multipler(int32_t input, int32_t qmul, int32_t shi
*
* @return The multiplied value
*/
-int32_t saturating_rounding_multiply_by_pow2(int exponent, int32_t v);
+int32_t saturating_rounding_multiply_by_pow2(int32_t exponent, int32_t v);
+
+/** Compute quantized multiplier and shift for the inverse square root of input.
+ * Using 3-bit fixed point and 5 iteration of Newton-Raphson method.
+ *
+ * @param[in] input Input to use
+ * @param[in] reverse_shift -1 to reverse the shift direction
+ * @param[out] output_inv_sqrt Quantized multiplier for inverse square root
+ * @param[out] output_shift Shift for inverse square root
+ *
+ */
+void get_invsqrt_quantized_multiplier_exp(int32_t input, int32_t reverse_shift, int32_t &output_inv_sqrt, int32_t &output_shift);
} // namespace quantization
} // namespace arm_compute