MLIR
20.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. More... | |
void | start () |
Start the timer. More... | |
void | stop () |
Stop the timer. More... | |
Timer | nest (const void *id, function_ref< std::string()> nameBuilder) |
Create a child timer nested within this one. More... | |
Timer | nest (TimingIdentifier name) |
See above. More... | |
Timer | nest (StringRef name) |
See above. More... | |
void | hide () |
Hide the timer in timing reports and directly show its children. More... | |
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 |
Referenced by nest().
|
default |
|
inlineprotected |
|
inline |
Hide the timer in timing reports and directly show its children.
Definition at line 247 of file Timing.h.
References mlir::TimingManager::hideTimer().
Referenced by mlir::TimingScope::hide().
|
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 mlir::TimingManager::nestTimer(), and Timer().
Referenced by mlir::TimingScope::nest(), and nest().
|
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 |
Start the timer.
This must be accompanied by a corresponding call to stop()
at a later point.
Definition at line 210 of file Timing.h.
References mlir::TimingManager::startTimer().
Referenced by mlir::TimingScope::TimingScope().
|
inline |
Stop the timer.
This must have been preceded by a corresponding call to start()
at an earlier point.
Definition at line 217 of file Timing.h.
References mlir::TimingManager::stopTimer().
Referenced by mlir::TimingScope::stop().
|
friend |