diff options
author | Pablo Tello <pablo.tello@arm.com> | 2019-02-07 15:53:19 +0000 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-02-13 14:44:13 +0000 |
commit | eb6c88ae253f1a6555a741d6e5a04033a95486a7 (patch) | |
tree | e5620b35262b81cce1175c014a4925665c4f2621 /src/core/CL/kernels/CLWidthConcatenate2TensorsKernel.cpp | |
parent | 84bed5d90a39df0ad566ecea6c8091ec44d038c6 (diff) | |
download | ComputeLibrary-eb6c88ae253f1a6555a741d6e5a04033a95486a7.tar.gz |
COMPMID-1918: Different qinfos support in CLConcatLayer
Added support in CLDepthConcatenateLayerKernel and CLWidthConcatenateLayer for different
quantization arguments both for the input and output. If input's quantization infos are not
homogeneous the input values are requantized using the output's quantization info.
Change-Id: Ib5446d0c6790c2fe6e7172e87e4f2833247436db
Signed-off-by: Pablo Tello <pablo.tello@arm.com>
Reviewed-on: https://review.mlplatform.org/650
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLWidthConcatenate2TensorsKernel.cpp')
-rw-r--r-- | src/core/CL/kernels/CLWidthConcatenate2TensorsKernel.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/CL/kernels/CLWidthConcatenate2TensorsKernel.cpp b/src/core/CL/kernels/CLWidthConcatenate2TensorsKernel.cpp index 79bc9a5674..d58cef57de 100644 --- a/src/core/CL/kernels/CLWidthConcatenate2TensorsKernel.cpp +++ b/src/core/CL/kernels/CLWidthConcatenate2TensorsKernel.cpp @@ -111,6 +111,16 @@ void CLWidthConcatenate2TensorsKernel::configure(const ICLTensor *input1, const build_opts.add_option("-DINPUT1_WIDTH=" + support::cpp11::to_string(input1->info()->dimension(0))); build_opts.add_option("-DELEMENT_SIZE=" + support::cpp11::to_string(input1->info()->element_size())); + if(is_data_type_quantized_asymmetric(input1->info()->data_type()) && input1->info()->quantization_info() != output->info()->quantization_info()) + { + build_opts.add_option("-DOFFSET_IN1=" + float_to_string_with_full_precision(input1->info()->quantization_info().offset)); + build_opts.add_option("-DOFFSET_OUT=" + float_to_string_with_full_precision(output->info()->quantization_info().offset)); + build_opts.add_option("-DSCALE_IN1=" + float_to_string_with_full_precision(input1->info()->quantization_info().scale)); + build_opts.add_option("-DSCALE_OUT=" + float_to_string_with_full_precision(output->info()->quantization_info().scale)); + build_opts.add_option("-DOFFSET_IN2=" + float_to_string_with_full_precision(input2->info()->quantization_info().offset)); + build_opts.add_option("-DSCALE_IN2=" + float_to_string_with_full_precision(input2->info()->quantization_info().scale)); + } + // Create kernel _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("concatenate_width_x2", build_opts.options())); |