IVGCVSW-7400 POW IVGCVSW-7278 SQUARED_DIFFERENCE.

* Added 2 new operators as ElementWiseBinary ops
* Ref End to End and unit tests
* Serialize and Deserialize tests
* Delegate and Opaque Delegate tests
* TfLite Parser tests

Signed-off-by: John Mcloughlin <john.mcloughlin@arm.com>
Change-Id: I537158127f602f0c41ca0402aa31655cd3bd4281
diff --git a/delegate/opaque/src/ElementwiseBinary.hpp b/delegate/opaque/src/ElementwiseBinary.hpp
index d6a0947..8448609 100644
--- a/delegate/opaque/src/ElementwiseBinary.hpp
+++ b/delegate/opaque/src/ElementwiseBinary.hpp
@@ -167,6 +167,56 @@
     return isSupported ? kTfLiteOk : kTfLiteError;
 }
 
+TfLiteStatus ValidatePowerOperator(DelegateData& delegateData,
+                                   TfLiteOpaqueContext* tfLiteContext,
+                                   const armnn::TensorInfo& inputInfo1,
+                                   const armnn::TensorInfo& inputInfo2,
+                                   const armnn::TensorInfo& outputInfo)
+{
+    bool isSupported = false;
+    auto validateFunc = [&](const armnn::TensorInfo& outputTensorInfo, bool& isSupported)
+    {
+        FORWARD_LAYER_OPAQUE_SUPPORT_FUNC("POWER",
+                                          tfLiteContext,
+                                          IsElementwiseBinarySupported,
+                                          delegateData.m_Backends,
+                                          isSupported,
+                                          armnn::BackendId(),
+                                          inputInfo1,
+                                          inputInfo2,
+                                          outputTensorInfo,
+                                          armnn::BinaryOperation::Power);
+    };
+
+    validateFunc(outputInfo, isSupported);
+    return isSupported ? kTfLiteOk : kTfLiteError;
+}
+
+TfLiteStatus ValidateSquaredDifferenceOperator(DelegateData& delegateData,
+                                               TfLiteOpaqueContext* tfLiteContext,
+                                               const armnn::TensorInfo& inputInfo1,
+                                               const armnn::TensorInfo& inputInfo2,
+                                               const armnn::TensorInfo& outputInfo)
+{
+    bool isSupported = false;
+    auto validateFunc = [&](const armnn::TensorInfo& outputTensorInfo, bool& isSupported)
+    {
+        FORWARD_LAYER_OPAQUE_SUPPORT_FUNC("SQUAREDDIFFERENCE",
+                                          tfLiteContext,
+                                          IsElementwiseBinarySupported,
+                                          delegateData.m_Backends,
+                                          isSupported,
+                                          armnn::BackendId(),
+                                          inputInfo1,
+                                          inputInfo2,
+                                          outputTensorInfo,
+                                          armnn::BinaryOperation::SqDiff);
+    };
+
+    validateFunc(outputInfo, isSupported);
+    return isSupported ? kTfLiteOk : kTfLiteError;
+}
+
 TfLiteStatus ValidateSubOperator(DelegateData& delegateData,
                                  TfLiteOpaqueContext* tfLiteContext,
                                  const armnn::TensorInfo& inputInfo1,
@@ -336,6 +386,18 @@
                                            inputTensorInfo0,
                                            inputTensorInfo1,
                                            outputTensorInfo);
+            case kTfLiteBuiltinPow:
+                return ValidatePowerOperator(delegateData,
+                                             tfLiteContext,
+                                             inputTensorInfo0,
+                                             inputTensorInfo1,
+                                             outputTensorInfo);
+            case kTfLiteBuiltinSquaredDifference:
+                return ValidateSquaredDifferenceOperator(delegateData,
+                                                         tfLiteContext,
+                                                         inputTensorInfo0,
+                                                         inputTensorInfo1,
+                                                         outputTensorInfo);
             case kTfLiteBuiltinSub:
                 return ValidateSubOperator(delegateData,
                                            tfLiteContext,
@@ -378,6 +440,14 @@
             elementwiseBinaryLayer = delegateData.m_Network->AddElementwiseBinaryLayer(
                     armnn::BinaryOperation::Mul);
             break;
+        case kTfLiteBuiltinPow:
+            elementwiseBinaryLayer = delegateData.m_Network->AddElementwiseBinaryLayer(
+                    armnn::BinaryOperation::Power);
+            break;
+        case kTfLiteBuiltinSquaredDifference:
+            elementwiseBinaryLayer = delegateData.m_Network->AddElementwiseBinaryLayer(
+                    armnn::BinaryOperation::SqDiff);
+            break;
         case kTfLiteBuiltinSub:
             elementwiseBinaryLayer = delegateData.m_Network->AddElementwiseBinaryLayer(
                     armnn::BinaryOperation::Sub);