From 03c7ff3f6188240baaeaeb405a357a0c58195fec Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Tue, 22 Aug 2023 12:00:04 +0100 Subject: IVGCVSW-7702 Update Doxygen Docu for 23.08 Signed-off-by: Nikhil Raj Change-Id: I357a9f7e47614589327c1ac5d95b6224ff77103d --- latest/_test_utils_8hpp_source.html | 210 ++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 latest/_test_utils_8hpp_source.html (limited to 'latest/_test_utils_8hpp_source.html') diff --git a/latest/_test_utils_8hpp_source.html b/latest/_test_utils_8hpp_source.html new file mode 100644 index 0000000000..c9b5419cc6 --- /dev/null +++ b/latest/_test_utils_8hpp_source.html @@ -0,0 +1,210 @@ + + + + + + + + +Arm NN: src/armnnTestUtils/TestUtils.hpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.08 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
TestUtils.hpp
+
+
+Go to the documentation of this file.
1 //
+
2 // Copyright © 2021-2023 Arm Ltd and Contributors. All rights reserved.
+
3 // SPDX-License-Identifier: MIT
+
4 //
+
5 
+
6 #pragma once
+
7 
+
8 #include <armnn/INetwork.hpp>
+
9 #include <Graph.hpp>
+
10 #include <Runtime.hpp>
+
11 
+ +
13  unsigned int fromIndex = 0, unsigned int toIndex = 0);
+
14 
+ +
16 {
+
17 public:
+
18  LayerNameAndTypeCheck(armnn::LayerType layerType, const char* name)
+
19  : m_layerType(layerType)
+
20  , m_name(name)
+
21  {}
+
22 
+
23  bool operator()(const armnn::Layer* const layer)
+
24  {
+
25  return (layer->GetNameStr() == m_name &&
+
26  layer->GetType() == m_layerType);
+
27  }
+
28 private:
+
29  armnn::LayerType m_layerType;
+
30  const char* m_name;
+
31 };
+
32 
+
33 template <typename LayerT>
+
34 bool IsLayerOfType(const armnn::Layer* const layer)
+
35 {
+
36  return (layer->GetType() == armnn::LayerEnumOf<LayerT>());
+
37 }
+
38 
+ +
40 {
+
41  return (first == last);
+
42 }
+
43 
+
44 /// Checks each unary function in Us evaluates true for each correspondent layer in the sequence [first, last).
+
45 template <typename U, typename... Us>
+
46 bool CheckSequence(const armnn::Graph::ConstIterator first, const armnn::Graph::ConstIterator last, U&& u, Us&&... us)
+
47 {
+
48  return u(*first) && CheckSequence(std::next(first), last, us...);
+
49 }
+
50 
+
51 template <typename LayerT>
+
52 bool CheckRelatedLayers(armnn::Graph& graph, const std::list<std::string>& testRelatedLayers)
+
53 {
+
54  for (auto& layer : graph)
+
55  {
+
56  if (layer->GetType() == armnn::LayerEnumOf<LayerT>())
+
57  {
+
58  auto& relatedLayers = layer->GetRelatedLayerNames();
+
59  if (!std::equal(relatedLayers.begin(), relatedLayers.end(), testRelatedLayers.begin(),
+
60  testRelatedLayers.end()))
+
61  {
+
62  return false;
+
63  }
+
64  }
+
65  }
+
66 
+
67  return true;
+
68 }
+
69 
+
70 namespace armnn
+
71 {
+
72 Graph& GetGraphForTesting(IOptimizedNetwork* optNetPtr);
+
73 ModelOptions& GetModelOptionsForTesting(IOptimizedNetwork* optNetPtr);
+
74 arm::pipe::IProfilingService& GetProfilingService(RuntimeImpl* runtime);
+
75 
+
76 } // namespace armnn
+
+
+
bool CheckRelatedLayers(armnn::Graph &graph, const std::list< std::string > &testRelatedLayers)
Definition: TestUtils.hpp:52
+ + + + +
arm::pipe::IProfilingService & GetProfilingService(armnn::RuntimeImpl *runtime)
Definition: TestUtils.cpp:59
+
bool operator()(const armnn::Layer *const layer)
Definition: TestUtils.hpp:23
+ + +
bool IsLayerOfType(const armnn::Layer *const layer)
Definition: TestUtils.hpp:34
+
const std::string & GetNameStr() const
Definition: Layer.hpp:240
+
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Definition: Layer.hpp:286
+
Copyright (c) 2021 ARM Limited and Contributors.
+
void Connect(armnn::IConnectableLayer *from, armnn::IConnectableLayer *to, const armnn::TensorInfo &tensorInfo, unsigned int fromIndex=0, unsigned int toIndex=0)
Definition: TestUtils.cpp:14
+
Graph & GetGraphForTesting(IOptimizedNetwork *optNet)
Definition: TestUtils.cpp:49
+
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:80
+
std::vector< BackendOptions > ModelOptions
+
ModelOptions & GetModelOptionsForTesting(IOptimizedNetwork *optNet)
Definition: TestUtils.cpp:54
+
bool CheckSequence(const armnn::Graph::ConstIterator first, const armnn::Graph::ConstIterator last)
Definition: TestUtils.hpp:39
+
LayerNameAndTypeCheck(armnn::LayerType layerType, const char *name)
Definition: TestUtils.hpp:18
+
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
Definition: Types.hpp:483
+ + + + + + -- cgit v1.2.1