Gromacs  2018.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
GpuRegionTimerWrapper< framework > Class Template Reference

#include <gromacs/gpu_utils/gpuregiontimer.h>

Description

template<GpuFramework framework>
class GpuRegionTimerWrapper< framework >

This is a GPU region timing wrapper class. It allows for host-side tracking of the accumulated execution timespans in GPU code (measuring kernel or transfers duration). It also partially tracks the correctness of the timer state transitions, as far as current implementation allows (see TODO in getLastRangeTime() for a disabled check). Internally it uses GpuRegionTimerImpl for measuring regions.

Public Member Functions

void openTimingRegion (CommandStream s)
 To be called before the region start. More...
 
void closeTimingRegion (CommandStream s)
 To be called after the region end. More...
 
double getLastRangeTime ()
 Accumulates the last timespan of all the events used into the the total duration, and resets the internal timer state. To be called after closeTimingRegion() and the command stream of the event having been synchronized. More...
 
void reset ()
 Resets the implementation and total time/call count to zeroes.
 
double getTotalTime () const
 Gets total time recorded (in milliseconds).
 
unsigned int getCallCount () const
 Gets total call count recorded.
 
CommandEvent * fetchNextEvent ()
 Gets a pointer to a new timing event for passing into individual GPU API calls within the region if they require it (e.g. on OpenCL). More...
 

Member Function Documentation

template<GpuFramework framework>
void GpuRegionTimerWrapper< framework >::closeTimingRegion ( CommandStream  s)
inline

To be called after the region end.

Parameters
[in]sThe GPU command stream where the event being measured takes place.
template<GpuFramework framework>
CommandEvent* GpuRegionTimerWrapper< framework >::fetchNextEvent ( )
inline

Gets a pointer to a new timing event for passing into individual GPU API calls within the region if they require it (e.g. on OpenCL).

Returns
The pointer to the underlying single command timing event.
template<GpuFramework framework>
double GpuRegionTimerWrapper< framework >::getLastRangeTime ( )
inline

Accumulates the last timespan of all the events used into the the total duration, and resets the internal timer state. To be called after closeTimingRegion() and the command stream of the event having been synchronized.

Returns
The last timespan (in milliseconds).
template<GpuFramework framework>
void GpuRegionTimerWrapper< framework >::openTimingRegion ( CommandStream  s)
inline

To be called before the region start.

Parameters
[in]sThe GPU command stream where the event being measured takes place.

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