From 07df3d4b85f42245abf97e1a889e1fb3ef8af359 Mon Sep 17 00:00:00 2001 From: morgolock Date: Thu, 27 Feb 2020 11:46:28 +0000 Subject: COMPMID-3079: Implement Hard-Swish in NEON. Change-Id: I019e36f65b4d821009bada9c6cdebc096d893b54 Signed-off-by: morgolock Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2802 Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins Reviewed-by: Michele Di Giorgio --- tests/validation/reference/ActivationLayer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/validation/reference/ActivationLayer.h') diff --git a/tests/validation/reference/ActivationLayer.h b/tests/validation/reference/ActivationLayer.h index cd861d7715..f41e87123e 100644 --- a/tests/validation/reference/ActivationLayer.h +++ b/tests/validation/reference/ActivationLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2017-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -81,6 +81,9 @@ inline T activate_float(T x, T a, T b, ActivationLayerInfo::ActivationFunction a case ActivationLayerInfo::ActivationFunction::IDENTITY: ret = x; break; + case ActivationLayerInfo::ActivationFunction::HARD_SWISH: + ret = x * ((std::min(std::max((x + 3), 0.0f), 6.0f)) * 0.166666667f); + break; default: ARM_COMPUTE_ERROR("Unsupported activation function"); break; -- cgit v1.2.1