|
MLIR 22.0.0git
|
A handle for a timer in a TimingManager. More...
#include "mlir/Support/Timing.h"
Public Member Functions | |
| Timer ()=default | |
| Timer (const Timer &other)=default | |
| Timer (Timer &&other) | |
| Timer & | operator= (Timer &&other) |
| operator bool () const | |
| Returns whether this is a valid timer handle. | |
| void | start () |
| Start the timer. | |
| void | stop () |
| Stop the timer. | |
| Timer | nest (const void *id, function_ref< std::string()> nameBuilder) |
| Create a child timer nested within this one. | |
| Timer | nest (TimingIdentifier name) |
| See above. | |
| Timer | nest (StringRef name) |
| See above. | |
| void | hide () |
| Hide the timer in timing reports and directly show its children. | |
Protected Member Functions | |
| Timer (TimingManager &tm, void *handle) | |
Friends | |
| class | TimingManager |
A handle for a timer in a TimingManager.
This class encapsulates a pointer to a TimingManager and an opaque handle to a timer running within that manager. Libraries and infrastructure code operate on Timer rather than any concrete classes handed out by custom manager implementations.
|
default |
|
inline |
|
inlineprotected |
Definition at line 253 of file Timing.h.
References TimingManager.
|
inline |
|
inline |
Create a child timer nested within this one.
Multiple calls to this function with the same unique identifier id will return the same child timer. The timer must have been started when calling this function.
This function can be called from other threads, as long as this timer is not stopped before any uses of the child timer on the other thread are stopped.
The nameBuilder function is not guaranteed to be called.
Definition at line 231 of file Timing.h.
References Timer().
|
inline |
See above.
Definition at line 242 of file Timing.h.
References mlir::TimingIdentifier::get(), nest(), and Timer().
|
inline |
See above.
Definition at line 236 of file Timing.h.
References mlir::TimingIdentifier::getAsOpaquePointer(), nest(), and Timer().
|
inlineexplicit |
Returns whether this is a valid timer handle.
Invalid timer handles are used when timing is disabled in the TimingManager to keep the impact on performance low.
|
inline |
|
inline |
|
friend |
Definition at line 256 of file Timing.h.
References TimingManager.
Referenced by Timer(), and TimingManager.