From a2a512c60e852a82b9d1e85bb7b8874723dda161 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Tue, 29 Sep 2020 08:38:47 +0100 Subject: COMPMID-3784 Fix 1 CTS MUL INT32 failure due to using SATURATE * LargeGraph_TENSOR_INT32_Rank4/26 Signed-off-by: Teresa Charlin Change-Id: I9d07444db56e26c13a77bf022938644ed7953d6b --- src/backends/neon/workloads/NeonMultiplicationWorkload.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/backends/neon') diff --git a/src/backends/neon/workloads/NeonMultiplicationWorkload.cpp b/src/backends/neon/workloads/NeonMultiplicationWorkload.cpp index d813970901..6f78b8eacc 100644 --- a/src/backends/neon/workloads/NeonMultiplicationWorkload.cpp +++ b/src/backends/neon/workloads/NeonMultiplicationWorkload.cpp @@ -22,6 +22,10 @@ arm_compute::Status NeonMultiplicationWorkloadValidate(const TensorInfo& input0, const arm_compute::TensorInfo aclInput2 = armcomputetensorutils::BuildArmComputeTensorInfo(input1); const arm_compute::TensorInfo aclOutput = armcomputetensorutils::BuildArmComputeTensorInfo(output); + auto convertPolicy = (IsQuantizedType(input0.GetDataType()) || IsQuantizedType(input1.GetDataType())) ? + arm_compute::ConvertPolicy::SATURATE : + arm_compute::ConvertPolicy::WRAP; + // At the time of writing, configure() will fail if a rounding policy other than TO_ZERO is supplied to it, // when providing a scale of 1.0 for F32 tensors, even though the provided rounding policy appears to be // ignored for F32 tensors. @@ -29,7 +33,7 @@ arm_compute::Status NeonMultiplicationWorkloadValidate(const TensorInfo& input0, &aclInput2, &aclOutput, 1.0f, - arm_compute::ConvertPolicy::SATURATE, + convertPolicy, arm_compute::RoundingPolicy::TO_ZERO); } @@ -43,6 +47,11 @@ NeonMultiplicationWorkload::NeonMultiplicationWorkload(const MultiplicationQueue arm_compute::ITensor& input2 = PolymorphicDowncast(m_Data.m_Inputs[1])->GetTensor(); arm_compute::ITensor& output = PolymorphicDowncast(m_Data.m_Outputs[0])->GetTensor(); + auto convertPolicy = (IsQuantizedType(info.m_InputTensorInfos[0].GetDataType()) || + IsQuantizedType(info.m_InputTensorInfos[1].GetDataType())) ? + arm_compute::ConvertPolicy::SATURATE : + arm_compute::ConvertPolicy::WRAP; + // At the time of writing, configure() will fail if a rounding policy other than TO_ZERO is supplied to it, // when providing a scale of 1.0 for F32 tensors, even though the provided rounding policy appears to be // ignored for F32 tensors. @@ -51,7 +60,7 @@ NeonMultiplicationWorkload::NeonMultiplicationWorkload(const MultiplicationQueue &input2, &output, 1.0f, - arm_compute::ConvertPolicy::SATURATE, + convertPolicy, arm_compute::RoundingPolicy::TO_ZERO); m_PixelWiseMultiplication.reset(layer.release()); } -- cgit v1.2.1