aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/SubgraphView.cpp
diff options
context:
space:
mode:
authorDeclan-ARM <decmce01@arm.com>2024-03-12 16:40:25 +0000
committerColm Donelan <colm.donelan@arm.com>2024-03-13 10:07:56 +0000
commit7c75e336fbeeec052a1cb90c68d1caece332c176 (patch)
tree8fac689c1b4192522f5fa98bccbfab12b8e08afe /src/armnn/SubgraphView.cpp
parent93bbf00d968101fb9a9174ad011b655ca7100546 (diff)
downloadarmnn-7c75e336fbeeec052a1cb90c68d1caece332c176.tar.gz
IVGCVSW-7853 Assert audit and removal
* src/armnn * src/armnn/layers Signed-off-by: Declan-ARM <decmce01@arm.com> Change-Id: Ic78cbbb59e90fbb15f893205a358c45264243721
Diffstat (limited to 'src/armnn/SubgraphView.cpp')
-rw-r--r--src/armnn/SubgraphView.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/armnn/SubgraphView.cpp b/src/armnn/SubgraphView.cpp
index 4259c4f288..3ede18151b 100644
--- a/src/armnn/SubgraphView.cpp
+++ b/src/armnn/SubgraphView.cpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2017, 2019-2023 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2017, 2019-2024 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
@@ -27,14 +27,17 @@ void AssertIfNullsOrDuplicates(const C& container, const std::string& errorMessa
std::unordered_set<T> duplicateSet;
std::for_each(container.begin(), container.end(), [&duplicateSet, &errorMessage](const T& i)
{
- // Ignore unused for release builds
- IgnoreUnused(errorMessage);
-
// Check if the item is valid
- ARMNN_ASSERT_MSG(i, errorMessage.c_str());
+ if (!i)
+ {
+ throw armnn::GraphValidationException(errorMessage.c_str());
+ }
// Check if a duplicate has been found
- ARMNN_ASSERT_MSG(duplicateSet.find(i) == duplicateSet.end(), errorMessage.c_str());
+ if (duplicateSet.find(i) != duplicateSet.end())
+ {
+ throw armnn::GraphValidationException(errorMessage.c_str());
+ }
duplicateSet.insert(i);
});
@@ -493,7 +496,8 @@ SubgraphView SubgraphView::GetWorkingCopy() const
void SubgraphView::SubstituteSubgraph(SubgraphView& subgraph, IConnectableLayer* substituteLayer)
{
- ARMNN_ASSERT(substituteLayer != nullptr);
+ ARMNN_THROW_INVALIDARG_MSG_IF_FALSE(substituteLayer, "substituteLayer should not be null");
+
SubgraphView substituteSubgraph(substituteLayer);
SubstituteSubgraph(subgraph, substituteSubgraph);