HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::GpuTimer Class Reference

#include <GpuTimer.h>

Public Member Functions

 GpuTimer (cudaStream_t stream=0)
 Default constructor. More...
 
 GpuTimer (const std::string &msg, cudaStream_t stream=0, std::ostream &os=std::cerr)
 Construct and start the timer. More...
 
 ~GpuTimer ()
 Destructor. More...
 
void start ()
 Start the timer. More...
 
void start (const std::string &msg, std::ostream &os=std::cerr)
 Start the timer. More...
 
void start (const char *msg, std::ostream &os=std::cerr)
 Start the timer. More...
 
float elapsed ()
 elapsed time (since start) in miliseconds More...
 
void stop (std::ostream &os=std::cerr)
 stop the timer More...
 
void restart (const std::string &msg, std::ostream &os=std::cerr)
 stop and start the timer More...
 

Detailed Description

Definition at line 19 of file GpuTimer.h.

Constructor & Destructor Documentation

nanovdb::GpuTimer::GpuTimer ( cudaStream_t  stream = 0)
inline

Default constructor.

Parameters
streamCUDA stream to be timed (defaults to stream 0)
Note
Starts the timer

Definition at line 28 of file GpuTimer.h.

nanovdb::GpuTimer::GpuTimer ( const std::string msg,
cudaStream_t  stream = 0,
std::ostream &  os = std::cerr 
)
inline

Construct and start the timer.

Parameters
msgstring message to be printed when timer is started
streamCUDA stream to be timed (defaults to stream 0)
osoutput stream for the message above

Definition at line 39 of file GpuTimer.h.

nanovdb::GpuTimer::~GpuTimer ( )
inline

Destructor.

Definition at line 49 of file GpuTimer.h.

Member Function Documentation

float nanovdb::GpuTimer::elapsed ( )
inline

elapsed time (since start) in miliseconds

Returns
elapsed time (since start) in miliseconds

Definition at line 81 of file GpuTimer.h.

void nanovdb::GpuTimer::restart ( const std::string msg,
std::ostream &  os = std::cerr 
)
inline

stop and start the timer

Parameters
msgstring message to be printed when timer is started
Warning
Remember to call start before restart

Definition at line 101 of file GpuTimer.h.

void nanovdb::GpuTimer::start ( )
inline

Start the timer.

Parameters
streamCUDA stream to be timed (defaults to stream 0)
osoutput stream for the message above

Definition at line 58 of file GpuTimer.h.

void nanovdb::GpuTimer::start ( const std::string msg,
std::ostream &  os = std::cerr 
)
inline

Start the timer.

Parameters
msgstring message to be printed when timer is started
osoutput stream for the message above

Definition at line 64 of file GpuTimer.h.

void nanovdb::GpuTimer::start ( const char *  msg,
std::ostream &  os = std::cerr 
)
inline

Start the timer.

Parameters
msgstring message to be printed when timer is started
osoutput stream for the message above

Definition at line 73 of file GpuTimer.h.

void nanovdb::GpuTimer::stop ( std::ostream &  os = std::cerr)
inline

stop the timer

Parameters
osoutput stream for the message above

Definition at line 92 of file GpuTimer.h.


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