diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2020-04-28 15:38:10 +0100 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2020-04-28 15:59:15 +0000 |
commit | 6a1db9b25ed3a37449fdbc8479c6d3700fd157de (patch) | |
tree | fbd7c5392d9efc59cff15bde88d346e783bd19fb /src/core/CPP | |
parent | c1c366d13277bbb7dde8e59ef8fa92e62c6553a4 (diff) | |
download | ComputeLibrary-6a1db9b25ed3a37449fdbc8479c6d3700fd157de.tar.gz |
COMPMID-3407: HAL 1.3 Driver TransposeConv2D VTS Failure
Upsample wasn't done with the correct zero value.
Change-Id: Icf55c0584342979ec4277a80832d29954f5f960c
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3115
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CPP')
-rw-r--r-- | src/core/CPP/kernels/CPPUpsampleKernel.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/core/CPP/kernels/CPPUpsampleKernel.cpp b/src/core/CPP/kernels/CPPUpsampleKernel.cpp index e63808f80e..c190543216 100644 --- a/src/core/CPP/kernels/CPPUpsampleKernel.cpp +++ b/src/core/CPP/kernels/CPPUpsampleKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2017-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -82,10 +82,24 @@ void CPPUpsampleKernel::run(const Window &window, const ThreadInfo &info) const int end_y = height_scaled - _info.pad_bottom(); const size_t element_size = _input->info()->element_size(); - //The fill value is normally 0, but for QASYMM8 the '0' corresponds to the offset - const uint8_t fill_value = _output->info()->data_type() == DataType::QASYMM8 ? utility::clamp<uint8_t>(_output->info()->quantization_info().uniform().offset) : 0; - //Filling a value different than 0 works only for QASYMM8 datatype since we are filling 1byte values in a buffer of uint8_ts - std::fill_n(_output->buffer(), _output->info()->total_size(), fill_value); + // The fill value is normally 0, but for quantized types '0' corresponds to the offset + switch(_output->info()->data_type()) + { + case DataType::QASYMM8: + { + const uint8_t fill_value = _output->info()->quantization_info().uniform().offset; + std::fill_n(_output->buffer(), _output->info()->total_size(), fill_value); + } + break; + case DataType::QASYMM8_SIGNED: + { + const int8_t fill_value = _output->info()->quantization_info().uniform().offset; + std::fill_n(_output->buffer(), _output->info()->total_size(), fill_value); + } + break; + default: + std::fill_n(_output->buffer(), _output->info()->total_size(), 0); + } // Create window Window window_out(window); |