aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Profiling.hpp
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2020-06-19 14:33:05 +0100
committerDerek Lamberti <derek.lamberti@arm.com>2020-06-25 11:36:51 +0100
commita08d29b815987e98e7f45519e6a55eee0f085e5f (patch)
treec098756dd4d067ad3500b6d89cae32a3f4299193 /src/armnn/Profiling.hpp
parentd5ba9aad6fa12345744d442ba0d865686ae3aea3 (diff)
downloadarmnn-a08d29b815987e98e7f45519e6a55eee0f085e5f.tar.gz
Minor improvement of inference profiling
* Start inference profiling at the actual beginning * Add profiling events for EnqueueInputs and EnqueueOutputs * Add profiling event for working memory allocation * Refactor Execute body to remove code duplication * forward arguments to constructors rather than copy Change-Id: Iacab85f0a02e88e2423885f86f97e4dba4037319 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'src/armnn/Profiling.hpp')
-rw-r--r--src/armnn/Profiling.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/armnn/Profiling.hpp b/src/armnn/Profiling.hpp
index 08d7f7ba21..08e55a14c5 100644
--- a/src/armnn/Profiling.hpp
+++ b/src/armnn/Profiling.hpp
@@ -115,7 +115,7 @@ public:
using InstrumentPtr = std::unique_ptr<Instrument>;
template<typename... Args>
- ScopedProfilingEvent(const BackendId& backendId, const std::string& name, Args... args)
+ ScopedProfilingEvent(const BackendId& backendId, const std::string& name, Args&&... args)
: m_Event(nullptr)
, m_Profiler(ProfilerManager::GetInstance().GetProfiler())
{
@@ -123,7 +123,7 @@ public:
{
std::vector<InstrumentPtr> instruments(0);
instruments.reserve(sizeof...(args)); //One allocation
- ConstructNextInVector(instruments, args...);
+ ConstructNextInVector(instruments, std::forward<Args>(args)...);
m_Event = m_Profiler->BeginEvent(backendId, name, std::move(instruments));
}
}
@@ -144,10 +144,10 @@ private:
}
template<typename Arg, typename... Args>
- void ConstructNextInVector(std::vector<InstrumentPtr>& instruments, Arg arg, Args... args)
+ void ConstructNextInVector(std::vector<InstrumentPtr>& instruments, Arg&& arg, Args&&... args)
{
- instruments.emplace_back(std::make_unique<Arg>(arg));
- ConstructNextInVector(instruments, args...);
+ instruments.emplace_back(std::make_unique<Arg>(std::forward<Arg>(arg)));
+ ConstructNextInVector(instruments, std::forward<Args>(args)...);
}
Event* m_Event; ///< Event to track