diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2024-05-21 15:39:54 +0100 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2024-05-22 13:09:26 +0000 |
commit | ab538a211d1e8a3504512ceb6a778b3a0fc058fc (patch) | |
tree | 8ba432f59db5af1e630c0c801641eae737d876c1 /arm_compute/function_info | |
parent | 4c4b48fc5b88876a24fa04192b6fd9cdd660737e (diff) | |
download | ComputeLibrary-ab538a211d1e8a3504512ceb6a778b3a0fc058fc.tar.gz |
Use lookup table for Fp16 Tanh activation in hardware with SVE
Resolves: COMPMID-6901
Change-Id: Idcd3f5f5d90f4073aaf116c0586e46013fbd64f7
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/11605
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/function_info')
-rw-r--r-- | arm_compute/function_info/ActivationLayerInfo.h | 14 |
1 files changed, 14 insertions, 0 deletions
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 = {}; |