23 #ifndef TVM_TIRX_TIRX_OP_H_
24 #define TVM_TIRX_TIRX_OP_H_
87 ffi::Map<ffi::String, ffi::Array<PrimExpr>>
inter;
89 ffi::Map<ffi::String, ffi::Array<PrimExpr>>
intra;
94 namespace refl = tvm::ffi::reflection;
95 refl::ObjectDef<DispatchContextNode>()
132 ffi::Map<ffi::String, IterVar> launch_params = {},
133 ffi::Map<Var, Range> var_range_map = {},
bool alloc_only =
false,
134 ffi::Map<ffi::String, ffi::ObjectRef> callbacks = {},
135 ffi::Map<ffi::String, ffi::ObjectRef> shared_state = {},
136 ffi::Map<ffi::String, ffi::Array<PrimExpr>> inter = {},
137 ffi::Map<ffi::String, ffi::Array<PrimExpr>> intra = {},
138 ffi::String scope_kind =
"");
Managed reference class to OpNode.
Definition: op.h:163
Managed reference class to TargetNode.
Definition: target.h:134
Buffer is a symbolic n-darray structure. It is a composition of primitive symbolic types,...
Definition: buffer.h:187
The context information of the kernel required by op dispatch.
Definition: tirx_op.h:62
bool alloc_only
Whether the dispatch context is only used for buffer allocation.
Definition: tirx_op.h:73
ffi::Map< ffi::String, ffi::ObjectRef > shared_state
Shared state that persists across dispatch calls within a single lowering pass.
Definition: tirx_op.h:77
ffi::Map< ffi::String, ffi::ObjectRef > callbacks
Callback to be handled when the operator is scheduled.
Definition: tirx_op.h:75
ExecScope exec_scope
The exec scope of the operator.
Definition: tirx_op.h:67
static void RegisterReflection()
Definition: tirx_op.h:93
ffi::Map< ffi::String, IterVar > launch_params
The kernel launch parameters.
Definition: tirx_op.h:69
ffi::String scope_kind
Scope kind string ("kernel"/"cta"/"warpgroup"/"warp"/"thread"/"cluster").
Definition: tirx_op.h:91
Target target
The target of the kernel.
Definition: tirx_op.h:65
void SharedStateSet(ffi::String key, ffi::ObjectRef value)
Set a value in the shared state cache.
ffi::Map< ffi::String, ffi::Array< PrimExpr > > inter
ExecContext inter-team view at this op site.
Definition: tirx_op.h:87
ffi::Map< Var, Range > var_range_map
A map from loop variables to their ranges.
Definition: tirx_op.h:71
void AddAllocBuffer(Buffer buffer)
Add a buffer to be allocated in the kernel.
ffi::Map< ffi::String, ffi::Array< PrimExpr > > intra
ExecContext intra-team view. Same encoding as inter.
Definition: tirx_op.h:89
void AddPostBufferDefStmt(Buffer buffer, Stmt stmt)
Add a statement to be inserted after a buffer's definition.
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.DispatchContext", DispatchContextNode, ffi::Object)
ffi::Optional< ffi::ObjectRef > SharedStateGet(ffi::String key)
Get a value from the shared state cache.
void AddInitStmt(Stmt stmt, bool host=false)
Add an initialization statement to be inserted.
Managed reference to DispatchContextNode.
Definition: tirx_op.h:129
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(DispatchContext, ffi::ObjectRef, DispatchContextNode)
DispatchContext(Target target, ExecScope exec_scope, ffi::Map< ffi::String, IterVar > launch_params={}, ffi::Map< Var, Range > var_range_map={}, bool alloc_only=false, ffi::Map< ffi::String, ffi::ObjectRef > callbacks={}, ffi::Map< ffi::String, ffi::ObjectRef > shared_state={}, ffi::Map< ffi::String, ffi::Array< PrimExpr >> inter={}, ffi::Map< ffi::String, ffi::Array< PrimExpr >> intra={}, ffi::String scope_kind="")
Definition: exec_scope.h:228
Container of all statements.
Definition: stmt.h:64
Primitive operators(builtin intrinsics) and registry for them.
constexpr const char * kPrivateAlloc
The buffers allocated by the operator.
Definition: tirx_op.h:44
constexpr const char * kPostBufferDefStmt
Statements to be inserted after a specific buffer's definition (DeclBuffer/AllocBuffer)....
Definition: tirx_op.h:56
constexpr const char * kDeviceInitStmt
The initialization statement of the operator. which will be inserted at the beginning of the kernel.
Definition: tirx_op.h:48
constexpr const char * kHostInitStmt
The initialization statement of the operator. which will be inserted at the beginning of the kernel.
Definition: tirx_op.h:52
const Op & binary_chain()
const Op & copy_async()
See pesudo code below:
const Op & unary_reduce()
const Op & reduce_negate()
const Op & cast()
See pesudo code below:
const Op & gemm_async()
See pesudo code below:
const Op & binary_reduce()
const Op & fill()
See pesudo code below:
const Op & permute_layout()
const Op & gemm()
See pesudo code below:
const Op & copy()
See pesudo code below:
ffi::TypedFunction< void(tvm::Op, ffi::Array< ffi::ObjectRef >)> FArgSanitizer
The type of the function that sanitizes the arguments of a TIRX operator.
Definition: tirx_op.h:40
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:40
Compilation target object.