diff options
author | Finn Williams <Finn.Williams@arm.com> | 2021-07-08 13:07:19 +0100 |
---|---|---|
committer | Finn Williams <Finn.Williams@arm.com> | 2021-07-12 17:09:06 +0100 |
commit | fdf2eaea1773d066dbb48e3d214ccd5446fa918a (patch) | |
tree | 5b68a1a30e65bf0cdac65199bef5ea11eefaa442 /ArmnnPreparedModel.hpp | |
parent | f769f292ba506784c8d21d691de821f4e3b53fec (diff) | |
download | android-nn-driver-fdf2eaea1773d066dbb48e3d214ccd5446fa918a.tar.gz |
IVGCVSW-6062 update ArmnnPreparedModels to have a single static instance of the threadpool
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: Ie350a11eab5d677dd6a5571ea4094aa51b23c501
Diffstat (limited to 'ArmnnPreparedModel.hpp')
-rw-r--r-- | ArmnnPreparedModel.hpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ArmnnPreparedModel.hpp b/ArmnnPreparedModel.hpp index 58177d92..685d950e 100644 --- a/ArmnnPreparedModel.hpp +++ b/ArmnnPreparedModel.hpp @@ -96,17 +96,19 @@ private: std::shared_ptr<armnn::OutputTensors>& outputTensors, CallbackContext m_CallbackContext); - armnn::NetworkId m_NetworkId; - armnn::IRuntime* m_Runtime; - std::unique_ptr<armnn::Threadpool> m_Threadpool; - HalModel m_Model; + armnn::NetworkId m_NetworkId; + armnn::IRuntime* m_Runtime; + HalModel m_Model; // There must be a single RequestThread for all ArmnnPreparedModel objects to ensure serial execution of workloads // It is specific to this class, so it is declared as static here - static RequestThread<ArmnnPreparedModel, HalVersion, CallbackContext_1_0> m_RequestThread; - uint32_t m_RequestCount; - const std::string& m_RequestInputsAndOutputsDumpDir; - const bool m_GpuProfilingEnabled; - + static RequestThread<ArmnnPreparedModel, + HalVersion, + CallbackContext_1_0> m_RequestThread; + uint32_t m_RequestCount; + const std::string& m_RequestInputsAndOutputsDumpDir; + const bool m_GpuProfilingEnabled; + // Static to allow sharing of threadpool between ArmnnPreparedModel instances + static std::unique_ptr<armnn::Threadpool> m_Threadpool; std::shared_ptr<armnn::IWorkingMemHandle> m_WorkingMemHandle; const bool m_AsyncModelExecutionEnabled; }; |