aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLActivationLayerKernel.cpp
diff options
context:
space:
mode:
authormorgolock <pablo.tello@arm.com>2020-03-04 14:57:46 +0000
committerMichele Di Giorgio <michele.digiorgio@arm.com>2020-03-10 18:01:33 +0000
commit6b3865ad038d60a126fe1f90df815a480527a29f (patch)
tree5f363b89bde5fc0ca98cf12d2ef82fafe1cb0bd4 /src/core/CL/kernels/CLActivationLayerKernel.cpp
parentce3a7b27f80960e88415bb6cabbb75de2239cea8 (diff)
downloadComputeLibrary-6b3865ad038d60a126fe1f90df815a480527a29f.tar.gz
COMPMID-3080: Implement Hard-Swish activation in CL
Change-Id: I5ed35a5e0fba09791e4371b1a74108a1fdfed900 Signed-off-by: morgolock <pablo.tello@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2848 Reviewed-by: Sang-Hoon Park <sang-hoon.park@arm.com> Reviewed-by: Giorgio Arena <giorgio.arena@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLActivationLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLActivationLayerKernel.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/CL/kernels/CLActivationLayerKernel.cpp b/src/core/CL/kernels/CLActivationLayerKernel.cpp
index 270eb78dcb..350929500b 100644
--- a/src/core/CL/kernels/CLActivationLayerKernel.cpp
+++ b/src/core/CL/kernels/CLActivationLayerKernel.cpp
@@ -54,7 +54,8 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, c
ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
ActivationLayerInfo::ActivationFunction::BOUNDED_RELU,
ActivationLayerInfo::ActivationFunction::LOGISTIC,
- ActivationLayerInfo::ActivationFunction::TANH
+ ActivationLayerInfo::ActivationFunction::TANH,
+ ActivationLayerInfo::ActivationFunction::HARD_SWISH
};
const DataType data_type = input->data_type();
const QuantizationInfo &oq_info = (output != nullptr) ? output->quantization_info() : input->quantization_info();
@@ -139,9 +140,10 @@ void CLActivationLayerKernel::configure(ICLTensor *input, ICLTensor *output, Act
float a_const = act_info.a();
float b_const = act_info.b();
- const ActivationLayerInfo::ActivationFunction f_act = act_info.activation();
- const bool is_quantized = is_data_type_quantized(dt);
- const bool perform_activation_in_float = (f_act == ActivationLayerInfo::ActivationFunction::LOGISTIC) || (f_act == ActivationLayerInfo::ActivationFunction::TANH);
+ const ActivationLayerInfo::ActivationFunction f_act = act_info.activation();
+ const bool is_quantized = is_data_type_quantized(dt);
+ const bool perform_activation_in_float =
+ (f_act == ActivationLayerInfo::ActivationFunction::LOGISTIC) || (f_act == ActivationLayerInfo::ActivationFunction::TANH) || (f_act == ActivationLayerInfo::ActivationFunction::HARD_SWISH);
// Set build options
CLBuildOptions build_opts;