IVGCVSW-2871 Ref QuantizeLayer workload

Change-Id: If048b2a053c542b31ae344fe0af04d9b4f40eb6d
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp
index 532c8ea..4d164d5 100644
--- a/src/backends/reference/RefLayerSupport.cpp
+++ b/src/backends/reference/RefLayerSupport.cpp
@@ -122,6 +122,14 @@
     }
 };
 
+struct ShapesAreSameTotalSize : public Rule
+{
+    ShapesAreSameTotalSize(const TensorInfo& info0, const TensorInfo& info1)
+    {
+        m_Res = info0.GetNumElements() == info1.GetNumElements();
+    }
+};
+
 struct ShapesAreBroadcastCompatible : public Rule
 {
     unsigned int CalcInputSize(const TensorShape& in, const TensorShape& out, unsigned int idx)
@@ -719,6 +727,34 @@
                                      &TrueFunc<>);
 }
 
+bool RefLayerSupport::IsQuantizeSupported(const TensorInfo& input,
+                                          const TensorInfo& output,
+                                          Optional<std::string&> reasonIfUnsupported) const
+{
+   bool supported = true;
+
+    // Define supported output types.
+    std::array<DataType,2> supportedInputTypes = {
+        DataType::Float32,
+    };
+
+    supported &= CheckSupportRule(TypeAnyOf(input, supportedInputTypes), reasonIfUnsupported,
+                                  "Reference quantize: input type not supported.");
+
+    // Define supported output types.
+    std::array<DataType,2> supportedOutputTypes = {
+        DataType::QuantisedAsymm8,
+        DataType::QuantisedSymm16
+    };
+    supported &= CheckSupportRule(TypeAnyOf(output, supportedOutputTypes), reasonIfUnsupported,
+                                  "Reference quantize: output type not supported.");
+
+    supported &= CheckSupportRule(ShapesAreSameTotalSize(input, output), reasonIfUnsupported,
+                                  "Reference quantize: input and output shapes have different num total elements.");
+
+    return supported;
+}
+
 bool RefLayerSupport::IsReshapeSupported(const TensorInfo& input,
                                          const ReshapeDescriptor& descriptor,
                                          Optional<std::string&> reasonIfUnsupported) const