From d25af6786c0a714f2b4f099d0338dab17a5dc7e1 Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Wed, 10 Jul 2019 17:06:12 +0100 Subject: COMPMID-2456: NEDeconvolutionLayer.cpp, NHWC is not supported Support of NHWC for NEDeconvolutionLayer Bugfix for QASYMM8 in CPPUpsample when offset is different than 0 QASYMM8 tests added in NEUpsample with offset different than 0 Change-Id: I8283fa5e5e323fd4d5777136359ddb33025674bb Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/1517 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Pablo Marquez --- src/core/CPP/kernels/CPPUpsampleKernel.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/core/CPP/kernels') diff --git a/src/core/CPP/kernels/CPPUpsampleKernel.cpp b/src/core/CPP/kernels/CPPUpsampleKernel.cpp index 6620ce2aeb..ad2d54a0f8 100644 --- a/src/core/CPP/kernels/CPPUpsampleKernel.cpp +++ b/src/core/CPP/kernels/CPPUpsampleKernel.cpp @@ -34,8 +34,8 @@ #include #include -using namespace arm_compute; - +namespace arm_compute +{ CPPUpsampleKernel::CPPUpsampleKernel() : _input(nullptr), _output(nullptr), _info() { @@ -82,7 +82,10 @@ void CPPUpsampleKernel::run(const Window &window, const ThreadInfo &info) const int end_x = width_scaled - _info.pad().first; const size_t element_size = _input->info()->element_size(); - std::fill_n(_output->buffer(), _output->info()->total_size(), 0); + //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(_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); // Create window Window window_out(window); @@ -99,3 +102,4 @@ void CPPUpsampleKernel::run(const Window &window, const ThreadInfo &info) }, in, out); } +} // namespace arm_compute \ No newline at end of file -- cgit v1.2.1