diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2019-11-29 17:25:25 +0000 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-12-03 15:09:16 +0000 |
commit | 1f332d4a41393ed30a4e9df841eb4b545fa87486 (patch) | |
tree | 673566c3c5a01504fc12c5543a813e7dd94a8f88 /src/core/CL/kernels/CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp | |
parent | fe7bf01f7f5038c9e0af5f0bf993160ae5739060 (diff) | |
download | ComputeLibrary-1f332d4a41393ed30a4e9df841eb4b545fa87486.tar.gz |
COMPMID-2794: Add support for QASYMM8_SIGNED in CLGEMMLowpOutputStage
Change-Id: I93ad3e5b9531ce1699214ff6e657a76ffdaacedd
Signed-off-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2396
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp')
-rw-r--r-- | src/core/CL/kernels/CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/CL/kernels/CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp b/src/core/CL/kernels/CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp index a98eae673b..a5b00d1e74 100644 --- a/src/core/CL/kernels/CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp +++ b/src/core/CL/kernels/CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.cpp @@ -24,6 +24,7 @@ #include "arm_compute/core/CL/kernels/CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel.h" #include "arm_compute/core/AccessWindowStatic.h" +#include "arm_compute/core/CL/CLHelpers.h" #include "arm_compute/core/CL/ICLTensor.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/Helpers.h" @@ -75,15 +76,13 @@ std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITen AccessWindowHorizontal input_access(input, 0, num_elems_processed_per_iteration); - bool window_changed = update_window_and_padding(win, - input_access); + bool window_changed = update_window_and_padding(win, input_access); if(output->total_size() != 0) { Window win_out = calculate_max_window(*output, Steps(num_elems_processed_per_iteration)); AccessWindowHorizontal output_result_access(output, 0, num_elems_processed_per_iteration); window_changed = window_changed || update_window_and_padding(win_out, output_result_access); - output_result_access.set_valid_region(win, ValidRegion(Coordinates(), output->tensor_shape())); } @@ -122,8 +121,11 @@ void CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel::configure(const { // Perform validate step ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); - ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), (bias != nullptr) ? bias->info() : nullptr, output->info(), - min, max)); + ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), (bias != nullptr) ? bias->info() : nullptr, output->info(), min, max)); + ARM_COMPUTE_ERROR_THROW_ON(validate_and_configure_window(input->info(), + (bias != nullptr) ? bias->info() : nullptr, + output->info()) + .first); _input = input; _bias = bias; @@ -134,6 +136,7 @@ void CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel::configure(const build_opts.add_option("-DRESULT_OFFSET_AFTER_SHIFT=" + support::cpp11::to_string(result_offset_after_shift)); build_opts.add_option("-DRESULT_FIXEDPOINT_MULTIPLIER=" + support::cpp11::to_string(result_fixedpoint_multiplier)); build_opts.add_option("-DRESULT_SHIFT=" + support::cpp11::to_string(result_shift)); + build_opts.add_option("-DOUTPUT_DATA_TYPE=" + get_cl_type_from_data_type(output->info()->data_type())); build_opts.add_option_if((min != 0) && (min != max), "-DMIN_BOUND=" + support::cpp11::to_string(min)); build_opts.add_option_if((max != 255) && (min != max), "-DMAX_BOUND=" + support::cpp11::to_string(max)); build_opts.add_option_if(bias != nullptr, "-DADD_BIAS"); |