diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-10-29 10:58:13 +0000 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-12-20 14:05:24 +0000 |
commit | f29d1b7d8bf2d1619554eb3443556b44d4aa1a4c (patch) | |
tree | 0a427f7fda2131f39e055f27b97f0a612aff990c /src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp | |
parent | 748a7c81245ae81d04607b3a762cf65cd39026f2 (diff) | |
download | ComputeLibrary-f29d1b7d8bf2d1619554eb3443556b44d4aa1a4c.tar.gz |
COMPMID-2608: Enable quantization with multiplier greater than 1 on NEON
Change-Id: Ib2b0c9ac88fc2b645f478c9981f71ee28f2c77fd
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2425
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp')
-rw-r--r-- | src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp b/src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp index 84187332f8..86abb2d65c 100644 --- a/src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMLowpOffsetContributionOutputStageKernel.cpp @@ -909,8 +909,12 @@ get_configured_function(const ITensor *mm_result, const ITensor *vector_sum_row, && mm_result->info()->tensor_shape().y() != vector_sum_row->info()->tensor_shape().x(); // Check if we need to clamp the result using min and max - const bool is_bounded_relu = ((output_stage.gemmlowp_min_bound != output_stage.gemmlowp_max_bound) - && !(output_stage.gemmlowp_min_bound == 0 && output_stage.gemmlowp_max_bound == 255)); + PixelValue type_min = 0; + PixelValue type_max = 0; + std::tie(type_min, type_max) = get_min_max(output->info()->data_type()); + int type_min_int = type_min.get<int>(); + int type_max_int = type_max.get<int>(); + const bool is_bounded_relu = !(output_stage.gemmlowp_min_bound == type_min_int && output_stage.gemmlowp_max_bound == type_max_int); // Check if we need to perform fixed point requantization const bool is_fixed_point = output_stage.type != GEMMLowpOutputStageType::QUANTIZE_DOWN; |