tvm
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Typedefs
instruction.h File Reference
#include <tvm/node/reflection.h>
#include <utility>
Include dependency graph for instruction.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tvm::tir::InstructionKindNode
 Kind of an instruction, e.g. Split, Reorder, etc. Besides the name, every kind of instruction has its own properties, including: 1) A boolean indicating if the instruction is pure, i.e. change nothing in the schedule state 2) A functor that applies the instruction to a TensorIR schedule 3) A functor that converts the instruction to a statement in python syntax 4) A functor that serialize its attributes to JSON 5) A functor that deserialize its attributes from JSON. More...
 
class  tvm::tir::InstructionKind
 Managed reference to InstructionKindNode. More...
 
class  tvm::tir::InstructionNode
 Schedule instructions each corresponds to a schedule primitive. More...
 
class  tvm::tir::Instruction
 Managed reference to InstructionNode. More...
 
class  tvm::tir::InstructionKindRegEntry
 An entry in the registry of InstructionKind. More...
 

Namespaces

 tvm
 Performance counters for profiling via the PAPI library.
 
 tvm::tir
 

Macros

#define TVM_INST_KIND_REGISTER_VAR_DEF    static DMLC_ATTRIBUTE_UNUSED ::tvm::tir::InstructionKindRegEntry& __make_##InstructionKind
 A helper macro to register InstructionKind, only used in TVM_REGISTER_INST_KIND More...
 
#define TVM_REGISTER_INST_KIND(InstructionKindName)
 Register an InstructionKind. More...
 

Typedefs

using tvm::tir::FInstructionApply = runtime::TypedPackedFunc< Array< ObjectRef >(Schedule sch, const Array< ObjectRef > &inputs, const Array< ObjectRef > &attrs, const Optional< ObjectRef > &decision)>
 Type of the functor that applies the instruction to a TensorIR schedule. More...
 
using tvm::tir::FInstructionAsPython = runtime::TypedPackedFunc< String(const Array< ObjectRef > &inputs, const Array< ObjectRef > &attrs, const Optional< ObjectRef > &decision, const Array< String > &outputs)>
 Type of the functor that converts the instruction to a statement in python syntax. More...
 
using tvm::tir::FInstructionAttrsAsJSON = runtime::TypedPackedFunc< ObjectRef(Array< ObjectRef > attrs)>
 Type of the functor that serialize its attributes to JSON. More...
 
using tvm::tir::FInstructionAttrsFromJSON = runtime::TypedPackedFunc< Array< ObjectRef >(ObjectRef json_attrs)>
 Type of the functor that deserialize its attributes from JSON. More...
 

Macro Definition Documentation

◆ TVM_INST_KIND_REGISTER_VAR_DEF

#define TVM_INST_KIND_REGISTER_VAR_DEF    static DMLC_ATTRIBUTE_UNUSED ::tvm::tir::InstructionKindRegEntry& __make_##InstructionKind

A helper macro to register InstructionKind, only used in TVM_REGISTER_INST_KIND

Note
This macro is not user-facing.
See also
TVM_REGISTER_INST_KIND

◆ TVM_REGISTER_INST_KIND

#define TVM_REGISTER_INST_KIND (   InstructionKindName)
Value:
static InstructionKindRegEntry & RegisterOrGet(const String &name)
InstructionKindRegEntry & set_name()
Definition: instruction.h:241
#define TVM_INST_KIND_REGISTER_VAR_DEF
A helper macro to register InstructionKind, only used in TVM_REGISTER_INST_KIND
Definition: instruction.h:212
#define TVM_STR_CONCAT(__x, __y)
Definition: object.h:716

Register an InstructionKind.

Parameters
InstructionKindNameThe name of the InstructionKind

Example:

TVM_REGISTER_INST_KIND("ComputeInline")
.set_is_pure(false)
.set_apply_to_schedule(ApplyToSchedule)
.set_attrs_as_json(AttrsAsJSON)
.set_attrs_from_json(AttrsFromJSON)
.set_as_python(AsPython);
#define TVM_REGISTER_INST_KIND(InstructionKindName)
Register an InstructionKind.
Definition: instruction.h:232