diff options
author | Omar Al Khatib <omar.alkhatib@arm.com> | 2022-11-01 17:01:24 +0000 |
---|---|---|
committer | Omar Al Khatib <omar.alkhatib@arm.com> | 2022-11-15 10:20:29 +0000 |
commit | b230a1f9bc53bf6b3bd74789e0085ff48336f348 (patch) | |
tree | e1469efaf532a022df2c2595d8188a551592edeb /src/cpu/kernels | |
parent | b1f82884eab0dac9ac1bd336f5c004ead7dfafbb (diff) | |
download | ComputeLibrary-b230a1f9bc53bf6b3bd74789e0085ff48336f348.tar.gz |
Fixed Arm NN unit test failure caused by quantised multiplication patch.
Resolves : [COMPMID-5698]
Signed-off-by: Omar Al Khatib <omar.alkhatib@arm.com>
Change-Id: I21ce976473e0e8807c14989e98e68aca69c7f1f3
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8603
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/cpu/kernels')
-rw-r--r-- | src/cpu/kernels/CpuMulKernel.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cpu/kernels/CpuMulKernel.cpp b/src/cpu/kernels/CpuMulKernel.cpp index 35a9958f65..82e5445321 100644 --- a/src/cpu/kernels/CpuMulKernel.cpp +++ b/src/cpu/kernels/CpuMulKernel.cpp @@ -181,7 +181,8 @@ void mul_saturate_quantized_8(const ITensor *src1, const ITensor *src2, ITensor using ExactTagType = typename wrapper::traits::neon_vector<T, window_step_x>::tag_type; - execute_window_loop(win, [&](const Coordinates &) + execute_window_loop( + win, [&](const Coordinates &) { const auto non_broadcast_input_ptr = reinterpret_cast<const T *>(non_broadcast_input.ptr()); const auto output_ptr = reinterpret_cast<T *>(dst.ptr()); @@ -447,7 +448,7 @@ void mul_q8_neon_fixedpoint(const ITensor *src0, const ITensor *src1, ITensor *d for(; x < window_end_x; ++x) { #ifdef __aarch64__ - out_ptr[x] = wrapper::vqrshrn<2>(wrapper::vqrshrn<8>(wrapper::vqrshrn_ex<8, ScalarType>((multiplier_14p18 * (int32_t(a_ptr[x]) - a_offset_16p0) * (int32_t( + out_ptr[x] = wrapper::vqrshrn<2>(wrapper::vqrshrn_ex<8, ScalarType>(wrapper::vshrq_n<8>((multiplier_14p18 * (int32_t(a_ptr[x]) - a_offset_16p0) * (int32_t( b_val) - b_offset_16p0)) + out_offset_14p18))); #else //__aarch64__ out_ptr[x] = utility::clamp<int32_t, ScalarType>(support::cpp11::lround(multiplier * ((float(a_ptr[x]) - a_offset) * (float(b_val) - b_offset)) + float(out_offset))); @@ -536,7 +537,7 @@ void mul_q8_neon_fixedpoint(const ITensor *src0, const ITensor *src1, ITensor *d for(; x < window_end_x; ++x) { #ifdef __aarch64__ - out_ptr[x] = wrapper::vqrshrn<2>(wrapper::vqrshrn<8>(wrapper::vqrshrn_ex<8, ScalarType>((multiplier_14p18 * (int32_t(in0_ptr[x]) - in0_offset_16p0) * (int32_t( + out_ptr[x] = wrapper::vqrshrn<2>(wrapper::vqrshrn_ex<8, ScalarType>(wrapper::vshrq_n<8>((multiplier_14p18 * (int32_t(in0_ptr[x]) - in0_offset_16p0) * (int32_t( in1_ptr[x]) - in1_offset_16p0)) + out_offset_14p18))); #else //__aarch64__ out_ptr[x] = utility::clamp<int32_t, ScalarType>(support::cpp11::lround(multiplier * ((float(in0_ptr[x]) - in0_offset) * (float(in1_ptr[x]) - in1_offset)) + float(out_offset))); |