diff options
Diffstat (limited to 'src/armnn/JsonPrinter.cpp')
-rw-r--r-- | src/armnn/JsonPrinter.cpp | 81 |
1 files changed, 23 insertions, 58 deletions
diff --git a/src/armnn/JsonPrinter.cpp b/src/armnn/JsonPrinter.cpp index 9dc648c538..986edb9e6d 100644 --- a/src/armnn/JsonPrinter.cpp +++ b/src/armnn/JsonPrinter.cpp @@ -21,15 +21,17 @@ void JsonPrinter::PrintJsonChildObject(const JsonChildObject& object, size_t& id id++; } - PrintLabel(object.m_Label, id); - PrintType(object.m_Type); + if (object.GetType() != JsonObjectType::ExecObjectDesc) + { + PrintLabel(object.m_Label, id); + PrintType(object.m_Type); + } if (!object.m_Measurements.empty() || !object.m_Children.empty()) { PrintSeparator(); PrintNewLine(); } - if (object.GetType() == JsonObjectType::Measurement) { PrintMeasurementsList(object.m_Measurements); @@ -37,6 +39,15 @@ void JsonPrinter::PrintJsonChildObject(const JsonChildObject& object, size_t& id PrintNewLine(); PrintUnit(object.m_Unit); } + else if (object.GetType() == JsonObjectType::ExecObjectDesc) + { + for (std::string stringLine : object.m_LayerDetailsList) + { + PrintTabs(); + m_OutputStream << stringLine; + PrintNewLine(); + } + } if (!object.m_Children.empty()) { for (unsigned int childIndex = 0; childIndex < object.m_Children.size(); ++childIndex) @@ -50,21 +61,11 @@ void JsonPrinter::PrintJsonChildObject(const JsonChildObject& object, size_t& id } } } - PrintNewLine(); - PrintFooter(); -} - -void JsonPrinter::PrintHeader() -{ - m_OutputStream << "{" << std::endl; - IncrementNumberOfTabs(); -} - -void JsonPrinter::PrintArmNNHeader() -{ - PrintTabs(); - m_OutputStream << R"("ArmNN": {)" << std::endl; - IncrementNumberOfTabs(); + if (object.GetType() != JsonObjectType::ExecObjectDesc) + { + PrintNewLine(); + PrintFooter(); + } } std::string JsonPrinter::MakeKey(const std::string& label, size_t id) @@ -103,6 +104,10 @@ void JsonPrinter::PrintType(armnn::JsonObjectType type) { return "Event"; } + case JsonObjectType::ExecObjectDesc: + { + return "Operator Description"; + } default: { return "Unknown"; @@ -141,44 +146,4 @@ void JsonPrinter::PrintMeasurementsList(const std::vector<double>& measurementsV m_OutputStream << "]"; } -void JsonPrinter::PrintTabs() -{ - unsigned int numTabs = m_NumTabs; - while (numTabs-- > 0) - { - m_OutputStream << "\t"; - } -} - -void JsonPrinter::PrintSeparator() -{ - m_OutputStream << ","; -} - -void JsonPrinter::PrintNewLine() -{ - m_OutputStream << std::endl; -} - -void JsonPrinter::PrintFooter() -{ - DecrementNumberOfTabs(); - PrintTabs(); - m_OutputStream << "}"; -} - -void JsonPrinter::DecrementNumberOfTabs() -{ - if (m_NumTabs == 0) - { - return; - } - --m_NumTabs; -} - -void JsonPrinter::IncrementNumberOfTabs() -{ - ++m_NumTabs; -} - } // namespace armnn
\ No newline at end of file |