diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2021-11-24 15:47:28 +0000 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2021-12-14 11:02:41 +0000 |
commit | a097d2a0ed8e30d5aaf6d29ec18d0c39201b7b67 (patch) | |
tree | 947e587bc42d07f52c55b155308b5ea5bd3ebacd /src/armnn/test/TestUtils.hpp | |
parent | bc14881a76699dd942e94265116da68a6466455e (diff) | |
download | armnn-a097d2a0ed8e30d5aaf6d29ec18d0c39201b7b67.tar.gz |
IVGCVSW-6453 'Move the ArmNN Test Utils code to a physically separate directory'
* Created include/armnnTestUtils directory
* Moved Arm NN test utils files into armnnTestUtils directory
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: I03ac54c645c41c52650c4c03b6a58fb1481fef5d
Diffstat (limited to 'src/armnn/test/TestUtils.hpp')
-rw-r--r-- | src/armnn/test/TestUtils.hpp | 57 |
1 files changed, 4 insertions, 53 deletions
diff --git a/src/armnn/test/TestUtils.hpp b/src/armnn/test/TestUtils.hpp index fa9156bc09..fe5331ec3d 100644 --- a/src/armnn/test/TestUtils.hpp +++ b/src/armnn/test/TestUtils.hpp @@ -1,58 +1,9 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // -#pragma once +#include "../../armnnTestUtils/TestUtils.hpp" -#include <armnn/INetwork.hpp> -#include <Graph.hpp> -#include <Runtime.hpp> - -void Connect(armnn::IConnectableLayer* from, armnn::IConnectableLayer* to, const armnn::TensorInfo& tensorInfo, - unsigned int fromIndex = 0, unsigned int toIndex = 0); - -template <typename LayerT> -bool IsLayerOfType(const armnn::Layer* const layer) -{ - return (layer->GetType() == armnn::LayerEnumOf<LayerT>()); -} - -inline bool CheckSequence(const armnn::Graph::ConstIterator first, const armnn::Graph::ConstIterator last) -{ - return (first == last); -} - -/// Checks each unary function in Us evaluates true for each correspondent layer in the sequence [first, last). -template <typename U, typename... Us> -bool CheckSequence(const armnn::Graph::ConstIterator first, const armnn::Graph::ConstIterator last, U&& u, Us&&... us) -{ - return u(*first) && CheckSequence(std::next(first), last, us...); -} - -template <typename LayerT> -bool CheckRelatedLayers(armnn::Graph& graph, const std::list<std::string>& testRelatedLayers) -{ - for (auto& layer : graph) - { - if (layer->GetType() == armnn::LayerEnumOf<LayerT>()) - { - auto& relatedLayers = layer->GetRelatedLayerNames(); - if (!std::equal(relatedLayers.begin(), relatedLayers.end(), testRelatedLayers.begin(), - testRelatedLayers.end())) - { - return false; - } - } - } - - return true; -} - -namespace armnn -{ -Graph& GetGraphForTesting(IOptimizedNetwork* optNetPtr); -ModelOptions& GetModelOptionsForTesting(IOptimizedNetwork* optNetPtr); -profiling::ProfilingService& GetProfilingService(RuntimeImpl* runtime); - -} // namespace armnn
\ No newline at end of file +#pragma message("src/armnn/test/TestUtils.hpp has been deprecated, it is due for removal in 22.08 release." \ + " Please use from armnnTestUtils library, /src/armnnTestUtils/TestUtils.hpp)
\ No newline at end of file |