aboutsummaryrefslogtreecommitdiff
path: root/src/armnn
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2021-03-31 16:12:13 +0100
committerSadik Armagan <sadik.armagan@arm.com>2021-04-02 10:38:51 +0000
commitaede8ca25d3231d122b670353b754142b64e5d69 (patch)
tree87ba5bdae701a51b15fa44d550a55932e89966c9 /src/armnn
parent8c7a28ba48a0c7347fd6f940cbcf4b6dbeca932f (diff)
downloadarmnn-aede8ca25d3231d122b670353b754142b64e5d69.tar.gz
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 <sadik.armagan@arm.com> Change-Id: I49f8467297f4b6b8e414cb6a3638a7d3f1bb886a
Diffstat (limited to 'src/armnn')
-rw-r--r--src/armnn/AsyncNetwork.cpp13
-rw-r--r--src/armnn/test/OptimizerTests.cpp3
2 files changed, 16 insertions, 0 deletions
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 <armnn/BackendHelper.hpp>
#include <armnn/BackendRegistry.hpp>
#include <armnn/Logging.hpp>
#include <armnn/utility/Assert.hpp>
@@ -391,6 +392,18 @@ AsyncNetworkImpl::AsyncNetworkImpl(std::unique_ptr<IOptimizedNetwork> 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<profiling::TimelineUtilityMethods> 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)