aboutsummaryrefslogtreecommitdiff
path: root/src/backends/cl
diff options
context:
space:
mode:
authorKevin May <kevin.may@arm.com>2022-10-05 14:42:55 +0100
committerKevin May <kevin.may@arm.com>2022-10-11 10:53:06 +0000
commit251fd955c18434b7aa3f486374c4f1a15bbd160e (patch)
treec094dfe973f18ea16b3726b91767c3fcbf363dad /src/backends/cl
parente497ed17463820eb33ca051254efd08c892325b5 (diff)
downloadarmnn-251fd955c18434b7aa3f486374c4f1a15bbd160e.tar.gz
IVGCVSW-7222 Fix incorrect kernel measurements in profiling output
* Some CL kernels are not run after the first inference and this breaks the profiler which is expecting a measurement for every kernel each run * Add a function HasKernelMeasurements() to ascertain if the Event is returning kernel measurements and if so insert 0.0 values for any missing kernel measurements. * Fix ExecuteNetwork to only print a json object after all inferences have completed Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: I99f2bb0db847f5a52ab4c5705b072155c6b6f333
Diffstat (limited to 'src/backends/cl')
-rw-r--r--src/backends/cl/OpenClTimer.cpp5
-rw-r--r--src/backends/cl/OpenClTimer.hpp3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/backends/cl/OpenClTimer.cpp b/src/backends/cl/OpenClTimer.cpp
index a4958c10e0..a39377505d 100644
--- a/src/backends/cl/OpenClTimer.cpp
+++ b/src/backends/cl/OpenClTimer.cpp
@@ -85,6 +85,11 @@ void OpenClTimer::Stop()
CLSymbols::get().clEnqueueNDRangeKernel_ptr = m_OriginalEnqueueFunction;
}
+bool OpenClTimer::HasKernelMeasurements() const
+{
+ return m_Kernels.size() > 0;
+}
+
std::vector<Measurement> OpenClTimer::GetMeasurements() const
{
std::vector<Measurement> measurements;
diff --git a/src/backends/cl/OpenClTimer.hpp b/src/backends/cl/OpenClTimer.hpp
index 5539e885d8..e517fa4b8a 100644
--- a/src/backends/cl/OpenClTimer.hpp
+++ b/src/backends/cl/OpenClTimer.hpp
@@ -29,6 +29,9 @@ public:
/// Stop the OpenCl timer
void Stop() override;
+ /// Return true if this Instrument has kernels for recording measurements
+ bool HasKernelMeasurements() const override;
+
/// Get the name of the timer
/// \return Name of the timer
const char* GetName() const override { return "OpenClKernelTimer"; }