aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp8
-rw-r--r--src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp8
-rw-r--r--src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp8
-rw-r--r--src/runtime/CL/functions/CLFullyConnectedLayer.cpp18
-rw-r--r--tests/validation/CL/DepthwiseConvolutionLayer.cpp3
5 files changed, 18 insertions, 27 deletions
diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp
index c928677f30..25d0d2799b 100644
--- a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp
+++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NCHWKernel.cpp
@@ -316,9 +316,11 @@ void CLDepthwiseConvolutionLayer3x3NCHWKernel::configure(const CLCompileContext
if(act_info.enabled())
{
- const int a_val = quantize_qasymm8(act_info.a(), oq_info);
- const int b_val = quantize_qasymm8(act_info.b(), oq_info);
- const int o1 = oq_info.offset;
+ int a_val{};
+ int b_val{};
+ std::tie(b_val, a_val) = get_quantized_activation_min_max(act_info, input->info()->data_type(), oq_info);
+
+ const int o1 = oq_info.offset;
build_opts.add_option("-DA_VAL=" + support::cpp11::to_string(a_val));
build_opts.add_option("-DB_VAL=" + support::cpp11::to_string(b_val));
diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp
index 0b673ccdba..f553fd1849 100644
--- a/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp
+++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayer3x3NHWCKernel.cpp
@@ -282,9 +282,11 @@ void CLDepthwiseConvolutionLayer3x3NHWCKernel::configure(const CLCompileContext
if(act_info.enabled())
{
- const int a_val = quantize_qasymm8(act_info.a(), oq_info);
- const int b_val = quantize_qasymm8(act_info.b(), oq_info);
- const int o1 = oq_info.offset;
+ int a_val{};
+ int b_val{};
+ std::tie(b_val, a_val) = get_quantized_activation_min_max(act_info, input->info()->data_type(), oq_info);
+
+ const int o1 = oq_info.offset;
build_opts.add_option("-DA_VAL=" + support::cpp11::to_string(a_val));
build_opts.add_option("-DB_VAL=" + support::cpp11::to_string(b_val));
diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp
index 748f4a3848..c34018a000 100644
--- a/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp
+++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.cpp
@@ -212,9 +212,11 @@ void CLDepthwiseConvolutionLayerNativeKernel::configure(const CLCompileContext &
if(dwc_info.activation_info.enabled())
{
- const int a_val = quantize_qasymm8(dwc_info.activation_info.a(), oq_info);
- const int b_val = quantize_qasymm8(dwc_info.activation_info.b(), oq_info);
- const int o1 = oq_info.offset;
+ int a_val{};
+ int b_val{};
+ std::tie(b_val, a_val) = get_quantized_activation_min_max(dwc_info.activation_info, input->info()->data_type(), oq_info);
+
+ const int o1 = oq_info.offset;
build_opts.add_option("-DA_VAL=" + support::cpp11::to_string(a_val));
build_opts.add_option("-DB_VAL=" + support::cpp11::to_string(b_val));
diff --git a/src/runtime/CL/functions/CLFullyConnectedLayer.cpp b/src/runtime/CL/functions/CLFullyConnectedLayer.cpp
index 1796443ca5..1acf3c7a8b 100644
--- a/src/runtime/CL/functions/CLFullyConnectedLayer.cpp
+++ b/src/runtime/CL/functions/CLFullyConnectedLayer.cpp
@@ -84,23 +84,7 @@ Status construct_gemmlowp_output_stage(const ITensorInfo &input, const ITensorIn
if(activation_info.enabled())
{
- switch(activation_info.activation())
- {
- case ActivationLayerInfo::ActivationFunction::RELU:
- type_min = PixelValue(oq_unif.offset);
- break;
- case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU:
- type_min = PixelValue(oq_unif.offset);
- type_max = PixelValue(activation_info.a(), data_type, oq_info);
- break;
- case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU:
- type_min = PixelValue(activation_info.b(), data_type, oq_info);
- type_max = PixelValue(activation_info.a(), data_type, oq_info);
- break;
- default:
- ARM_COMPUTE_ERROR("Activation function not supported.");
- break;
- }
+ std::tie(type_min, type_max) = get_quantized_activation_min_max(activation_info, data_type, output_quant_info);
}
// Set the GEMMLowp output stage info
diff --git a/tests/validation/CL/DepthwiseConvolutionLayer.cpp b/tests/validation/CL/DepthwiseConvolutionLayer.cpp
index c779092eec..351819ae55 100644
--- a/tests/validation/CL/DepthwiseConvolutionLayer.cpp
+++ b/tests/validation/CL/DepthwiseConvolutionLayer.cpp
@@ -55,7 +55,8 @@ const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier",
const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
{
ActivationLayerInfo(),
- ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)
+ ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU),
+ ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f, 0.f)
});
} // namespace