aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColm Donelan <colm.donelan@arm.com>2022-08-10 16:29:08 +0100
committerColm Donelan <colm.donelan@arm.com>2022-08-12 15:39:19 +0000
commita4c91b3aed1e4669013f5d50e90c758996082a6c (patch)
tree556c92405a025fcddba67801b779f05c2f63b427
parent5c59fb0729b80112d2be84aa8e79b8352c0e7d77 (diff)
downloadarmnn-a4c91b3aed1e4669013f5d50e90c758996082a6c.tar.gz
IVGCVSW-7106 Additional fix models with multiple input and output tensors.
* The previous fix for IVGCVSW-7106 introduced a problem around operators with multiple inputs and outputs: addSeparator was being applied to all tensors in the list not just the last one. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: I0325d9abcb7fb512f834c61686c698bbfc29a3be
-rw-r--r--src/armnn/ProfilingDetails.hpp3
-rw-r--r--src/armnn/test/ProfilerTests.cpp29
2 files changed, 31 insertions, 1 deletions
diff --git a/src/armnn/ProfilingDetails.hpp b/src/armnn/ProfilingDetails.hpp
index e1f357b3f3..64fceaf476 100644
--- a/src/armnn/ProfilingDetails.hpp
+++ b/src/armnn/ProfilingDetails.hpp
@@ -169,7 +169,8 @@ private:
// Close out the scope
PrintNewLine();
PrintFooter();
- if (addSeparator)
+ // For the last element we will consider the value of addSeparator.
+ if ((i < infos.size() - 1) || (addSeparator))
{
PrintSeparator();
PrintNewLine();
diff --git a/src/armnn/test/ProfilerTests.cpp b/src/armnn/test/ProfilerTests.cpp
index 6bccd5c97f..82fff2bc7c 100644
--- a/src/armnn/test/ProfilerTests.cpp
+++ b/src/armnn/test/ProfilerTests.cpp
@@ -170,6 +170,35 @@ TEST_CASE("LayerWorkloadConstructorWithWorkloadInfoInputAndOutputTensorNoParamet
REQUIRE(result.find("Num Dims\": \"5\"\n\t}\n}") != std::string::npos);
}
+TEST_CASE("LayerWorkloadConstructorWithWorkloadInfoMultipleInputAndMultipleOutputTensorNoParameters")
+{
+ // Calling AddDetailsToString with a descriptor that contains multiple input and output tensors. This is
+ // specifically looking at the usage of "addSeparator" parameter in PrintInfos.
+ armnn::ProfilingDetails classOnTest;
+ armnn::ArgMinMaxDescriptor descriptor;
+ armnn::WorkloadInfo workloadInfo;
+ arm::pipe::ProfilingGuid guid;
+ armnn::TensorInfo inputTensorInfo =
+ armnnUtils::GetTensorInfo(1, 1, 1, 1, armnn::DataLayout::NCHW, armnn::DataType::Float32);
+ // Add two inputs.
+ workloadInfo.m_InputTensorInfos.push_back(inputTensorInfo);
+ workloadInfo.m_InputTensorInfos.push_back(inputTensorInfo);
+
+ // We'll make the output tensrinfo have 5 dimensions to make errors easier to detect.
+ armnn::TensorInfo outputTensorInfo =
+ armnnUtils::GetTensorInfo(1, 1, 1, 1, 1, armnn::DataLayout::NCDHW, armnn::DataType::Float32);
+ // and two outputs.
+ workloadInfo.m_OutputTensorInfos.push_back(outputTensorInfo);
+ workloadInfo.m_OutputTensorInfos.push_back(outputTensorInfo);
+
+ classOnTest.AddDetailsToString("NeonArgMinMaxWorkload_Construct", descriptor, workloadInfo, guid);
+ std::string result = classOnTest.GetProfilingDetails();
+ // Look for the piece in the middle between Input 0 and Input 1:
+ REQUIRE(result.find("Dims\": \"4\"\n\t},\n\t\"Input 1\": {\n\t\t\"Shape\": \"[1,1,1,1]\"") != std::string::npos);
+ // Look for the piece in the middle between Output 0and Output 1:
+ REQUIRE(result.find("Dims\": \"5\"\n\t},\n\t\"Output 1\": {\n\t\t\"Shape\": \"[1,1,1,1,1]\"") != std::string::npos);
+}
+
TEST_CASE("ProfilingMacros")
{
// Get a reference to the profiler manager.