aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLWidthConcatenateLayerKernel.cpp
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2019-02-07 15:53:19 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-02-20 10:22:39 +0000
commit9643c2e97632ae6cc4f63111b98296e92f6fe4b3 (patch)
tree1fc4dd76595785814bb35929b8a8f1cba4320929 /src/core/CL/kernels/CLWidthConcatenateLayerKernel.cpp
parent76975a3c36ffbfd2260eb3ed8f31f664c2483a72 (diff)
downloadComputeLibrary-9643c2e97632ae6cc4f63111b98296e92f6fe4b3.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/CLWidthConcatenateLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLWidthConcatenateLayerKernel.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/CL/kernels/CLWidthConcatenateLayerKernel.cpp b/src/core/CL/kernels/CLWidthConcatenateLayerKernel.cpp
index c51c5796d1..6c32cd2371 100644
--- a/src/core/CL/kernels/CLWidthConcatenateLayerKernel.cpp
+++ b/src/core/CL/kernels/CLWidthConcatenateLayerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -107,9 +107,16 @@ void CLWidthConcatenateLayerKernel::configure(const ICLTensor *input, unsigned i
build_opts.add_option("-DWIDTH_OFFSET=" + support::cpp11::to_string(_width_offset));
build_opts.add_option("-DDEPTH=" + support::cpp11::to_string(input->info()->dimension(2)));
+ if(is_data_type_quantized_asymmetric(input->info()->data_type()) && input->info()->quantization_info() != output->info()->quantization_info())
+ {
+ build_opts.add_option("-DOFFSET_IN1=" + float_to_string_with_full_precision(input->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(input->info()->quantization_info().scale));
+ build_opts.add_option("-DSCALE_OUT=" + float_to_string_with_full_precision(output->info()->quantization_info().scale));
+ }
+
// Create kernel
_kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("concatenate_width", build_opts.options()));
-
// Configure kernel window
auto win_config = validate_and_configure_window(input->info(), width_offset, output->info());
ARM_COMPUTE_ERROR_THROW_ON(std::get<0>(win_config));