aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/QuantizationInfo.h
diff options
context:
space:
mode:
authorPablo Marquez Tello <pablo.tello@arm.com>2023-06-08 12:00:29 +0100
committerPablo Marquez Tello <pablo.tello@arm.com>2023-06-09 09:12:38 +0000
commit9c8f9a9beca2c158429152bf8a537dfe77a88342 (patch)
treea228e53e5a34d7097632b2fab6dcc32add7bf601 /arm_compute/core/QuantizationInfo.h
parent6c7cf31655ebc65108f91df946904cc83e1b42f5 (diff)
downloadComputeLibrary-9c8f9a9beca2c158429152bf8a537dfe77a88342.tar.gz
Added int8 support in LeakyRelu/LUT kernel.
* Resolves COMPMID-6292 Change-Id: I15a0ad1c298ff53dd111fda76ef70872aaadac3b Signed-off-by: Pablo Marquez Tello <pablo.tello@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9740 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/QuantizationInfo.h')
-rw-r--r--arm_compute/core/QuantizationInfo.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/arm_compute/core/QuantizationInfo.h b/arm_compute/core/QuantizationInfo.h
index ddf1342e32..98ceec6c56 100644
--- a/arm_compute/core/QuantizationInfo.h
+++ b/arm_compute/core/QuantizationInfo.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2022 Arm Limited.
+ * Copyright (c) 2019-2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -430,6 +430,17 @@ inline qasymm8_t qasymm8_leaky_relu(qasymm8_t in,
return tmp;
}
+inline qasymm8_signed_t qasymm8_signed_leaky_relu(qasymm8_signed_t in,
+ const UniformQuantizationInfo &qi_in,
+ const UniformQuantizationInfo &qi_out,
+ float alpha)
+{
+ float tmp_f = dequantize_qasymm8_signed(in, qi_in);
+ tmp_f = tmp_f > 0 ? tmp_f : tmp_f * alpha;
+ const qasymm8_t tmp = quantize_qasymm8_signed(tmp_f, qi_out);
+ return tmp;
+}
+
inline qasymm8_t qasymm8_logistic(qasymm8_t in,
const UniformQuantizationInfo &qi_in,
const UniformQuantizationInfo &qi_out)