Gromacs
2024.4
|
#include <gromacs/gpu_utils/gpuregiontimer.h>
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 (const DeviceStream &deviceStream) |
To be called before the region start. More... | |
void | closeTimingRegion (const DeviceStream &deviceStream) |
To be called after the region end. More... | |
double | getLastRangeTime () |
Accumulates the last timespan of all the events used into 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... | |
|
inline |
To be called after the region end.
[in] | deviceStream | The GPU command stream where the event being measured takes place. |
|
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).
|
inline |
Accumulates the last timespan of all the events used into the total duration, and resets the internal timer state. To be called after closeTimingRegion() and the command stream of the event having been synchronized.
|
inline |
To be called before the region start.
[in] | deviceStream | The GPU command stream where the event being measured takes place. |