diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2021-04-27 10:02:10 +0100 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2021-04-29 08:46:09 +0000 |
commit | a04a9d7c11f28c7e932435535e80223782f369f2 (patch) | |
tree | 9c1e86b0b4878dad12a359e60a8d2e8e051d2def /tests/ExecuteNetwork/ExecuteNetworkParams.cpp | |
parent | 484d5ebb00c0db76efd76a601b5bbaa460cd2ccb (diff) | |
download | armnn-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.cpp | 23 |
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" |