From cad4e91027a29a62c210d422ce1c9130e46f2199 Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Tue, 2 Jun 2020 12:07:43 +0100 Subject: IVGCVSW-4780 Add QoS to AndroidNNDriver * Add model priority to ArmnnPreparedModel_1_3 * Add RequestThread_1_3 to allow execution based on priority * Add RETIRE_RATE to Android.mk to be able to configure the retire rate Signed-off-by: Narumol Prangnawarat Change-Id: Ic5f4309249b744c2a8f625c986eede381a26028b --- ArmnnPreparedModel_1_3.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ArmnnPreparedModel_1_3.cpp') diff --git a/ArmnnPreparedModel_1_3.cpp b/ArmnnPreparedModel_1_3.cpp index 1fb03f44..c7adc6c4 100644 --- a/ArmnnPreparedModel_1_3.cpp +++ b/ArmnnPreparedModel_1_3.cpp @@ -138,7 +138,7 @@ namespace armnn_driver { template -RequestThread +RequestThread_1_3 ArmnnPreparedModel_1_3::m_RequestThread; template @@ -164,13 +164,15 @@ ArmnnPreparedModel_1_3::ArmnnPreparedModel_1_3(armnn::NetworkId netw armnn::IRuntime* runtime, const V1_3::Model& model, const std::string& requestInputsAndOutputsDumpDir, - const bool gpuProfilingEnabled) + const bool gpuProfilingEnabled, + V1_3::Priority priority) : m_NetworkId(networkId) , m_Runtime(runtime) , m_Model(model) , m_RequestCount(0) , m_RequestInputsAndOutputsDumpDir(requestInputsAndOutputsDumpDir) , m_GpuProfilingEnabled(gpuProfilingEnabled) + , m_ModelPriority(priority) { // Enable profiling if required. m_Runtime->GetProfiler(m_NetworkId)->EnableProfiling(m_GpuProfilingEnabled); @@ -830,6 +832,12 @@ Return ArmnnPreparedModel_1_3::Execute(const V1_ return V1_3::ErrorStatus::NONE; } +template +V1_3::Priority ArmnnPreparedModel_1_3::GetModelPriority() +{ + return m_ModelPriority; +} + #ifdef ARMNN_ANDROID_NN_V1_3 template class ArmnnPreparedModel_1_3; template Return ArmnnPreparedModel_1_3::ExecuteGraph( -- cgit v1.2.1