diff options
author | Colm Donelan <colm.donelan@arm.com> | 2022-08-10 16:29:08 +0100 |
---|---|---|
committer | Nikhil Raj <nikhil.raj@arm.com> | 2022-08-29 10:12:32 +0100 |
commit | 514d16b434102a4a7807548745af301baab13b6b (patch) | |
tree | 556c92405a025fcddba67801b779f05c2f63b427 /src/armnn/test/ProfilerTests.cpp | |
parent | b016157f1eea1acc6a84308521c0b90543161da4 (diff) | |
download | armnn-514d16b434102a4a7807548745af301baab13b6b.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
Diffstat (limited to 'src/armnn/test/ProfilerTests.cpp')
-rw-r--r-- | src/armnn/test/ProfilerTests.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
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. |