diff options
Diffstat (limited to 'src/armnn/test/GraphUtils.cpp')
-rw-r--r-- | src/armnn/test/GraphUtils.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/armnn/test/GraphUtils.cpp b/src/armnn/test/GraphUtils.cpp index 36db900a2d..bc6b562c9d 100644 --- a/src/armnn/test/GraphUtils.cpp +++ b/src/armnn/test/GraphUtils.cpp @@ -63,3 +63,16 @@ bool IsConnected(armnn::Layer* srcLayer, armnn::Layer* destLayer, } return false; } + +/// Checks that first comes before second in the order. +bool CheckOrder(const armnn::Graph& graph, const armnn::Layer* first, const armnn::Layer* second) +{ + graph.Print(); + + const auto& order = graph.TopologicalSort(); + + auto firstPos = std::find(order.begin(), order.end(), first); + auto secondPos = std::find(firstPos, order.end(), second); + + return (secondPos != order.end()); +} |