Add CLAMP operator to Dynamic Fusion interface
Add the CLAMP activation function for GPU backend with generic activation Component and TemplateWriter modules.
CLAMP is internally implemented as LU_BOUNDED_RELU activation function with the alpha and beta variables swapped.
We do NOT consider in-place computation cases in this patch.
* CLAMP operator for GPU backend.
* Activation Component and TemplateWriter for CL backend.
* TemplateWriter generates tiled kernel code.
* Supported data types: F16, F32.
* Validation tests for CLAMP operation.
Resolves: COMPMID-5519
Change-Id: Ieb097d6b1e6a7ed2b882518e88314454efb402f6
Signed-off-by: Jakub Sujak <jakub.sujak@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8762
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Reviewed-by: SiCong Li <sicong.li@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/gpu/cl/ClKernelLibrary.cpp b/src/gpu/cl/ClKernelLibrary.cpp
index 5f2fcd6..f788bed 100644
--- a/src/gpu/cl/ClKernelLibrary.cpp
+++ b/src/gpu/cl/ClKernelLibrary.cpp
@@ -486,6 +486,14 @@
{
#ifdef EMBEDDED_KERNELS
{
+ "activation_float_helpers.h",
+#include "./cl_kernels/activation_float_helpers.hembed"
+ },
+ {
+ "activation_quant_helpers.h",
+#include "./cl_kernels/activation_quant_helpers.hembed"
+ },
+ {
"common/activation_layer.cl",
#include "./cl_kernels/common/activation_layer.clembed"
},