diff options
Diffstat (limited to 'src/backends/tosaReference')
-rw-r--r-- | src/backends/tosaReference/TosaRefBackend.cpp | 18 | ||||
-rw-r--r-- | src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp | 16 |
2 files changed, 8 insertions, 26 deletions
diff --git a/src/backends/tosaReference/TosaRefBackend.cpp b/src/backends/tosaReference/TosaRefBackend.cpp index aaac07c27b..db653391e2 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 @@ OptimizationViews TosaRefBackend::OptimizeSubgraphView(const SubgraphView& subgr 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 @@ OptimizationViews TosaRefBackend::OptimizeSubgraphView(const SubgraphView& subgr // 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 @@ OptimizationViews TosaRefBackend::OptimizeSubgraphView(const SubgraphView& subgr // 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 @@ OptimizationViews TosaRefBackend::OptimizeSubgraphView(const SubgraphView& subgr 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 2da2875a76..759b37fe93 100644 --- a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp +++ b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp @@ -129,22 +129,6 @@ TEST_CASE("IsLayerSupportedTosaReferenceConstant") 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); |