aboutsummaryrefslogtreecommitdiff
path: root/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2021-04-27 10:02:10 +0100
committerSadik Armagan <sadik.armagan@arm.com>2021-04-29 08:46:09 +0000
commita04a9d7c11f28c7e932435535e80223782f369f2 (patch)
tree9c1e86b0b4878dad12a359e60a8d2e8e051d2def /tests/ExecuteNetwork/ExecuteNetworkParams.cpp
parent484d5ebb00c0db76efd76a601b5bbaa460cd2ccb (diff)
downloadarmnn-a04a9d7c11f28c7e932435535e80223782f369f2.tar.gz
IVGCVSW-5775 'Add Async Support to ExecuteNetwork'
* Enabled async mode with '-n, concurrent' and 'simultaneous-iterations' in ExecuteNetwork * Number of input files provided should be equal to number of input files provided multiply by number of simultaneous iterations divided by comma !armnn:5443 Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Ibeb318010430bf4ae61a02b18b1bf88f3657774c
Diffstat (limited to 'tests/ExecuteNetwork/ExecuteNetworkParams.cpp')
-rw-r--r--tests/ExecuteNetwork/ExecuteNetworkParams.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetworkParams.cpp b/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
index 4e3b5e313d..8f1cb0b599 100644
--- a/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
@@ -145,6 +145,12 @@ void ExecuteNetworkParams::ValidateParams()
CheckModelFormat(m_ModelFormat);
+ // Check number of simultaneous iterations
+ if ((m_SimultaneousIterations < 1))
+ {
+ ARMNN_LOG(fatal) << "simultaneous-iterations cannot be less than 1. ";
+ }
+
// Check input tensor shapes
if ((m_InputTensorShapes.size() != 0) &&
(m_InputTensorShapes.size() != m_InputNames.size()))
@@ -159,10 +165,19 @@ void ExecuteNetworkParams::ValidateParams()
ARMNN_LOG(fatal) << "One or more input data file paths are not valid. ";
}
- if (m_InputTensorDataFilePaths.size() != m_InputNames.size())
+ if (!m_Concurrent && m_InputTensorDataFilePaths.size() != m_InputNames.size())
{
ARMNN_LOG(fatal) << "input-name and input-tensor-data must have the same amount of elements. ";
}
+
+ if (m_InputTensorDataFilePaths.size() < m_SimultaneousIterations * m_InputNames.size())
+ {
+ ARMNN_LOG(fatal) << "There is not enough input data for " << m_SimultaneousIterations << " execution.";
+ }
+ if (m_InputTensorDataFilePaths.size() > m_SimultaneousIterations * m_InputNames.size())
+ {
+ ARMNN_LOG(fatal) << "There is more input data for " << m_SimultaneousIterations << " execution.";
+ }
}
if ((m_OutputTensorFiles.size() != 0) &&
@@ -171,6 +186,12 @@ void ExecuteNetworkParams::ValidateParams()
ARMNN_LOG(fatal) << "output-name and write-outputs-to-file must have the same amount of elements. ";
}
+ if ((m_OutputTensorFiles.size() != 0)
+ && m_OutputTensorFiles.size() != m_SimultaneousIterations * m_OutputNames.size())
+ {
+ ARMNN_LOG(fatal) << "There is not enough output data for " << m_SimultaneousIterations << " execution.";
+ }
+
if (m_InputTypes.size() == 0)
{
//Defaults the value of all inputs to "float"