24 #ifndef TVM_TIR_STMT_H_
25 #define TVM_TIR_STMT_H_
27 #include <tvm/ffi/reflection/registry.h>
32 #include <type_traits>
64 class Stmt :
public ObjectRef {
83 refl::ObjectDef<LetStmtNode>()
126 refl::ObjectDef<AttrStmtNode>()
165 refl::ObjectDef<AssertStmtNode>()
208 refl::ObjectDef<BufferStoreNode>()
224 ffi::Optional<PrimExpr> predicate = std::nullopt,
256 refl::ObjectDef<AllocateNode>()
289 ffi::Map<ffi::String, ffi::Any> annotations = ffi::Map<ffi::String, ffi::Any>(),
306 refl::ObjectDef<DeclBufferNode>()
387 size_t size()
const {
return operator->()->size(); }
412 template <
typename... Args>
414 ffi::Array<Stmt> seq;
416 ffi::details::for_each(
Flattener(&seq), std::forward<Args>(seq_args)...);
420 }
else if (seq.size() == 1) {
427 if constexpr (
sizeof...(seq_args) == 1) {
429 SeqStmt original = opt.value();
430 bool all_same = [&]() {
431 if (original->seq.
size() != seq.size()) {
434 for (
size_t i = 0; i < seq.size(); i++) {
435 if (!original->seq[i].same_as(seq[i])) {
452 explicit Flattener(ffi::Array<Stmt>* seq) : seq_(seq) {}
454 template <
typename T>
456 if constexpr (std::is_same_v<T, SeqStmt>) {
459 if constexpr (!std::is_base_of_v<T, SeqStmt>) {
462 if constexpr (std::is_base_of_v<Stmt, T>) {
463 if (
const SeqStmtNode* ptr = t.template as<SeqStmtNode>()) {
464 return ffi::GetRef<SeqStmt>(ptr);
472 template <
typename T>
474 if constexpr (std::is_base_of_v<ObjectRef, T>) {
476 if (!stmt_or_seq.defined()) {
481 if constexpr (std::is_same_v<T, SeqStmt>) {
483 (*this)(0, stmt_or_seq->seq);
487 if constexpr (std::is_base_of_v<T, SeqStmt>) {
490 if (
auto* op = stmt_or_seq.template as<SeqStmtNode>()) {
496 if constexpr (std::is_base_of_v<T, Evaluate>) {
501 if (
auto* op = stmt_or_seq.template as<EvaluateNode>()) {
502 if (
auto* as_int = op->value.template as<IntImmNode>(); as_int && as_int->value == 0) {
508 if constexpr (std::is_base_of_v<Stmt, T>) {
510 seq_->push_back(stmt_or_seq);
513 for (
auto v : stmt_or_seq) {
520 ffi::Array<Stmt>* seq_;
541 refl::ObjectDef<IfThenElseNode>()
556 ffi::Optional<Stmt> else_case = std::nullopt,
Span span =
Span());
633 refl::ObjectDef<ForNode>()
657 ffi::Optional<IterVar> thread_binding = std::nullopt,
658 ffi::Map<ffi::String, ffi::Any> annotations = {},
659 ffi::Optional<PrimExpr> step = std::nullopt,
Span span =
Span());
684 refl::ObjectDef<WhileNode>()
715 refl::ObjectDef<BufferRegionNode>()
771 refl::ObjectDef<MatchBufferRegionNode>()
842 refl::ObjectDef<SBlockNode>()
863 ffi::Array<IterVar> iter_vars, ffi::Array<BufferRegion> reads,
864 ffi::Array<BufferRegion> writes, ffi::String name_hint,
Stmt body,
865 ffi::Optional<Stmt> init = std::nullopt,
866 ffi::Array<Buffer> alloc_buffers = ffi::Array<Buffer>(),
867 ffi::Array<MatchBufferRegion> match_buffers = ffi::Array<MatchBufferRegion>(),
868 ffi::Map<ffi::String, ffi::Any> annotations = ffi::Map<ffi::String, ffi::Any>(),
892 refl::ObjectDef<SBlockRealizeNode>()
1052 return attr_key.compare(0, 7,
"pragma_") == 0;
1075 return "vectorized";
1079 return "thread_binding";
1081 TVM_FFI_THROW(InternalError) <<
"Unknown ForKind" << t;
Base class for other IR constructs that can be converted to PrimExpr. This is useful for the FFI to c...
Definition: expr.h:156
Managed reference to PrimExprConvertibleNode.
Definition: expr.h:167
Reference to PrimExprNode.
Definition: expr.h:126
Definition: source_map.h:111
Runtime primitive data type.
Definition: data_type.h:47
Allocate a buffer that can be used in body.
Definition: stmt.h:234
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.Allocate", AllocateNode, StmtNode)
ffi::Map< ffi::String, ffi::Any > annotations
Additional annotations about the allocation.
Definition: stmt.h:252
PrimExpr condition
Only allocate buffer when condition is satisfied.
Definition: stmt.h:243
Stmt body
The body to be executed.
Definition: stmt.h:245
static int64_t ConstantAllocationSize(const ffi::Array< PrimExpr > &extents)
If the buffer size is constant, return the size. Otherwise return 0.
int64_t ConstantAllocationSize() const
If the buffer size is constant, return the size. Otherwise return 0.
Definition: stmt.h:270
static void RegisterReflection()
Definition: stmt.h:254
DataType dtype
The type of the buffer.
Definition: stmt.h:239
Var buffer_var
The buffer variable.
Definition: stmt.h:237
ffi::Array< PrimExpr > extents
The extents of the buffer.
Definition: stmt.h:241
Managed reference to AllocateNode.
Definition: stmt.h:285
TVM_DEFINE_OBJECT_REF_COW_METHOD(AllocateNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Allocate, Stmt, AllocateNode)
Allocate(Var buffer_var, DataType dtype, ffi::Array< PrimExpr > extents, PrimExpr condition, Stmt body, ffi::Map< ffi::String, ffi::Any > annotations=ffi::Map< ffi::String, ffi::Any >(), Span span=Span())
Assert condition, if an error occurs, return the error message.
Definition: stmt.h:151
PrimExpr condition
Condition to be checked.
Definition: stmt.h:154
PrimExpr message
Error message when assertion failed.
Definition: stmt.h:156
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.AssertStmt", AssertStmtNode, StmtNode)
static void RegisterReflection()
Definition: stmt.h:163
Stmt body
Body which this assertion holds true. Will be executed after the assertion.
Definition: stmt.h:161
Managed reference to AssertStmtNode.
Definition: stmt.h:177
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(AssertStmt, Stmt, AssertStmtNode)
AssertStmt(PrimExpr condition, PrimExpr message, Stmt body, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(AssertStmtNode)
Define certain auxiliary attribute for the body to be a symbolic value. This provide auxiliary inform...
Definition: stmt.h:113
ffi::Any node
this is attribute about certain node
Definition: stmt.h:116
PrimExpr value
The attribute value, value is well defined at current scope.
Definition: stmt.h:120
Stmt body
The body statement to be executed.
Definition: stmt.h:122
static void RegisterReflection()
Definition: stmt.h:124
ffi::String attr_key
the type key of the attribute
Definition: stmt.h:118
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.AttrStmt", AttrStmtNode, StmtNode)
Managed reference to AttrStmtNode.
Definition: stmt.h:139
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(AttrStmt, Stmt, AttrStmtNode)
AttrStmt(ffi::Any node, ffi::String attr_key, PrimExpr value, Stmt body, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(AttrStmtNode)
Representing the region of multi-dimensional buffer access.
Definition: stmt.h:706
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.BufferRegion", BufferRegionNode, PrimExprConvertibleNode)
PrimExpr ToPrimExpr() const final
static void RegisterReflection()
Definition: stmt.h:713
Buffer buffer
The buffer of the buffer region.
Definition: stmt.h:709
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: stmt.h:722
ffi::Array< Range > region
The region array of the buffer region.
Definition: stmt.h:711
Managed reference to BufferRegionNode.
Definition: stmt.h:730
static BufferRegion FullRegion(Buffer buffer)
Create a BufferRegion which is full region of the given buffer.
static BufferRegion FromPoint(Buffer buffer, ffi::Array< PrimExpr > indices)
Create a BufferRegion which is a single point of the given buffer.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(BufferRegion, PrimExprConvertible, BufferRegionNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(BufferRegionNode)
BufferRegion(Buffer buffer, ffi::Array< Range > region)
Store value to the high dimension buffer.
Definition: stmt.h:195
Buffer buffer
The buffer variable.
Definition: stmt.h:198
ffi::Array< PrimExpr > indices
The indices location to be stored.
Definition: stmt.h:202
PrimExpr value
The value to be stored.
Definition: stmt.h:200
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.BufferStore", BufferStoreNode, StmtNode)
static void RegisterReflection()
Definition: stmt.h:206
ffi::Optional< PrimExpr > predicate
The predicate mask for storing values.
Definition: stmt.h:204
Managed reference to BufferStoreNode.
Definition: stmt.h:221
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(BufferStore, Stmt, BufferStoreNode)
BufferStore(Buffer buffer, PrimExpr value, ffi::Array< PrimExpr > indices, ffi::Optional< PrimExpr > predicate=std::nullopt, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(BufferStoreNode)
Buffer is a symbolic n-darray structure. It is a composition of primitive symbolic types,...
Definition: buffer.h:156
Declare a buffer that can be used in the body.
Definition: stmt.h:297
static void RegisterReflection()
Definition: stmt.h:304
Buffer buffer
The buffer being declared.
Definition: stmt.h:300
Stmt body
The body to be executed.
Definition: stmt.h:302
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.DeclBuffer", DeclBufferNode, StmtNode)
Managed reference to DeclBufferNode.
Definition: stmt.h:314
DeclBuffer(Buffer buffer, Stmt body, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(DeclBufferNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(DeclBuffer, Stmt, DeclBufferNode)
Evaluates an expression. This is mostly used for putting a Call node into Stmt.
Definition: stmt.h:350
static void RegisterReflection()
Definition: stmt.h:355
PrimExpr value
The expression to be evaluated.
Definition: stmt.h:353
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.Evaluate", EvaluateNode, StmtNode)
Managed reference to EvaluateNode.
Definition: stmt.h:366
TVM_DEFINE_OBJECT_REF_COW_METHOD(EvaluateNode)
Evaluate(int value, Span span=Span())
Definition: stmt.h:370
Evaluate(PrimExpr value, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Evaluate, Stmt, EvaluateNode)
A for loop, with possible type annotations.
Definition: stmt.h:600
PrimExpr min
The minimum value of iteration.
Definition: stmt.h:605
ForKind kind
The kind of the for loop.
Definition: stmt.h:609
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.For", ForNode, StmtNode)
static void RegisterReflection()
Definition: stmt.h:631
Var loop_var
The loop variable.
Definition: stmt.h:603
bool HasTrivialStep() const
Check it is a loop without nontrivial loop step.
ffi::Optional< IterVar > thread_binding
Only valid when kind == ForKind::kThreadBinding The context thread that this loop variable bounds to.
Definition: stmt.h:616
ffi::Map< ffi::String, ffi::Any > annotations
Additional annotations about the loop.
Definition: stmt.h:625
ffi::Optional< PrimExpr > step
The loop step. It is one if not specified.
Definition: stmt.h:629
PrimExpr extent
The extent of the iteration.
Definition: stmt.h:607
Stmt body
The body of the for loop.
Definition: stmt.h:611
Managed reference to ForNode.
Definition: stmt.h:654
TVM_DEFINE_OBJECT_REF_COW_METHOD(ForNode)
For(Var loop_var, PrimExpr min, PrimExpr extent, ForKind kind, Stmt body, ffi::Optional< IterVar > thread_binding=std::nullopt, ffi::Map< ffi::String, ffi::Any > annotations={}, ffi::Optional< PrimExpr > step=std::nullopt, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(For, Stmt, ForNode)
IfThenElse statement.
Definition: stmt.h:530
PrimExpr condition
The condition.
Definition: stmt.h:533
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.IfThenElse", IfThenElseNode, StmtNode)
ffi::Optional< Stmt > else_case
The branch to be executed when condition is false, can be null.
Definition: stmt.h:537
static void RegisterReflection()
Definition: stmt.h:539
Stmt then_case
The branch to be executed when condition is true.
Definition: stmt.h:535
Managed reference to IfThenElseNode.
Definition: stmt.h:553
TVM_DEFINE_OBJECT_REF_COW_METHOD(IfThenElseNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(IfThenElse, Stmt, IfThenElseNode)
IfThenElse(PrimExpr condition, Stmt then_case, ffi::Optional< Stmt > else_case=std::nullopt, Span span=Span())
Let binding, bind var to value, then run body.
Definition: stmt.h:72
PrimExpr value
The value to be bound.
Definition: stmt.h:77
Stmt body
The body block.
Definition: stmt.h:79
static void RegisterReflection()
Definition: stmt.h:81
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.LetStmt", LetStmtNode, StmtNode)
Var var
The variable.
Definition: stmt.h:75
Managed reference to LetStmtNode.
Definition: stmt.h:95
TVM_DEFINE_OBJECT_REF_COW_METHOD(LetStmtNode)
LetStmt(Var var, PrimExpr value, Stmt body, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(LetStmt, Stmt, LetStmtNode)
Match introduces a constraint that the source buffer region can be remapped to the data layout specif...
Definition: stmt.h:762
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.MatchBufferRegion", MatchBufferRegionNode, Object)
Buffer buffer
The target buffer.
Definition: stmt.h:765
static void RegisterReflection()
Definition: stmt.h:769
BufferRegion source
The source buffer region.
Definition: stmt.h:767
Managed reference to MatchBufferRegionNode.
Definition: stmt.h:784
MatchBufferRegion(Buffer buffer, BufferRegion source)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(MatchBufferRegion, ObjectRef, MatchBufferRegionNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(MatchBufferRegionNode)
A block is a basic schedule unit in TIR.
Definition: stmt.h:813
ffi::Array< Buffer > alloc_buffers
The buffer allocated in the block.
Definition: stmt.h:824
ffi::Array< IterVar > iter_vars
The variables of the block.
Definition: stmt.h:816
ffi::Array< BufferRegion > reads
The read buffer regions of the block.
Definition: stmt.h:818
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.SBlock", SBlockNode, StmtNode)
static void RegisterReflection()
Definition: stmt.h:840
ffi::String name_hint
The name_hint of the block.
Definition: stmt.h:822
ffi::Optional< Stmt > init
The init statement is executed during the first iteration of reduction loops in a reduction block....
Definition: stmt.h:836
ffi::Array< MatchBufferRegion > match_buffers
The match buffer regions.
Definition: stmt.h:826
ffi::Map< ffi::String, ffi::Any > annotations
The annotation of the block.
Definition: stmt.h:828
ffi::Array< BufferRegion > writes
The write buffer regions of the block.
Definition: stmt.h:820
Stmt body
The body of the block.
Definition: stmt.h:838
A block realization node represents execution of the block at the binding values.
Definition: stmt.h:878
ffi::Array< PrimExpr > iter_values
The corresponding values of the iter vars.
Definition: stmt.h:881
static void RegisterReflection()
Definition: stmt.h:890
PrimExpr predicate
The predicate of the block realization, the block will only be executed when the predicate is true.
Definition: stmt.h:886
SBlock block
The block to be realized.
Definition: stmt.h:888
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.SBlockRealize", SBlockRealizeNode, StmtNode)
Managed reference to BlockRealizeNode.
Definition: stmt.h:904
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(SBlockRealize, Stmt, SBlockRealizeNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(SBlockRealizeNode)
SBlockRealize(ffi::Array< PrimExpr > iter_values, PrimExpr predicate, SBlock block, Span span=Span())
Managed reference to SBlockNode.
Definition: stmt.h:860
TVM_DEFINE_OBJECT_REF_COW_METHOD(SBlockNode)
SBlock(ffi::Array< IterVar > iter_vars, ffi::Array< BufferRegion > reads, ffi::Array< BufferRegion > writes, ffi::String name_hint, Stmt body, ffi::Optional< Stmt > init=std::nullopt, ffi::Array< Buffer > alloc_buffers=ffi::Array< Buffer >(), ffi::Array< MatchBufferRegion > match_buffers=ffi::Array< MatchBufferRegion >(), ffi::Map< ffi::String, ffi::Any > annotations=ffi::Map< ffi::String, ffi::Any >(), Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(SBlock, Stmt, SBlockNode)
The container of seq statement. Represent a sequence of statements.
Definition: stmt.h:325
size_t size() const
Definition: stmt.h:331
ffi::Array< Stmt > seq
internal sequence content.
Definition: stmt.h:328
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.SeqStmt", SeqStmtNode, StmtNode)
static void RegisterReflection()
Definition: stmt.h:337
Stmt operator[](size_t index) const
Get the index-th element in the sequence.
Definition: stmt.h:335
Helper class to flatten sequence of arguments into Array.
Definition: stmt.h:450
Flattener(ffi::Array< Stmt > *seq)
Definition: stmt.h:452
static ffi::Optional< SeqStmt > AsSeqStmt(const T &t)
Definition: stmt.h:455
void operator()(size_t i, const T &stmt_or_seq) const
Definition: stmt.h:473
Sequence statement.
Definition: stmt.h:377
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(SeqStmt, Stmt, SeqStmtNode)
size_t size() const
Definition: stmt.h:387
TVM_DEFINE_OBJECT_REF_COW_METHOD(SeqStmtNode)
SeqStmt(ffi::Array< Stmt > seq, Span span=Span())
Construct SeqStmt.
Stmt operator[](size_t index) const
Get the index-th element in the sequence.
Definition: stmt.h:391
static Stmt Flatten(Args &&... seq_args)
Construct a sequence statement by flattening all the arrays and sequences in the arguments recursivel...
Definition: stmt.h:413
Base node of all statements.
Definition: stmt.h:39
TVM_OBJECT_ENABLE_SCRIPT_PRINTER()
TVM_FFI_DECLARE_OBJECT_INFO("tir.Stmt", StmtNode, Object)
static constexpr const uint32_t _type_child_slots
Definition: stmt.h:59
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: stmt.h:57
StmtNode(Span span)
Definition: stmt.h:48
static void RegisterReflection()
Definition: stmt.h:50
Span span
Span that points to the original source code. Reserved debug information.
Definition: stmt.h:45
Container of all statements.
Definition: stmt.h:64
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Stmt, ObjectRef, StmtNode)
a named variable in TIR
Definition: var.h:76
A While loop.
Definition: stmt.h:675
Stmt body
The body of the while loop.
Definition: stmt.h:680
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tir.While", WhileNode, StmtNode)
static void RegisterReflection()
Definition: stmt.h:682
PrimExpr condition
The termination condition.
Definition: stmt.h:678
Managed reference to WhileNode.
Definition: stmt.h:695
While(PrimExpr condition, Stmt body, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(WhileNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(While, Stmt, WhileNode)
Definition: repr_printer.h:91
void Evaluate(PrimExpr value)
Evaluate the input expression.
Var var(std::string name_hint, DataType t=DataType::Int(32))
Construct a new Var expression.
constexpr const char * compute_scope
Mark the scope as when computation start to happen This can hint some code generator to create a new ...
Definition: stmt.h:939
constexpr const char * buffer_bind_scope
Bind the buffer specification to the region of the op When this scope occurs, the stmt....
Definition: stmt.h:985
constexpr const char * channel_read_advance
Advance step of channel after end of scope.
Definition: stmt.h:990
constexpr const char * volatile_scope
Mark the scope as volatile access for certain handle.
Definition: stmt.h:928
constexpr const char * pipeline_stage_scope
pipeline stage scope, implies always execution
Definition: stmt.h:996
constexpr const char * pragma_import_c
Import C source or file into the final code gen module.
Definition: stmt.h:957
constexpr const char * pragma_unroll_explicit
Pragma: unroll explicit.
Definition: stmt.h:953
constexpr const char * device_scope
Mark that it is in the device scope.
Definition: stmt.h:1003
bool IsPragmaKey(const std::string &attr_key)
Check if attr_key is a pragma key extension.
Definition: stmt.h:1051
constexpr const char * thread_extent
Mark launching extent of thread, used by device API.
Definition: stmt.h:917
constexpr const char * virtual_thread
Mark launching of a virtual thread.
Definition: stmt.h:919
constexpr const char * extern_scope
Mark the scope as generated by extern primitive. such scope can contain arbitrary ir program and we n...
Definition: stmt.h:934
constexpr const char * reduce_scope
Mark of reduce scope.
Definition: stmt.h:949
constexpr const char * channel_write_scope
channel write scope
Definition: stmt.h:992
constexpr const char * async_commit_queue_scope
Annotations for invoking and synchronizing asynchronous operations.
Definition: stmt.h:1027
constexpr const char * device_id
The allocation device for global malloc in host.
Definition: stmt.h:943
constexpr const char * device_type
The device type.
Definition: stmt.h:945
constexpr const char * scan_update_scope
Mark of scan update scope.
Definition: stmt.h:971
constexpr const char * pragma_auto_unroll_max_step
Pragma: auto-unroll, max_step.
Definition: stmt.h:951
constexpr const char * loop_scope
Mark of loop scope.
Definition: stmt.h:947
constexpr const char * double_buffer_scope
Marks production of double buffer data.
Definition: stmt.h:965
constexpr const char * fragment_shape
Mark that the shape of TensorCore fragment.
Definition: stmt.h:1034
constexpr const char * pragma_tensor_core
Try to modify the AST to support Tensor Core.
Definition: stmt.h:961
constexpr const char * fragment_layout
Mark that the layout of TensorCore fragment.
Definition: stmt.h:1039
constexpr const char * async_wait_queue_scope
Definition: stmt.h:1028
constexpr const char * coproc_scope
Mark region is processed by a co-processor.
Definition: stmt.h:921
constexpr const char * buffer_bound
Mark stores/loads with theirs bounds.
Definition: stmt.h:975
constexpr const char * async_wait_inflight_count
Definition: stmt.h:1029
constexpr const char * channel_read_scope
channel read scope
Definition: stmt.h:988
constexpr const char * channel_write_advance
Advance step of channel after end of scope.
Definition: stmt.h:994
constexpr const char * coproc_uop_scope
Mark region creates coprocessor micro ops, can be reused if corresponding variable is independent.
Definition: stmt.h:926
constexpr const char * pragma_loop_partition_hint
Mark that the loop should be partitioned.
Definition: stmt.h:1044
constexpr const char * pipeline_exec_scope
pipeline execution scope, implies the scope can be pipelined.
Definition: stmt.h:998
constexpr const char * pragma_import_llvm
Import llvm source or file into the final code gen module.
Definition: stmt.h:959
constexpr const char * pragma_scope_prefix
Mark region is guarded by the pragma extension.
Definition: stmt.h:955
constexpr const char * scan_init_scope
Mark of scan init scope.
Definition: stmt.h:973
constexpr const char * storage_alignment
Mark storage alignment requirement of buffers.
Definition: stmt.h:941
constexpr const char * double_buffer_write
Marks region used by double buffer write.
Definition: stmt.h:969
constexpr const char * async_scope
Mark that the attached statement runs asynchronously.
Definition: stmt.h:1008
const char * ForKind2String(ForKind t)
Definition: stmt.h:1068
std::ostream & operator<<(std::ostream &os, CallEffectKind side_effect)
Definition: op_attr_types.h:123
ForKind
The kind of the loop.
Definition: stmt.h:569
@ kThreadBinding
The loop variable is bound to a thread in an environment. In the final stage of lowering,...
@ kParallel
Parallel execution on CPU.
@ kSerial
default semantics – serial execution.
PrimExpr TypeAnnotation(DataType dtype, Span span=Span())
Create a type annotation expression.
@ kVectorized
The loop is vectorized.
Definition: var.h:236
@ kUnrolled
The execution is unrolled.
Definition: var.h:232
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
PrimExpr min(PrimExpr a, PrimExpr b, Span span=Span())
take minimum of two values