From ea41b57721b644b9350e14754d3ecdcfba87667f Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Thu, 19 Mar 2020 18:16:46 +0000 Subject: IVGCVSW-4582 Undefined reference to GetProfilingService causes failure in the Backends CI job * Enable the GetProfilingService() function to BackendProfilingTests and ProfilingTestUtils Signed-off-by: Sadik Armagan Change-Id: I32e3625db0f465883f2ec27fb7c2fad4e91b6306 --- src/armnn/test/RuntimeTests.cpp | 6 +----- src/armnn/test/TestUtils.cpp | 10 ++++++++++ src/armnn/test/TestUtils.hpp | 8 ++++++++ src/backends/backendsCommon/test/BackendProfilingTests.cpp | 3 +-- src/profiling/test/ProfilingTestUtils.cpp | 4 ++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/armnn/test/RuntimeTests.cpp b/src/armnn/test/RuntimeTests.cpp index 9ced7e907c..d5bc26a72e 100644 --- a/src/armnn/test/RuntimeTests.cpp +++ b/src/armnn/test/RuntimeTests.cpp @@ -21,6 +21,7 @@ #include #include "RuntimeTests.hpp" +#include "TestUtils.hpp" namespace armnn { @@ -30,11 +31,6 @@ void RuntimeLoadedNetworksReserve(armnn::Runtime* runtime) runtime->m_LoadedNetworks.reserve(1); } -profiling::ProfilingService& GetProfilingService(armnn::Runtime* runtime) -{ - return runtime->m_ProfilingService; -} - } BOOST_AUTO_TEST_SUITE(Runtime) diff --git a/src/armnn/test/TestUtils.cpp b/src/armnn/test/TestUtils.cpp index b0ed17e41a..8ef820b3d5 100644 --- a/src/armnn/test/TestUtils.cpp +++ b/src/armnn/test/TestUtils.cpp @@ -18,3 +18,13 @@ void Connect(armnn::IConnectableLayer* from, armnn::IConnectableLayer* to, const from->GetOutputSlot(fromIndex).Connect(to->GetInputSlot(toIndex)); from->GetOutputSlot(fromIndex).SetTensorInfo(tensorInfo); } + +namespace armnn +{ + +profiling::ProfilingService& GetProfilingService(armnn::Runtime* runtime) +{ + return runtime->m_ProfilingService; +} + +} \ No newline at end of file diff --git a/src/armnn/test/TestUtils.hpp b/src/armnn/test/TestUtils.hpp index 9b1a3bf18d..9c5f672a5a 100644 --- a/src/armnn/test/TestUtils.hpp +++ b/src/armnn/test/TestUtils.hpp @@ -7,6 +7,7 @@ #include #include +#include void Connect(armnn::IConnectableLayer* from, armnn::IConnectableLayer* to, const armnn::TensorInfo& tensorInfo, unsigned int fromIndex = 0, unsigned int toIndex = 0); @@ -47,3 +48,10 @@ bool CheckRelatedLayers(armnn::Graph& graph, const std::list& testR return true; } + +namespace armnn +{ + +profiling::ProfilingService& GetProfilingService(armnn::Runtime* runtime); + +} // namespace armnn \ No newline at end of file diff --git a/src/backends/backendsCommon/test/BackendProfilingTests.cpp b/src/backends/backendsCommon/test/BackendProfilingTests.cpp index 1cf67c016d..7c78e14733 100644 --- a/src/backends/backendsCommon/test/BackendProfilingTests.cpp +++ b/src/backends/backendsCommon/test/BackendProfilingTests.cpp @@ -14,7 +14,7 @@ #include "ProfilingUtils.hpp" #include "RequestCounterDirectoryCommandHandler.hpp" -#include +#include #include #include @@ -119,7 +119,6 @@ BOOST_AUTO_TEST_CASE(BackendProfilingCounterRegisterMockBackendTest) armnn::MockBackendInitialiser initialiser; // Create a runtime -// armnn::IRuntimePtr runtime(armnn::IRuntime::Create(options)); armnn::Runtime runtime(options); // Check if the MockBackends 3 dummy counters {0, 1, 2-5 (four cores)} are registered diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp index 17291bad64..325cb40111 100644 --- a/src/profiling/test/ProfilingTestUtils.cpp +++ b/src/profiling/test/ProfilingTestUtils.cpp @@ -9,7 +9,8 @@ #include #include #include -#include + +#include #include @@ -296,7 +297,6 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) // Create runtime in which test will run armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; -// armnn::IRuntimePtr runtime(armnn::IRuntime::Create(options)); armnn::Runtime runtime(options); // build up the structure of the network -- cgit v1.2.1