diff options
author | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-07 17:33:54 +0000 |
---|---|---|
committer | Anthony Barbier <Anthony.barbier@arm.com> | 2018-11-08 14:19:59 +0000 |
commit | 72f4ae5a53fe24226ff16ed9c339171887d74874 (patch) | |
tree | d43c9b20a3420e0785bec0c4439763411439b891 /tests/framework/instruments/SchedulerTimer.h | |
parent | d2048ce58a88853cee6cdd67fe0d6f09c3e212b0 (diff) | |
download | ComputeLibrary-72f4ae5a53fe24226ff16ed9c339171887d74874.tar.gz |
COMPMID-1777: Add option to make instruments output timestamps instead of duration
Change-Id: Iafc1d6cd8003de64a3439ad807f4002036c73a73
Diffstat (limited to 'tests/framework/instruments/SchedulerTimer.h')
-rw-r--r-- | tests/framework/instruments/SchedulerTimer.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/framework/instruments/SchedulerTimer.h b/tests/framework/instruments/SchedulerTimer.h index 55d5f25b75..64adb488ae 100644 --- a/tests/framework/instruments/SchedulerTimer.h +++ b/tests/framework/instruments/SchedulerTimer.h @@ -37,19 +37,26 @@ namespace test namespace framework { /** Instrument creating measurements based on the information returned by clGetEventProfilingInfo for each OpenCL kernel executed*/ -class SchedulerTimer : public Instrument +template <bool output_timestamps> +class SchedulerClock : public Instrument { public: /** Construct a Scheduler timer. * * @param[in] scale_factor Measurement scale factor. */ - SchedulerTimer(ScaleFactor scale_factor); + SchedulerClock(ScaleFactor scale_factor); /** Prevent instances of this class from being copy constructed */ - SchedulerTimer(const SchedulerTimer &) = delete; + SchedulerClock(const SchedulerClock &) = delete; /** Prevent instances of this class from being copied */ - SchedulerTimer &operator=(const SchedulerTimer &) = delete; + SchedulerClock &operator=(const SchedulerClock &) = delete; + /** Use the default move assignment operator */ + SchedulerClock &operator=(SchedulerClock &&) = default; + /** Use the default move constructor */ + SchedulerClock(SchedulerClock &&) = default; + /** Use the default destructor */ + ~SchedulerClock() = default; std::string id() const override; void test_start() override; @@ -73,6 +80,10 @@ private: ScaleFactor _scale_factor; std::shared_ptr<IScheduler> _interceptor; }; + +using SchedulerTimer = SchedulerClock<false>; +using SchedulerTimestamps = SchedulerClock<true>; + } // namespace framework } // namespace test } // namespace arm_compute |