aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/instruments/OpenCLTimer.h
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-11-07 17:33:54 +0000
committerAnthony Barbier <Anthony.barbier@arm.com>2018-11-08 14:19:59 +0000
commit72f4ae5a53fe24226ff16ed9c339171887d74874 (patch)
treed43c9b20a3420e0785bec0c4439763411439b891 /tests/framework/instruments/OpenCLTimer.h
parentd2048ce58a88853cee6cdd67fe0d6f09c3e212b0 (diff)
downloadComputeLibrary-72f4ae5a53fe24226ff16ed9c339171887d74874.tar.gz
COMPMID-1777: Add option to make instruments output timestamps instead of duration
Change-Id: Iafc1d6cd8003de64a3439ad807f4002036c73a73
Diffstat (limited to 'tests/framework/instruments/OpenCLTimer.h')
-rw-r--r--tests/framework/instruments/OpenCLTimer.h11
1 files changed, 8 insertions, 3 deletions
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 <bool output_timestamps>
+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<kernel_info> _kernels;
@@ -73,6 +74,10 @@ private:
private:
float _scale_factor{};
};
+
+using OpenCLTimer = OpenCLClock<false>;
+using OpenCLTimestamps = OpenCLClock<true>;
+
} // namespace framework
} // namespace test
} // namespace arm_compute