aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bentham <matthew.bentham@arm.com>2019-04-05 09:35:15 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-04-08 09:56:27 +0000
commit1b63d6c138f9d7c772c7dc325467018b557ff9ed (patch)
tree34f786427b96e88f652e843a643aa58514f4993d
parenteff363d58992fb6384053259f9e1ee773f8cd4df (diff)
downloadarmnn-1b63d6c138f9d7c772c7dc325467018b557ff9ed.tar.gz
IVGCVSW-2927 Fix Streamline annotations
Change-Id: Ia3f4852e6ba1358c6798210ecf94105a130cb1b9 Signed-off-by: Matthew Bentham <matthew.bentham@arm.com>
-rw-r--r--src/armnn/Profiling.cpp22
-rw-r--r--src/armnn/Profiling.hpp2
2 files changed, 14 insertions, 10 deletions
diff --git a/src/armnn/Profiling.cpp b/src/armnn/Profiling.cpp
index c153eb67fa..d30a64fedb 100644
--- a/src/armnn/Profiling.cpp
+++ b/src/armnn/Profiling.cpp
@@ -3,6 +3,9 @@
// SPDX-License-Identifier: MIT
//
#include "Profiling.hpp"
+
+#include <armnn/BackendId.hpp>
+
#include "JsonPrinter.hpp"
#if ARMNN_STREAMLINE_ENABLED
@@ -204,7 +207,7 @@ Event* Profiler::BeginEvent(const BackendId& backendId,
event->Start();
#if ARMNN_STREAMLINE_ENABLED
- ANNOTATE_CHANNEL_COLOR(m_Parents.size(), GetEventColor(compute), label.c_str());
+ ANNOTATE_CHANNEL_COLOR(uint32_t(m_Parents.size()), GetEventColor(backendId), label.c_str());
#endif
m_Parents.push(event);
@@ -224,7 +227,7 @@ void Profiler::EndEvent(Event* event)
BOOST_ASSERT(event->GetParentEvent() == parent);
#if ARMNN_STREAMLINE_ENABLED
- ANNOTATE_CHANNEL_END(m_Parents.size());
+ ANNOTATE_CHANNEL_END(uint32_t(m_Parents.size()));
#endif
}
@@ -467,20 +470,21 @@ void Profiler::AnalyzeEventsAndWriteResults(std::ostream& outStream) const
}
}
-std::uint32_t Profiler::GetEventColor(Compute compute) const
+std::uint32_t Profiler::GetEventColor(const BackendId& backendId) const
{
- switch(compute)
- {
- case Compute::CpuRef:
+ static BackendId cpuRef("CpuRef");
+ static BackendId cpuAcc("CpuAcc");
+ static BackendId gpuAcc("GpuAcc");
+ if (backendId == cpuRef) {
// Cyan
return 0xffff001b;
- case Compute::CpuAcc:
+ } else if (backendId == cpuAcc) {
// Green
return 0x00ff001b;
- case Compute::GpuAcc:
+ } else if (backendId == gpuAcc) {
// Purple
return 0xff007f1b;
- default:
+ } else {
// Dark gray
return 0x5555551b;
}
diff --git a/src/armnn/Profiling.hpp b/src/armnn/Profiling.hpp
index 0fb60d346a..0b2e46d46d 100644
--- a/src/armnn/Profiling.hpp
+++ b/src/armnn/Profiling.hpp
@@ -57,7 +57,7 @@ public:
void Print(std::ostream& outStream) const override;
// Gets the color to render an event with, based on which device it denotes.
- uint32_t GetEventColor(Compute compute) const;
+ uint32_t GetEventColor(const BackendId& backendId) const;
private:
using EventPtr = std::unique_ptr<Event>;