20#ifndef TVM_TIRX_TILE_CONTEXT_H_
21#define TVM_TIRX_TILE_CONTEXT_H_
81 ffi::Map<ffi::String, ffi::Array<PrimExpr>>
inter;
83 ffi::Map<ffi::String, ffi::Array<PrimExpr>>
intra;
88 namespace refl = tvm::ffi::reflection;
89 refl::ObjectDef<DispatchContextObj>()
104 ffi::Map<ffi::String, ffi::Any> annotations = {});
128 ffi::Map<ffi::String, ffi::Tuple<PrimVar, PrimExpr>> launch_params = {},
129 ffi::Map<Var, Range> var_range_map = {},
bool alloc_only =
false,
130 ffi::Map<ffi::String, ffi::ObjectRef> callbacks = {},
131 ffi::Map<ffi::String, ffi::ObjectRef> shared_state = {},
132 ffi::Map<ffi::String, ffi::Array<PrimExpr>> inter = {},
133 ffi::Map<ffi::String, ffi::Array<PrimExpr>> intra = {}, ffi::String scope_kind =
"");
Container of all statements.
Definition stmt.h:62
Managed reference class to TargetObj.
Definition target.h:136
Definition exec_scope.h:47
Checked zero-state view over an ordinary VarNode with TensorType.
Definition expr.h:50
The context information of the kernel required by op dispatch.
Definition context.h:51
void AddPostTensorDefStmt(TensorVar tensor, Stmt stmt)
Add a statement to be inserted after a tensor's definition.
void AddAllocTensor(TensorVar tensor, ffi::Array< PrimExpr > allocated_addr={}, ffi::Map< ffi::String, ffi::Any > annotations={})
Add a tensor to be allocated in the kernel.
ffi::String scope_kind
Scope kind string ("kernel"/"cta"/"warpgroup"/"warp"/"thread"/"cluster").
Definition context.h:85
DispatchContextObj(Target target, ExecScope exec_scope)
Definition context.h:53
bool alloc_only
Whether the dispatch context is only used for tensor allocation.
Definition context.h:67
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 context.h:81
DispatchContextObj(ffi::UnsafeInit)
Definition context.h:55
ffi::Map< ffi::String, ffi::ObjectRef > callbacks
Callback to be handled when the operator is scheduled.
Definition context.h:69
ffi::Map< Var, Range > var_range_map
A map from loop variables to their ranges.
Definition context.h:65
ffi::Map< ffi::String, ffi::ObjectRef > shared_state
Shared state that persists across dispatch calls within a single lowering pass.
Definition context.h:71
ffi::Map< ffi::String, ffi::Array< PrimExpr > > intra
ExecContext intra-team view. Same encoding as inter.
Definition context.h:83
static void RegisterReflection()
Definition context.h:87
ExecScope exec_scope
The exec scope of the operator.
Definition context.h:61
ffi::Optional< ffi::ObjectRef > SharedStateGet(ffi::String key)
Get a value from the shared state cache.
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.DispatchContext", DispatchContextObj, ffi::Object)
void AddInitStmt(Stmt stmt, bool host=false)
Add an initialization statement to be inserted.
ffi::Map< ffi::String, ffi::Tuple< PrimVar, PrimExpr > > launch_params
Hardware tag to (index variable, extent) launch parameters.
Definition context.h:63
Target target
The target of the kernel.
Definition context.h:59
Managed reference to DispatchContextObj.
Definition context.h:124
TVM_TIRX_DLL DispatchContext(Target target, ExecScope exec_scope, ffi::Map< ffi::String, ffi::Tuple< PrimVar, PrimExpr > > 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="")
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(DispatchContext, ffi::ObjectRef, DispatchContextObj)
constexpr const char * kPostTensorDefStmt
Statements to be inserted after a specific tensor's definition (DeclTensor/AllocTensor)....
Definition context.h:45
constexpr const char * kDeviceInitStmt
The initialization statement of the operator. which will be inserted at the beginning of the kernel.
Definition context.h:37
constexpr const char * kHostInitStmt
The initialization statement of the operator. which will be inserted at the beginning of the kernel.
Definition context.h:41
constexpr const char * kPrivateAlloc
The allocation Bind statements requested by the operator.
Definition context.h:33
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
#define TVM_TIRX_DLL
Definition base.h:83
Compilation target object.
TIRx statements and shared statement entry header.