From aede8ca25d3231d122b670353b754142b64e5d69 Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Wed, 31 Mar 2021 16:12:13 +0100 Subject: IVGCVSW-5783 'Add AsyncExecution Capability' * Added AsyncExecution to the BackendCapability enum class. * Logged a warning if backends do not support AsyncExecution capability if AsyncNetwork is created. Signed-off-by: Sadik Armagan Change-Id: I49f8467297f4b6b8e414cb6a3638a7d3f1bb886a --- src/armnn/AsyncNetwork.cpp | 13 +++++++++++++ src/armnn/test/OptimizerTests.cpp | 3 +++ 2 files changed, 16 insertions(+) (limited to 'src/armnn') diff --git a/src/armnn/AsyncNetwork.cpp b/src/armnn/AsyncNetwork.cpp index 4e3838bb5d..230346a0c3 100644 --- a/src/armnn/AsyncNetwork.cpp +++ b/src/armnn/AsyncNetwork.cpp @@ -8,6 +8,7 @@ #include "Layer.hpp" #include "Profiling.hpp" +#include #include #include #include @@ -391,6 +392,18 @@ AsyncNetworkImpl::AsyncNetworkImpl(std::unique_ptr net, } } + // Check backends support BackendCapability::AsyncExecution + for (auto const& backend : m_Backends) + { + if (!IsCapabilitySupported(backend.first, BackendCapability::AsyncExecution)) + { + ARMNN_LOG(warning) << fmt::format("AsyncNetworkImpl() Backend: '{0}' does not support Async Execution. " + "Will fall back to default implementation.", + backend.first.Get()); + } + + } + profiling::ProfilingGuid networkGuid = m_OptimizedNetwork->GetGuid(); std::unique_ptr timelineUtils = profiling::TimelineUtilityMethods::GetTimelineUtils(m_ProfilingService); diff --git a/src/armnn/test/OptimizerTests.cpp b/src/armnn/test/OptimizerTests.cpp index 896fdfd68c..95255c3a21 100644 --- a/src/armnn/test/OptimizerTests.cpp +++ b/src/armnn/test/OptimizerTests.cpp @@ -685,6 +685,9 @@ BOOST_AUTO_TEST_CASE(BackendCapabilityTest) BackendId backendId ="MockBackend"; // MockBackend does not support the NonConstWeights capability BOOST_CHECK(!armnn::IsCapabilitySupported(backendId, armnn::BackendCapability::NonConstWeights)); + + // MockBackend does not support the AsyncExecution capability + BOOST_CHECK(!armnn::IsCapabilitySupported(backendId, armnn::BackendCapability::AsyncExecution)); } BOOST_AUTO_TEST_CASE(BackendHintTest) -- cgit v1.2.1