Class DispatchContextObj#

Inheritance Relationships#

Base Type#

  • public ffi::Object

Class Documentation#

class DispatchContextObj : public ffi::Object#

The context information of the kernel required by op dispatch.

Public Functions

inline DispatchContextObj(Target target, ThreadScope thread_scope)#
inline explicit DispatchContextObj(ffi::UnsafeInit)#
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.

void AddInitStmt(Stmt stmt, bool host = false)#

Add an initialization statement to be inserted.

void AddPostTensorDefStmt(TensorVar tensor, Stmt stmt)#

Add a statement to be inserted after a tensor’s definition.

inline void SharedStateSet(ffi::String key, ffi::ObjectRef value)#

Set a value in the shared state cache.

inline ffi::Optional<ffi::ObjectRef> SharedStateGet(ffi::String key)#

Get a value from the shared state cache.

Public Members

Target target#

The target of the kernel.

ThreadScope thread_scope#

The thread scope of the operator.

ffi::Map<ffi::String, ffi::Tuple<PrimVar, PrimExpr>> launch_params#

Hardware tag to (index variable, extent) launch parameters.

ffi::Map<Var, Range> var_range_map#

A map from loop variables to their ranges.

bool alloc_only#

Whether the dispatch context is only used for tensor allocation.

ffi::Map<ffi::String, ffi::ObjectRef> callbacks#

Callback to be handled when the operator is scheduled.

ffi::Map<ffi::String, ffi::ObjectRef> shared_state#

Shared state that persists across dispatch calls within a single lowering pass.

ffi::Map<ffi::String, ffi::Array<PrimExpr>> inter#

ExecContext inter-team view at this op site.

Maps axis name (“laneid”/”warpid”/”cta_id”/”wid_in_wg”/”wgid”) to a 2-element [extent, offset] PrimExpr array. Empty map = no ExecContext tracking available (fallback for unresolved filters, pre-Phase-4 call sites, etc.); dispatchers should fall back to thread_scope.local_name in that case.

ffi::Map<ffi::String, ffi::Array<PrimExpr>> intra#

ExecContext intra-team view. Same encoding as inter.

ffi::String scope_kind#

Scope kind string (“kernel”/”cta”/”warpgroup”/”warp”/”thread”/”cluster”).

Public Static Functions

static inline void RegisterReflection()#
static inline int32_t _GetOrAllocRuntimeTypeIndex()#
static inline int32_t RuntimeTypeIndex() noexcept#