2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
8 #include <armnn/INetwork.hpp>
10 #include <Runtime.hpp>
12 void Connect(armnn::IConnectableLayer* from, armnn::IConnectableLayer* to, const armnn::TensorInfo& tensorInfo,
13 unsigned int fromIndex = 0, unsigned int toIndex = 0);
15 template <typename LayerT>
16 bool IsLayerOfType(const armnn::Layer* const layer)
18 return (layer->GetType() == armnn::LayerEnumOf<LayerT>());
21 inline bool CheckSequence(const armnn::Graph::ConstIterator first, const armnn::Graph::ConstIterator last)
23 return (first == last);
26 /// Checks each unary function in Us evaluates true for each correspondent layer in the sequence [first, last).
27 template <typename U, typename... Us>
28 bool CheckSequence(const armnn::Graph::ConstIterator first, const armnn::Graph::ConstIterator last, U&& u, Us&&... us)
30 return u(*first) && CheckSequence(std::next(first), last, us...);
33 template <typename LayerT>
34 bool CheckRelatedLayers(armnn::Graph& graph, const std::list<std::string>& testRelatedLayers)
36 for (auto& layer : graph)
38 if (layer->GetType() == armnn::LayerEnumOf<LayerT>())
40 auto& relatedLayers = layer->GetRelatedLayerNames();
41 if (!std::equal(relatedLayers.begin(), relatedLayers.end(), testRelatedLayers.begin(),
42 testRelatedLayers.end()))
55 profiling::ProfilingService& GetProfilingService(armnn::Runtime* runtime);