aboutsummaryrefslogtreecommitdiff
path: root/include/armnn/IRuntime.hpp
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2021-06-09 17:07:33 +0100
committerFinn Williams <Finn.Williams@arm.com>2021-06-23 17:14:53 +0100
commitf364d5391b08e9071cd965f5765385ec9156b652 (patch)
tree1ea93ed574a3eb51f5a1f4bb08dc1ad18aa1c6a2 /include/armnn/IRuntime.hpp
parent7a00eaa6ecf121623823b1951c0e6c9093271adf (diff)
downloadarmnn-f364d5391b08e9071cd965f5765385ec9156b652.tar.gz
IVGCVSW-6062 Rework the async threadpool
!android-nn-driver:5802 * Extract the threadpool from LoadedNetwork/Runtime * Refactor the threadpool to be handle multiple networks * Trim IAsyncExecutionCallback and add an InferenceId to AsyncExecutionCallback * Add AsyncCallbackManager class Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I36aa2ad29c16bc10ee0706adfeb6b27f60012afb
Diffstat (limited to 'include/armnn/IRuntime.hpp')
-rw-r--r--include/armnn/IRuntime.hpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp
index bfc13c9c01..f88b6b664f 100644
--- a/include/armnn/IRuntime.hpp
+++ b/include/armnn/IRuntime.hpp
@@ -32,24 +32,34 @@ struct INetworkProperties
ARMNN_DEPRECATED_MSG("Please use INetworkProperties constructor with MemorySource argument")
INetworkProperties(bool importEnabled = false,
bool exportEnabled = false,
- bool asyncEnabled = false,
- size_t numThreads = 1)
+ bool asyncEnabled = false)
: m_ImportEnabled(importEnabled)
, m_ExportEnabled(exportEnabled)
, m_AsyncEnabled(asyncEnabled)
- , m_NumThreads(numThreads)
, m_InputSource(m_ImportEnabled ? MemorySource::Malloc : MemorySource::Undefined)
, m_OutputSource(m_ExportEnabled ? MemorySource::Malloc : MemorySource::Undefined)
{}
+ ARMNN_DEPRECATED_MSG("Please use INetworkProperties constructor without numThreads argument")
INetworkProperties(bool asyncEnabled,
MemorySource m_InputSource,
MemorySource m_OutputSource,
- size_t numThreads = 1)
+ size_t numThreads)
+ : m_ImportEnabled(m_InputSource != MemorySource::Undefined)
+ , m_ExportEnabled(m_OutputSource != MemorySource::Undefined)
+ , m_AsyncEnabled(asyncEnabled)
+ , m_InputSource(m_InputSource)
+ , m_OutputSource(m_OutputSource)
+ {
+ armnn::IgnoreUnused(numThreads);
+ }
+
+ INetworkProperties(bool asyncEnabled,
+ MemorySource m_InputSource,
+ MemorySource m_OutputSource)
: 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)
{}
@@ -60,7 +70,6 @@ struct INetworkProperties
const bool m_ExportEnabled;
const bool m_AsyncEnabled;
- const size_t m_NumThreads;
const MemorySource m_InputSource;
const MemorySource m_OutputSource;
@@ -191,16 +200,6 @@ 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.