COMPMID-3784 Fix 1 CTS MUL INT32 failure due to using SATURATE

* LargeGraph_TENSOR_INT32_Rank4/26

Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I9d07444db56e26c13a77bf022938644ed7953d6b
diff --git a/src/backends/cl/workloads/ClMultiplicationWorkload.cpp b/src/backends/cl/workloads/ClMultiplicationWorkload.cpp
index f4e7b83..e9b75c3 100644
--- a/src/backends/cl/workloads/ClMultiplicationWorkload.cpp
+++ b/src/backends/cl/workloads/ClMultiplicationWorkload.cpp
@@ -19,6 +19,10 @@
     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.
@@ -26,7 +30,7 @@
                                                             &aclInput2,
                                                             &aclOutput,
                                                             1.0f,
-                                                            arm_compute::ConvertPolicy::SATURATE,
+                                                            convertPolicy,
                                                             arm_compute::RoundingPolicy::TO_ZERO);
 }
 
@@ -40,12 +44,18 @@
     arm_compute::ICLTensor& input0 = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
     arm_compute::ICLTensor& input1 = static_cast<IClTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
     arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(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;
+
     // Construct
     m_PixelWiseMultiplication.configure(&input0,
                                         &input1,
                                         &output,
                                         1.0f,
-                                        arm_compute::ConvertPolicy::SATURATE,
+                                        convertPolicy,
                                         arm_compute::RoundingPolicy::TO_NEAREST_EVEN);
 }
 
diff --git a/src/backends/neon/workloads/NeonMultiplicationWorkload.cpp b/src/backends/neon/workloads/NeonMultiplicationWorkload.cpp
index d813970..6f78b8e 100644
--- a/src/backends/neon/workloads/NeonMultiplicationWorkload.cpp
+++ b/src/backends/neon/workloads/NeonMultiplicationWorkload.cpp
@@ -22,6 +22,10 @@
     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 @@
                                                             &aclInput2,
                                                             &aclOutput,
                                                             1.0f,
-                                                            arm_compute::ConvertPolicy::SATURATE,
+                                                            convertPolicy,
                                                             arm_compute::RoundingPolicy::TO_ZERO);
 }
 
@@ -43,6 +47,11 @@
     arm_compute::ITensor& input2 = PolymorphicDowncast<IAclTensorHandle*>(m_Data.m_Inputs[1])->GetTensor();
     arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(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 @@
                      &input2,
                      &output,
                      1.0f,
-                     arm_compute::ConvertPolicy::SATURATE,
+                     convertPolicy,
                      arm_compute::RoundingPolicy::TO_ZERO);
     m_PixelWiseMultiplication.reset(layer.release());
 }