28 #ifndef TVM_TIRX_EXEC_CONTEXT_H_
29 #define TVM_TIRX_EXEC_CONTEXT_H_
36 #include <unordered_map>
69 bool HasAxis(
const std::string& axis)
const;
81 std::unordered_map<std::string, AxisRange>
inter;
82 std::unordered_map<std::string, AxisRange>
intra;
88 const std::vector<std::pair<std::string, int64_t>>& cta_axes);
122 const std::vector<std::pair<std::string, int64_t>>& cta_axes);
126 std::string* err)
const;
130 std::string* err)
const;
134 std::string* err)
const;
150 const std::unordered_map<std::string, AxisRange>& side);
Reference to PrimExprNode.
Definition: expr.h:126
const Op & selector()
Analysis-only active-thread selector.
ffi::Map< ffi::String, ffi::Array< PrimExpr > > 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,...
ScopeKind
The target execution scope kind of an ExecScopeStmt.
Definition: exec_scope.h:45
constexpr int kWgSize
Warpgroup size in warps (hardware-fixed).
Definition: exec_context.h:43
ActiveSet InitialActiveSet(int64_t lane_ext, int64_t warp_ext, int64_t cta_ext)
Initial A at T.kernel() entry: all threads active, offsets zero.
bool ScopeSwitch(const ActiveSet &A, ScopeKind scope_kind, ExecSplit *out, std::string *err)
Factor A into (inter, intra) for target scope_kind.
ScopeBinding
The binding between a parent scope and a child scope as used by a ScopeIdDef. The closed enum of vali...
Definition: exec_scope.h:81
bool 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.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
Active thread set A. The source of truth is layout: shard = active axes with extents offset = per-axi...
Definition: exec_context.h:64
ActiveSet WithAxis(const std::string &axis, const AxisRange &range) const
bool HasAxis(const std::string &axis) const
bool GetAxis(const std::string &axis, AxisRange *out) const
std::vector< std::string > AxisNames() const
TileLayout layout
Definition: exec_context.h:65
Active slice offset + stride * [0, extent) encoded on one TileLayout axis.
Definition: exec_context.h:46
PrimExpr stride
Definition: exec_context.h:49
PrimExpr extent
Definition: exec_context.h:47
bool Intersect(int64_t lo, int64_t hi, AxisRange *out) const
Intersect with [lo, hi). Returns false if the result is empty.
PrimExpr offset
Definition: exec_context.h:48
bool Modulo(int64_t modulus, int64_t residue, AxisRange *out) const
Intersect with values satisfying axis % modulus == residue.
Per-program-point ExecContext: active set + scope kind + split.
Definition: exec_context.h:114
bool WithSelector(ScopeBinding binding, PrimExpr selector, ExecContext *out, std::string *err) const
Apply a unique-value selector filter on one scope id Var.
ScopeKind scope_kind
Definition: exec_context.h:116
ExecSplit split
Definition: exec_context.h:117
static ExecContext AtKernelEntry(int64_t lane_ext, int64_t warp_ext, int64_t cta_ext)
Kernel-entry ctor.
bool WithScopeSwitch(ScopeKind new_scope_kind, ExecContext *out, std::string *err) const
Apply scope_switch; A preserved, split recomputed for new scope_kind.
bool WithCtaAxisFilter(const std::string &axis, int64_t lo, int64_t hi, ExecContext *out, std::string *err) const
Apply filter on a factorized CTA axis such as cbx/cby/cbz.
ActiveSet A
Definition: exec_context.h:115
static ExecContext AtKernelEntry(int64_t lane_ext, int64_t warp_ext, int64_t cta_ext, const std::vector< std::pair< std::string, int64_t >> &cta_axes)
bool WithCtaAxisModulo(const std::string &axis, int64_t modulus, int64_t residue, ExecContext *out, std::string *err) const
Apply modulo filter on a factorized CTA axis such as cbx/cby/cbz.
bool WithFilter(ScopeBinding binding, int64_t lo, int64_t hi, ExecContext *out, std::string *err) const
Apply filter; scope_kind preserved, split recomputed.
One scope_switch split. Fields are sparse dicts keyed by active-set axis name, e.g....
Definition: exec_context.h:80
std::unordered_map< std::string, AxisRange > inter
Definition: exec_context.h:81
std::unordered_map< std::string, AxisRange > intra
Definition: exec_context.h:82