aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/NeonInterceptorScheduler.cpp
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2018-10-01 09:28:57 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-10 16:16:57 +0100
commite4ba53a85c559d4fe574305276ac815cf7995762 (patch)
treee3f8a3e1b54b2a9cf1e21909f5e4ad9e285be49d /src/armnn/NeonInterceptorScheduler.cpp
parentfcb382af87e79ae4bdc6a604241efbf2533e1737 (diff)
downloadarmnn-e4ba53a85c559d4fe574305276ac815cf7995762.tar.gz
IVGCVSW-1824 Fix slow profiling of neon. (~50% reduced end-to-end time)
Change-Id: I58295c298934317a2b365887bd9f9f6705cd0a21
Diffstat (limited to 'src/armnn/NeonInterceptorScheduler.cpp')
-rw-r--r--src/armnn/NeonInterceptorScheduler.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/armnn/NeonInterceptorScheduler.cpp b/src/armnn/NeonInterceptorScheduler.cpp
index 8363def68e..a5ca315345 100644
--- a/src/armnn/NeonInterceptorScheduler.cpp
+++ b/src/armnn/NeonInterceptorScheduler.cpp
@@ -9,9 +9,8 @@
namespace armnn{
-NeonInterceptorScheduler::NeonInterceptorScheduler(NeonTimer::KernelMeasurements& kernels,
- arm_compute::IScheduler &realScheduler)
- : m_Kernels(kernels), m_RealScheduler(realScheduler)
+NeonInterceptorScheduler::NeonInterceptorScheduler(arm_compute::IScheduler &realScheduler)
+ : m_RealScheduler(realScheduler)
{
}
@@ -27,32 +26,22 @@ unsigned int NeonInterceptorScheduler::num_threads() const
void NeonInterceptorScheduler::schedule(arm_compute::ICPPKernel* kernel, const Hints& hints)
{
- m_Timer.Start();
+ WallClockTimer::clock::time_point startTime = WallClockTimer::clock::now();
m_RealScheduler.schedule(kernel, hints.split_dimension());
- m_Timer.Stop();
+ WallClockTimer::clock::time_point stopTime = WallClockTimer::clock::now();
- std::vector<Measurement> measurements = m_Timer.GetMeasurements();
- BOOST_ASSERT(!measurements.empty());
-
- Measurement measurement(measurements.front()); // NOTE: 1st measurement is delta
- measurement.m_Name = kernel->name();
- m_Kernels.push_back(std::move(measurement));
+ const auto delta = std::chrono::duration<double, std::micro>(stopTime - startTime);
+ m_Kernels->emplace_back(kernel->name(), delta.count(), Measurement::Unit::TIME_US);
}
void NeonInterceptorScheduler::run_workloads(std::vector <Workload>& workloads)
{
- m_Timer.Start();
- // NOTE: we should think about utilising the tag to make profiling more understandable
+ WallClockTimer::clock::time_point startTime = WallClockTimer::clock::now();
m_RealScheduler.run_tagged_workloads(workloads, nullptr);
- m_Timer.Stop();
-
- std::vector<Measurement> measurements = m_Timer.GetMeasurements();
- BOOST_ASSERT_MSG(measurements.size() == 3, "WallClockTimer does not have correct amount of measurements.");
+ WallClockTimer::clock::time_point stopTime = WallClockTimer::clock::now();
- // WallClockTimer has 3 measurements, duration always being the first.
- Measurement measurement(measurements.front());
- measurement.m_Name = "Workload";
- m_Kernels.push_back(std::move(measurement));
+ const auto delta = std::chrono::duration<double, std::micro>(stopTime - startTime);
+ m_Kernels->emplace_back(std::string("Workload"), delta.count(), Measurement::Unit::TIME_US);
}
} // namespace armnn \ No newline at end of file