From 25485592c6e4d1694f98a43a3f9f62d484f7f014 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Thu, 27 May 2021 12:54:46 +0100 Subject: IVGCVSW-5781 Ensure Threadpool Memhandles are created after constant layer allocations Signed-off-by: Finn Williams Change-Id: If20572706d14df05e6d95ba436b364876d839495 --- src/armnn/LoadedNetwork.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/armnn/LoadedNetwork.cpp b/src/armnn/LoadedNetwork.cpp index 1a94828841..71075d0396 100644 --- a/src/armnn/LoadedNetwork.cpp +++ b/src/armnn/LoadedNetwork.cpp @@ -168,13 +168,6 @@ LoadedNetwork::LoadedNetwork(std::unique_ptr net, } } - // Create the thread pool which will have working memory handles assigned to each thread - // Should occur after factories are registered so that the WorkingMemHandles can be created - if (m_NetworkProperties.m_NumThreads > 0 && networkProperties.m_AsyncEnabled) - { - CreateThreadPool(m_NetworkProperties.m_NumThreads); - } - if (!networkProperties.m_AsyncEnabled) { for (auto&& layer : order) @@ -313,6 +306,13 @@ LoadedNetwork::LoadedNetwork(std::unique_ptr net, { AllocateAndExecuteConstantWorkloads(); } + + // Create the thread pool which will have working memory handles assigned to each thread + // Should occur last so all factories and constant layer tensor handles are created + if (m_NetworkProperties.m_NumThreads > 0 && networkProperties.m_AsyncEnabled) + { + CreateThreadPool(m_NetworkProperties.m_NumThreads); + } } void LoadedNetwork::AllocateAndExecuteConstantWorkloads() -- cgit v1.2.1