From ab538a211d1e8a3504512ceb6a778b3a0fc058fc Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Tue, 21 May 2024 15:39:54 +0100 Subject: Use lookup table for Fp16 Tanh activation in hardware with SVE Resolves: COMPMID-6901 Change-Id: Idcd3f5f5d90f4073aaf116c0586e46013fbd64f7 Signed-off-by: Gunes Bayir Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/11605 Comments-Addressed: Arm Jenkins Reviewed-by: Viet-Hoa Do Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- arm_compute/function_info/ActivationLayerInfo.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arm_compute/function_info/ActivationLayerInfo.h') diff --git a/arm_compute/function_info/ActivationLayerInfo.h b/arm_compute/function_info/ActivationLayerInfo.h index 9390d0c54f..83b12d572e 100644 --- a/arm_compute/function_info/ActivationLayerInfo.h +++ b/arm_compute/function_info/ActivationLayerInfo.h @@ -121,6 +121,20 @@ public: _lut_fp16 = lut; } #endif // __aarch64__ + + // The < and == are added to be able to use this data type as an attribute for LUTInfo + friend bool operator<(const ActivationLayerInfo &l, const ActivationLayerInfo &r) + { + const auto l_tup = std::make_tuple(l._act, l._a, l._b, l._enabled); + const auto r_tup = std::make_tuple(r._act, r._a, r._b, r._enabled); + + return l_tup < r_tup; + } + bool operator==(const ActivationLayerInfo &l) const + { + return this->_act == l._act && this->_a == l._a && this->_b == l._b && this->_enabled == l._enabled; + } + private: ActivationFunction _act = {ActivationLayerInfo::ActivationFunction::IDENTITY}; float _a = {}; -- cgit v1.2.1