CLUtils  0.2.1
 Hosted by GitHub
Public Member Functions | List of all members
clutils::GPUTimer< period > Class Template Reference

A class for profiling CL devices. More...

#include <CLUtils.hpp>

Public Member Functions

 GPUTimer (cl::Device &device)
 
cl::Event & event ()
 Returns a new unpopulated event. More...
 
void wait ()
 This is an interface for cl::Event::wait.
 
double duration ()
 Returns the time measured by the timer. More...
 

Detailed Description

template<typename period = std::milli>
class clutils::GPUTimer< period >

A class for profiling CL devices.

Template Parameters
periodthe unit of time for the value returned by duration. It is declared as an std::ratio<std::intmax_t num, std::intmax_t den>.

Constructor & Destructor Documentation

template<typename period = std::milli>
clutils::GPUTimer< period >::GPUTimer ( cl::Device &  device)
inline
Parameters
[in]devicethe targeted for profiling CL device.

Member Function Documentation

template<typename period = std::milli>
double clutils::GPUTimer< period >::duration ( )
inline

Returns the time measured by the timer.

Note
It's important that it's called after a call to wait.
Returns
The time in period units.
template<typename period = std::milli>
cl::Event& clutils::GPUTimer< period >::event ( )
inline

Returns a new unpopulated event.

The last populated event gets dismissed.

Returns
An event for the profiling process.

The documentation for this class was generated from the following file: