diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2019-07-10 17:06:12 +0100 |
---|---|---|
committer | Manuel Bottini <manuel.bottini@arm.com> | 2019-07-19 09:49:54 +0000 |
commit | d25af6786c0a714f2b4f099d0338dab17a5dc7e1 (patch) | |
tree | b8a1eafa1d01be903a238fff92ad6acd34b6a499 /src/core/CPP/kernels | |
parent | db9116ff15170ff734aad0300b46c48abc2a3b7b (diff) | |
download | ComputeLibrary-d25af6786c0a714f2b4f099d0338dab17a5dc7e1.tar.gz |
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 <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1517
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Diffstat (limited to 'src/core/CPP/kernels')
-rw-r--r-- | src/core/CPP/kernels/CPPUpsampleKernel.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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 <cstddef> #include <cstdint> -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<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); // 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 |