IVGCVSW-8165: Update TOSA Common and TosaRef to use TOSA v0.80

* Keep the order of the operators in TosaRef, so that const ops go first
* Remove IsLayerSupportedTosaReferenceConstantUnsupported and open ticket in MLTOSA

Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: Ifaa6c26dd8ad7d531f1691320d8c731956b910aa
diff --git a/src/backends/tosaCommon/operatorMappings/Conv2dOperator.cpp b/src/backends/tosaCommon/operatorMappings/Conv2dOperator.cpp
index fdd6ca4..c65f189 100644
--- a/src/backends/tosaCommon/operatorMappings/Conv2dOperator.cpp
+++ b/src/backends/tosaCommon/operatorMappings/Conv2dOperator.cpp
@@ -1,5 +1,5 @@
 //
-// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2022-2024 Arm Ltd and Contributors. All rights reserved.
 // SPDX-License-Identifier: MIT
 //
 
@@ -114,7 +114,7 @@
                                static_cast<int>(conv2dDescriptor->m_StrideX)};
     std::vector<int> dilation = {static_cast<int>(conv2dDescriptor->m_DilationY),
                                  static_cast<int>(conv2dDescriptor->m_DilationX)};
-    TosaConvAttribute attribute(pad, stride, dilation, 0, 0);
+    TosaConvAttribute attribute(pad, stride, dilation, 0, 0, false); // input_zp, weight_zp, local_bound
 
     auto* op = new TosaSerializationOperator(Op_CONV2D,
                                              Attribute_ConvAttribute,
diff --git a/src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp b/src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp
index 817aba3..047e0a1 100644
--- a/src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp
+++ b/src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp
@@ -131,6 +131,8 @@
             return "DType_FP16";
         case DType_BF16:
             return "DType_BF16";
+        case DType_SHAPE:
+            return "DType_SHAPE";
     }
     return "";
 }
@@ -282,6 +284,10 @@
             return "Op_FFT2D";
         case Op_RFFT2D:
             return "Op_RFFT2D";
+        case Op_ERF:
+            return "Op_ERF";
+        case Op_DIM: // = Op_MAX
+            return "Op_DIM";
     }
     return "";
 }
diff --git a/src/backends/tosaCommon/operatorMappings/TosaRescaleOperatorUtils.hpp b/src/backends/tosaCommon/operatorMappings/TosaRescaleOperatorUtils.hpp
index a043284..1a4dd7a 100644
--- a/src/backends/tosaCommon/operatorMappings/TosaRescaleOperatorUtils.hpp
+++ b/src/backends/tosaCommon/operatorMappings/TosaRescaleOperatorUtils.hpp
@@ -33,7 +33,9 @@
                                    shifts,
                                    scale32,
                                    double_round,
-                                   false);
+                                   false,  // per_channel
+                                   false,  // input_unsigned
+                                   false); // output_unsigned
 
     // op
     *op = new TosaSerializationOperator(Op_RESCALE, Attribute_RescaleAttribute, &attribute, {inputName}, {outputName});
diff --git a/src/backends/tosaCommon/operatorMappings/TransposeConv2dOperator.cpp b/src/backends/tosaCommon/operatorMappings/TransposeConv2dOperator.cpp
index 3041b79..8c2ae9f 100644
--- a/src/backends/tosaCommon/operatorMappings/TransposeConv2dOperator.cpp
+++ b/src/backends/tosaCommon/operatorMappings/TransposeConv2dOperator.cpp
@@ -1,5 +1,5 @@
 //
-// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2022-2024 Arm Ltd and Contributors. All rights reserved.
 // SPDX-License-Identifier: MIT
 //
 
@@ -143,7 +143,7 @@
         }
     }
 
-    TosaTransposeConvAttribute attribute(pad, stride, outputShape, 0, 0);
+    TosaTransposeConvAttribute attribute(pad, stride, outputShape, 0, 0, false); // input_zp, weight_zp, local_bound
 
     auto* op = new TosaSerializationOperator(Op_TRANSPOSE_CONV2D,
                                              Attribute_TransposeConvAttribute,
diff --git a/src/backends/tosaReference/TosaRefBackend.cpp b/src/backends/tosaReference/TosaRefBackend.cpp
index aaac07c..db65339 100644
--- a/src/backends/tosaReference/TosaRefBackend.cpp
+++ b/src/backends/tosaReference/TosaRefBackend.cpp
@@ -1,5 +1,5 @@
 //
-// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2022-2024 Arm Ltd and Contributors. All rights reserved.
 // SPDX-License-Identifier: MIT
 //
 
@@ -92,15 +92,15 @@
     std::vector<TosaSerializationOperator*> operators;
     std::vector<TosaSerializationTensor*> tensors;
 
-    auto it = subgraph.end();
-    while (it != subgraph.begin())
+    auto it = subgraph.begin();
+    while (it != subgraph.end())
     {
-        --it;
         Layer& base = *(PolymorphicDowncast<Layer*>(*it));
 
         if(base.GetType() == armnn::LayerType::Input ||
            base.GetType() == armnn::LayerType::Output)
         {
+            ++it;
             continue;
         }
 
@@ -108,10 +108,8 @@
 
         // Loop through inputs to see if there are any graph inputs, if so save them.
         // If it's an input to the graph "input" can be found in the string.
-        for (uint32_t i = 0; i < mappings->GetInputs().size(); i++)
+        for (const std::string& blockInputName : mappings->GetInputs())
         {
-            std::basic_string<char> blockInputName = mappings->GetInputs()[i];
-
             if (blockInputName.find("input") != std::string::npos)
             {
                 graphInputs.push_back(blockInputName);
@@ -120,10 +118,8 @@
 
         // Loop through outputs to see if there are any graph outputs, if so save them.
         // If it's an output to the graph "output" can be found in the string.
-        for (uint32_t i = 0; i < mappings->GetOutputs().size(); i++)
+        for (const std::string& blockOutputName : mappings->GetOutputs())
         {
-            std::basic_string<char> blockOutputName = mappings->GetOutputs()[i];
-
             if (blockOutputName.find("output") != std::string::npos)
             {
                 graphOutputs.push_back(blockOutputName);
@@ -135,6 +131,8 @@
 
         auto blockTensors = mappings->GetTensors();
         tensors.insert(tensors.end(), blockTensors.begin(), blockTensors.end());
+
+        ++it;
     }
 
     // Add all mappings to main block.
diff --git a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
index 2da2875..759b37f 100644
--- a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
+++ b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp
@@ -129,22 +129,6 @@
     CHECK(supported);
 }
 
-TEST_CASE("IsLayerSupportedTosaReferenceConstantUnsupported")
-{
-    TensorInfo outputInfo({1,1,3,4}, DataType::Signed64);
-
-    TosaRefLayerSupport supportChecker;
-    std::string reasonIfNotSupported;
-    auto supported = supportChecker.IsLayerSupported(LayerType::Constant,
-                                                     {outputInfo},
-                                                     BaseDescriptor(),
-                                                     EmptyOptional(),
-                                                     EmptyOptional(),
-                                                     reasonIfNotSupported);
-
-    CHECK(!supported);
-}
-
 TEST_CASE("IsLayerSupportedTosaReferenceConv2d")
 {
     TensorInfo inputInfo ({ 1, 5, 5, 1 }, DataType::Float32);