tvm
Classes | Namespaces | Functions | Variables
exec_context.h File Reference

Compile-time ExecContext state: the active thread set A as a TileLayout and the (inter, intra) split under the current scope kind, threaded through the IR walker so per-op lowerers see the precise execution shape at each site. More...

#include <tvm/tirx/exec_scope.h>
#include <tvm/tirx/layout.h>
#include <tvm/tirx/var.h>
#include <string>
#include <unordered_map>
#include <vector>
Include dependency graph for exec_context.h:

Go to the source code of this file.

Classes

struct  tvm::tirx::AxisRange
 Active slice offset + stride * [0, extent) encoded on one TileLayout axis. More...
 
struct  tvm::tirx::ActiveSet
 Active thread set A. The source of truth is layout: shard = active axes with extents offset = per-axis lower bound, possibly a selector PrimExpr. More...
 
struct  tvm::tirx::ExecSplit
 One scope_switch split. Fields are sparse dicts keyed by active-set axis name, e.g. laneid/warpid/cta_id/wid_in_wg/wgid or factorized CTA axes such as cbx/cby/cbz. An empty map denotes the empty layout (e.g. intra under scope_kind=thread). More...
 
struct  tvm::tirx::ExecContext
 Per-program-point ExecContext: active set + scope kind + split. More...
 

Namespaces

 tvm
 An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
 
 tvm::tirx
 

Functions

ActiveSet tvm::tirx::InitialActiveSet (int64_t lane_ext, int64_t warp_ext, int64_t cta_ext)
 Initial A at T.kernel() entry: all threads active, offsets zero. More...
 
ActiveSet tvm::tirx::InitialActiveSet (int64_t lane_ext, int64_t warp_ext, int64_t cta_ext, const std::vector< std::pair< std::string, int64_t >> &cta_axes)
 
bool tvm::tirx::FilterNarrow (const ActiveSet &A, ScopeBinding binding, int64_t lo, int64_t hi, ActiveSet *out, std::string *err)
 Narrow A on the lane bound to binding. More...
 
bool tvm::tirx::ScopeSwitch (const ActiveSet &A, ScopeKind scope_kind, ExecSplit *out, std::string *err)
 Factor A into (inter, intra) for target scope_kind. More...
 
ffi::Map< ffi::String, ffi::Array< PrimExpr > > tvm::tirx::EncodeSplitSide (const std::unordered_map< std::string, AxisRange > &side)
 Encode one side of an ExecSplit (inter or intra) as the FFI map used by DispatchContextNode::{inter, intra}: axis name -> [extent, offset] for unit-stride axes, or [extent, offset, stride] for strided axes. More...
 

Variables

constexpr int tvm::tirx::kWgSize = 4
 Warpgroup size in warps (hardware-fixed). More...
 

Detailed Description

Compile-time ExecContext state: the active thread set A as a TileLayout and the (inter, intra) split under the current scope kind, threaded through the IR walker so per-op lowerers see the precise execution shape at each site.

Mirrors the pure-Python implementation in python/tvm/tirx/exec_context.py.