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
diff --git a/tests/ExecuteNetwork/ExecuteNetworkParams.cpp b/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
index 4e3b5e3..8f1cb0b 100644
--- a/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
@@ -145,6 +145,12 @@
 
         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 @@
                 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 @@
             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"