diff options
author | Keith Davis <keith.davis@arm.com> | 2021-04-22 10:10:34 +0100 |
---|---|---|
committer | finn.williams <finn.williams@arm.com> | 2021-05-06 19:39:39 +0000 |
commit | e813d67f86df41a238ff79b5c554ef5027f56576 (patch) | |
tree | 54c2145a78297d61e6e94676729cb2468490ade3 /include/armnn/IRuntime.hpp | |
parent | d905decd256558bbee165e636ce4242ac3b9c917 (diff) | |
download | armnn-e813d67f86df41a238ff79b5c554ef5027f56576.tar.gz |
IVGCVSW-5813 Add Async Queue to IRuntime
Signed-off-by: Keith Davis <keith.davis@arm.com>
Change-Id: Icc0d131c8ee2e9748e2f14762a75962b39c10f9d
Diffstat (limited to 'include/armnn/IRuntime.hpp')
-rw-r--r-- | include/armnn/IRuntime.hpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp index 55c57974dc..f296a5f564 100644 --- a/include/armnn/IRuntime.hpp +++ b/include/armnn/IRuntime.hpp @@ -8,6 +8,7 @@ #include "INetwork.hpp" #include "IProfiler.hpp" #include "IWorkingMemHandle.hpp" +#include "IAsyncExecutionCallback.hpp" #include "Tensor.hpp" #include "Types.hpp" #include "TypesUtils.hpp" @@ -31,20 +32,24 @@ struct INetworkProperties ARMNN_DEPRECATED_MSG("Please use INetworkProperties constructor with MemorySource argument") INetworkProperties(bool importEnabled = false, bool exportEnabled = false, - bool asyncEnabled = false) + bool asyncEnabled = false, + size_t numThreads = 0) : m_ImportEnabled(importEnabled) , m_ExportEnabled(exportEnabled) , m_AsyncEnabled(asyncEnabled) + , m_NumThreads(numThreads) , m_InputSource(MemorySource::Undefined) , m_OutputSource(MemorySource::Undefined) {} INetworkProperties(bool asyncEnabled, MemorySource m_InputSource, - MemorySource m_OutputSource) + MemorySource m_OutputSource, + size_t numThreads = 0) : m_ImportEnabled(m_InputSource != MemorySource::Undefined) , m_ExportEnabled(m_OutputSource != MemorySource::Undefined) , m_AsyncEnabled(asyncEnabled) + , m_NumThreads(numThreads) , m_InputSource(m_InputSource) , m_OutputSource(m_OutputSource) {} @@ -54,7 +59,9 @@ struct INetworkProperties /// Deprecated and will be removed in future release. const bool m_ExportEnabled; - const bool m_AsyncEnabled; + const bool m_AsyncEnabled; + const size_t m_NumThreads; + const MemorySource m_InputSource; const MemorySource m_OutputSource; @@ -184,6 +191,16 @@ public: const InputTensors& inputTensors, const OutputTensors& outputTensors); + /// This is an experimental function + /// Schedule a thread safe execution by taking the input tensors and an execution priority for Quality of Service. + /// The output tensors will then be filled and the callback object will notify that the execution has either + /// succeeded or failed. + void Schedule(NetworkId networkId, + const InputTensors& inputTensors, + const OutputTensors& outputTensors, + const QosExecPriority priority, + std::shared_ptr<IAsyncExecutionCallback> callback); + /// Unloads a network from the IRuntime. /// At the moment this only removes the network from the m_Impl->m_Network. /// This might need more work in the future to be AndroidNN compliant. |