From 72f4ae5a53fe24226ff16ed9c339171887d74874 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Wed, 7 Nov 2018 17:33:54 +0000 Subject: COMPMID-1777: Add option to make instruments output timestamps instead of duration Change-Id: Iafc1d6cd8003de64a3439ad807f4002036c73a73 --- tests/framework/instruments/OpenCLTimer.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/framework/instruments/OpenCLTimer.h') diff --git a/tests/framework/instruments/OpenCLTimer.h b/tests/framework/instruments/OpenCLTimer.h index c5f3bce92a..8722e6b348 100644 --- a/tests/framework/instruments/OpenCLTimer.h +++ b/tests/framework/instruments/OpenCLTimer.h @@ -41,14 +41,15 @@ namespace test namespace framework { /** Instrument creating measurements based on the information returned by clGetEventProfilingInfo for each OpenCL kernel executed*/ -class OpenCLTimer : public Instrument +template +class OpenCLClock : public Instrument { public: /** Construct an OpenCL timer. * * @param[in] scale_factor Measurement scale factor. */ - OpenCLTimer(ScaleFactor scale_factor); + OpenCLClock(ScaleFactor scale_factor); std::string id() const override; void test_start() override; void start() override; @@ -60,7 +61,7 @@ private: #ifdef ARM_COMPUTE_CL struct kernel_info { - cl::Event event{}; /**< OpenCL event associated to the kernel enqueue */ + ::cl::Event event{}; /**< OpenCL event associated to the kernel enqueue */ std::string name{}; /**< OpenCL Kernel name */ }; std::list _kernels; @@ -73,6 +74,10 @@ private: private: float _scale_factor{}; }; + +using OpenCLTimer = OpenCLClock; +using OpenCLTimestamps = OpenCLClock; + } // namespace framework } // namespace test } // namespace arm_compute -- cgit v1.2.1