aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Profiling.cpp
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 /src/armnn/Profiling.cpp
parenteff363d58992fb6384053259f9e1ee773f8cd4df (diff)
downloadarmnn-1b63d6c138f9d7c772c7dc325467018b557ff9ed.tar.gz
IVGCVSW-2927 Fix Streamline annotations
Change-Id: Ia3f4852e6ba1358c6798210ecf94105a130cb1b9 Signed-off-by: Matthew Bentham <matthew.bentham@arm.com>
Diffstat (limited to 'src/armnn/Profiling.cpp')
-rw-r--r--src/armnn/Profiling.cpp22
1 files changed, 13 insertions, 9 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;
}