23 #ifndef TVM_TIRX_TIRX_OP_H_
24 #define TVM_TIRX_TIRX_OP_H_
78 namespace refl = tvm::ffi::reflection;
79 refl::ObjectDef<ScheduleContextNode>()
117 ffi::Map<ffi::String, IterVar> launch_params = {},
118 ffi::Map<Var, Range> var_range_map = {},
bool alloc_only =
false,
119 ffi::Map<ffi::String, ffi::ObjectRef> callbacks = {});
160 ffi::Map<ffi::String, ffi::Array<PrimExpr>>
inter;
162 ffi::Map<ffi::String, ffi::Array<PrimExpr>>
intra;
167 namespace refl = tvm::ffi::reflection;
168 refl::ObjectDef<DispatchContextNode>()
205 ffi::Map<ffi::String, IterVar> launch_params = {},
206 ffi::Map<Var, Range> var_range_map = {},
bool alloc_only =
false,
207 ffi::Map<ffi::String, ffi::ObjectRef> callbacks = {},
208 ffi::Map<ffi::String, ffi::ObjectRef> shared_state = {},
209 ffi::Map<ffi::String, ffi::Array<PrimExpr>> inter = {},
210 ffi::Map<ffi::String, ffi::Array<PrimExpr>> intra = {},
211 ffi::String scope_kind =
"");
Managed reference class to OpNode.
Definition: op.h:131
Managed reference class to TargetNode.
Definition: target.h:135
Buffer is a symbolic n-darray structure. It is a composition of primitive symbolic types,...
Definition: buffer.h:172
The context information of the kernel required by op dispatch.
Definition: tirx_op.h:135
bool alloc_only
Whether the dispatch context is only used for buffer allocation.
Definition: tirx_op.h:146
ffi::Map< ffi::String, ffi::ObjectRef > shared_state
Shared state that persists across dispatch calls within a single lowering pass.
Definition: tirx_op.h:150
ffi::Map< ffi::String, ffi::ObjectRef > callbacks
Callback to be handled when the operator is scheduled.
Definition: tirx_op.h:148
ExecScope exec_scope
The exec scope of the operator.
Definition: tirx_op.h:140
static void RegisterReflection()
Definition: tirx_op.h:166
ffi::Map< ffi::String, IterVar > launch_params
The kernel launch parameters.
Definition: tirx_op.h:142
ffi::String scope_kind
Scope kind string ("kernel"/"cta"/"warpgroup"/"warp"/"thread"/"cluster").
Definition: tirx_op.h:164
Target target
The target of the kernel.
Definition: tirx_op.h:138
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:160
ffi::Map< Var, Range > var_range_map
A map from loop variables to their ranges.
Definition: tirx_op.h:144
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:162
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:202
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:234
The context information of the kernel required by op schedule.
Definition: tirx_op.h:62
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
void AddAllocBuffer(Buffer buffer)
Add a buffer to be allocated in the kernel.
ffi::Map< Var, Range > var_range_map
A map from loop variables to their ranges.
Definition: tirx_op.h:71
Target target
The target of the kernel.
Definition: tirx_op.h:65
bool alloc_only
Whether the schedule context is only used for buffer allocation.
Definition: tirx_op.h:73
ffi::Map< ffi::String, IterVar > launch_params
The kernel launch parameters.
Definition: tirx_op.h:69
static void RegisterReflection()
Definition: tirx_op.h:77
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.ScheduleContext", ScheduleContextNode, ffi::Object)
void AddInitStmt(Stmt stmt, bool host=false)
Add an initialization statement to be inserted.
Managed reference to ScheduleContextNode.
Definition: tirx_op.h:105
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(ScheduleContext, ffi::ObjectRef, ScheduleContextNode)
ScheduleContext(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={})
Constructor.
Container of all statements.
Definition: stmt.h:67
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 & permute_dims()
See pesudo code below:
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:
ffi::TypedFunction< Stmt(tvm::Op, ffi::Array< ffi::ObjectRef >, ScheduleContext)> FOpScheduler
The type of the function that schedules a TIRX operator.
Definition: tirx_op.h:130
const Op & gemm()
See pesudo code below:
const Op & copy()
See pesudo code below:
const Op & tvm_kernel_replace_point()
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:37
Compilation target object.