diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2020-01-22 11:07:54 +0000 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2020-01-22 17:46:22 +0000 |
commit | f44e57b1b7595166e269ff0a7934ca7cde9dcc0c (patch) | |
tree | 78626992317b5090c651b3b7212c135f83d2c638 /arm_compute | |
parent | 5ca23950b8d2bba69344171c2731c21befc24b00 (diff) | |
download | ComputeLibrary-f44e57b1b7595166e269ff0a7934ca7cde9dcc0c.tar.gz |
COMPMID-2819: Change PixelValue constructor to use int64_t
Change value data type from uint64_t to int64_t as we pass
negative values resulting to side effects.
Change-Id: I89383e629ec55154680c5ece4396e15841661a38
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2617
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/core/PixelValue.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arm_compute/core/PixelValue.h b/arm_compute/core/PixelValue.h index 52b1f654ad..c5f6608163 100644 --- a/arm_compute/core/PixelValue.h +++ b/arm_compute/core/PixelValue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019 ARM Limited. + * Copyright (c) 2016-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -36,7 +36,7 @@ class PixelValue public: /** Default constructor: value initialized to 0 */ PixelValue() - : value{ uint64_t(0) } + : value{ int64_t(0) } { } /** Initialize the union with a pixel value of chosen datatype @@ -45,7 +45,7 @@ public: * @param[in] datatype DataType that @p v have to be stored * @param[in] qinfo (Optional) QuantizationInfo to apply in case of quantized data types to @p v */ - PixelValue(uint64_t v, DataType datatype, QuantizationInfo qinfo = QuantizationInfo()) + PixelValue(int64_t v, DataType datatype, QuantizationInfo qinfo = QuantizationInfo()) : PixelValue() { switch(datatype) @@ -60,7 +60,7 @@ public: value.u8 = quantize_qasymm8(static_cast<uint8_t>(v), qinfo); break; case DataType::QASYMM8_SIGNED: - value.u8 = quantize_qasymm8_signed(static_cast<int8_t>(v), qinfo); + value.s8 = quantize_qasymm8_signed(static_cast<int8_t>(v), qinfo); break; case DataType::QSYMM8: value.s8 = quantize_qsymm8(static_cast<int8_t>(v), qinfo); @@ -87,7 +87,7 @@ public: value.u64 = static_cast<uint64_t>(v); break; case DataType::S64: - value.s16 = static_cast<int64_t>(v); + value.s64 = static_cast<int64_t>(v); break; case DataType::F16: value.f16 = static_cast<half>(v); @@ -99,7 +99,7 @@ public: value.f64 = static_cast<double>(v); break; default: - value.u64 = v; + value.s64 = v; break; } } |