26 #ifndef TVM_IR_INSTRUMENT_H_
27 #define TVM_IR_INSTRUMENT_H_
29 #include <tvm/ffi/reflection/registry.h>
30 #include <tvm/ffi/string.h>
45 namespace instrument {
145 static constexpr
const char*
_type_key =
"instrument.PassInstrument";
Managed reference class to IRModuleNode.
Definition: module.h:257
PassInstrumentNode forms an instrument implementation. It provides API for users to register callback...
Definition: instrument.h:103
virtual void ExitPassContext() const =0
Instrument when exiting PassContext. Called once within a PassContext.
static constexpr const char * _type_key
Definition: instrument.h:145
virtual bool ShouldRun(const IRModule &mod, const transform::PassInfo &info) const =0
Determine whether to run the pass or not. Called multiple times depend on number of passes.
virtual void RunAfterPass(const IRModule &mod, const transform::PassInfo &info) const =0
Instrument after pass run. Called multiple time depend on number of passes.
virtual void RunBeforePass(const IRModule &mod, const transform::PassInfo &info) const =0
Instrument before pass run. Called multiple times depend on number of passes.
virtual ~PassInstrumentNode()
Definition: instrument.h:108
virtual void EnterPassContext() const =0
Instrument when entering PassContext. Called once within a PassContext.
String name
Name of this pass instrument object.
Definition: instrument.h:106
static void RegisterReflection()
Definition: instrument.h:140
TVM_DECLARE_BASE_OBJECT_INFO(PassInstrumentNode, Object)
Managed reference class for PassInstrumentNode.
Definition: instrument.h:153
TVM_DEFINE_OBJECT_REF_METHODS(PassInstrument, ObjectRef, PassInstrumentNode)
Definition: repr_printer.h:91
IRModuleFrame IRModule()
The IRModule declaration statement.
Definition: module.h:250
tvm::PrimExpr mod(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:306
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
Definitions and helper macros for IR/AST nodes.