From 6b4dfc2df9271b2e9e0b9e0e0a78f715ddebf36e Mon Sep 17 00:00:00 2001 From: Derek Lamberti Date: Wed, 7 Aug 2019 17:01:57 +0100 Subject: IVGCVSW-3603 *Json printer prints full profiling hierarchy Change-Id: Ide5acbf993c2bcff5265b72fc979caa6f183bb22 Signed-off-by: Derek Lamberti --- .../backendsCommon/test/JsonPrinterTestImpl.cpp | 116 ++------------------- 1 file changed, 7 insertions(+), 109 deletions(-) (limited to 'src/backends/backendsCommon/test') diff --git a/src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp b/src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp index c7870d9672..9273a7910f 100644 --- a/src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp +++ b/src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp @@ -199,7 +199,7 @@ std::string GetSoftmaxProfilerJson(const std::vector& backends return ss.str(); } -inline void ValidateProfilerJson(std::string& result, const std::string& testData) +inline void ValidateProfilerJson(std::string& result) { // ensure all measurements are greater than zero std::vector measurementsVector = ExtractMeasurements(result); @@ -237,8 +237,6 @@ inline void ValidateProfilerJson(std::string& result, const std::string& testDat BOOST_CHECK(boost::contains(result, "ArmNN")); BOOST_CHECK(boost::contains(result, "inference_measurements")); - BOOST_CHECK(boost::contains(result, "layer_measurements")); - BOOST_CHECK_EQUAL(result, testData); // ensure no spare parenthesis present in print output BOOST_CHECK(AreParenthesesMatching(result)); @@ -249,118 +247,18 @@ void RunSoftmaxProfilerJsonPrinterTest(const std::vector& back // setup the test fixture and obtain JSON Printer result std::string result = GetSoftmaxProfilerJson(backends); - std::string backend = "Ref"; - std::string testName = "SoftmaxWorkload_Execute"; - std::string changeLine31 = "\n},\n\"CopyMemGeneric_Execute\": {"; - std::string changeLine39 = "us\""; - std::string changeLine40; - std::string changeLine45; + // validate the JSON Printer result + ValidateProfilerJson(result); const armnn::BackendId& firstBackend = backends.at(0); if (firstBackend == armnn::Compute::GpuAcc) { - backend = "Cl"; - testName = "SoftmaxUintWorkload_Execute"; - changeLine31 = ",\n\"OpenClKernelTimer/: softmax_layer_max_shift_exp_sum_quantized_serial GWS[,,]\": {"; - changeLine39 = R"(us" -}, -"OpenClKernelTimer/: softmax_layer_norm_quantized GWS[,,]": { -"raw": [ -, -, - -], -"unit": "us")"; - - changeLine40 = R"( -}, -"CopyMemGeneric_Execute": { -"raw": [ -, -, - -], -"unit": "us")"; - changeLine45 = "}\n"; + BOOST_CHECK(boost::contains(result, + "OpenClKernelTimer/: softmax_layer_max_shift_exp_sum_quantized_serial GWS[,,]")); } else if (firstBackend == armnn::Compute::CpuAcc) { - backend = "Neon"; - testName = "SoftmaxUintWorkload_Execute"; - changeLine31 = ",\n\"NeonKernelTimer/: NEFillBorderKernel\": {"; - changeLine39 = R"(us" -}, -"NeonKernelTimer/: NELogitsDMaxKernel": { -"raw": [ -, -, - -], -"unit": "us" -}, -"NeonKernelTimer/: NELogitsDSoftmaxKernel": { -"raw": [ -, -, - -], -"unit": "us")"; - changeLine40 = R"( -}, -"CopyMemGeneric_Execute": { -"raw": [ -, -, - -], -"unit": "us")"; - changeLine45 = "}\n"; + BOOST_CHECK(boost::contains(result, + "NeonKernelTimer/: NEFillBorderKernel")); } - - std::string testData = R"({ -"ArmNN": { -"inference_measurements": { -"raw": [ -, -, - -], -"unit": "us", -"layer_measurements": { -"raw": [ -, -, - -], -"unit": "us", -"CopyMemGeneric_Execute": { -"raw": [ -, -, - -], -"unit": "us" -}, -")" + backend + testName + R"(": { -"raw": [ -, -, - -], -"unit": "us")" + changeLine31 + R"( -"raw": [ -, -, - -], -"unit": ")" + changeLine39 + R"( -})" + changeLine40 + R"( -} -} -} -} -)" + changeLine45 + R"()"; - - // validate the JSON Printer result - ValidateProfilerJson(result, testData); } -- cgit v1.2.1