tvm
frame.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 #ifndef TVM_SCRIPT_IR_BUILDER_TIR_FRAME_H_
20 #define TVM_SCRIPT_IR_BUILDER_TIR_FRAME_H_
21 
24 #include <tvm/tir/stmt.h>
25 
26 namespace tvm {
27 namespace script {
28 namespace ir_builder {
29 namespace tir {
30 
37  public:
39  Array<tvm::tir::Stmt> stmts;
40 
41  static void RegisterReflection() {
42  namespace refl = tvm::ffi::reflection;
43  refl::ObjectDef<TIRFrameNode>().def_ro("stmts", &TIRFrameNode::stmts);
44  }
45 
46  static constexpr const char* _type_key = "script.ir_builder.tir.TIRFrame";
48 };
49 
55 class TIRFrame : public IRBuilderFrame {
56  public:
58 
59  protected:
60  TIRFrame() = default;
61 };
62 
69  public:
71  Optional<String> name;
73  Array<tvm::tir::Var> args;
75  bool is_private;
77  Optional<Type> ret_type;
79  Map<tvm::tir::Var, tvm::tir::Buffer> buffer_map;
81  Map<String, Any> attrs;
83  Map<tvm::tir::Var, tvm::tir::IterVar> env_threads;
85  Array<tvm::tir::Buffer> root_alloc_buffers;
86 
87  static void RegisterReflection() {
88  namespace refl = tvm::ffi::reflection;
89  refl::ObjectDef<PrimFuncFrameNode>()
90  .def_ro("name", &PrimFuncFrameNode::name)
91  .def_ro("args", &PrimFuncFrameNode::args)
92  .def_ro("is_private", &PrimFuncFrameNode::is_private)
93  .def_ro("ret_type", &PrimFuncFrameNode::ret_type)
94  .def_ro("buffer_map", &PrimFuncFrameNode::buffer_map)
95  .def_ro("attrs", &PrimFuncFrameNode::attrs)
96  .def_ro("env_threads", &PrimFuncFrameNode::env_threads)
97  .def_ro("root_alloc_buffers", &PrimFuncFrameNode::root_alloc_buffers);
98  }
99 
100  static constexpr const char* _type_key = "script.ir_builder.tir.PrimFuncFrame";
102 
103  public:
108  void ExitWithScope() final;
109 };
110 
116 class PrimFuncFrame : public TIRFrame {
117  public:
119 };
120 
126 class BlockFrameNode : public TIRFrameNode {
127  public:
129  String name;
131  Array<tvm::tir::IterVar> iter_vars;
133  Optional<Array<tvm::tir::BufferRegion>> reads;
135  Optional<Array<tvm::tir::BufferRegion>> writes;
137  Optional<tvm::tir::Stmt> init;
139  Array<tvm::tir::Buffer> alloc_buffers;
141  Array<tvm::tir::MatchBufferRegion> match_buffers;
143  Optional<Map<String, Any>> annotations;
145  Array<PrimExpr> iter_values;
150  Optional<PrimExpr> predicate;
153 
154  static void RegisterReflection() {
155  namespace refl = tvm::ffi::reflection;
156  refl::ObjectDef<BlockFrameNode>()
157  .def_ro("name", &BlockFrameNode::name)
158  .def_ro("iter_vars", &BlockFrameNode::iter_vars)
159  .def_ro("reads", &BlockFrameNode::reads)
160  .def_ro("writes", &BlockFrameNode::writes)
161  .def_ro("init", &BlockFrameNode::init)
162  .def_ro("alloc_buffers", &BlockFrameNode::alloc_buffers)
163  .def_ro("match_buffers", &BlockFrameNode::match_buffers)
164  .def_ro("annotations", &BlockFrameNode::annotations)
165  .def_ro("iter_values", &BlockFrameNode::iter_values)
166  .def_ro("predicate", &BlockFrameNode::predicate)
167  .def_ro("no_realize", &BlockFrameNode::no_realize);
168  }
169 
170  static constexpr const char* _type_key = "script.ir_builder.tir.BlockFrame";
172 
173  public:
178  void ExitWithScope() final;
179 };
180 
187 class BlockFrame : public TIRFrame {
188  public:
190 };
191 
198  public:
199  static void RegisterReflection() {
200  namespace refl = tvm::ffi::reflection;
201  refl::ObjectDef<BlockInitFrameNode>();
202  }
203 
204  static constexpr const char* _type_key = "script.ir_builder.tir.BlockInitFrame";
206 
207  public:
212  void EnterWithScope() final;
217  void ExitWithScope() final;
218 };
219 
225 class BlockInitFrame : public TIRFrame {
226  public:
228 };
229 
235 class ForFrameNode : public TIRFrameNode {
236  public:
244  using FMakeForLoop = ffi::TypedFunction<tvm::tir::Stmt(
245  Array<tvm::tir::Var> loop_vars, Array<Range> loop_extents, tvm::tir::Stmt loop_body)>;
247  Array<tvm::tir::Var> vars;
249  Array<Range> doms;
252 
253  static void RegisterReflection() {
254  namespace refl = tvm::ffi::reflection;
255  refl::ObjectDef<ForFrameNode>()
256  .def_ro("vars", &ForFrameNode::vars)
257  .def_ro("doms", &ForFrameNode::doms);
258  // `f_make_for_loop` is not registered as it's not visited.
259  }
260 
261  static constexpr const char* _type_key = "script.ir_builder.tir.ForFrame";
263 
264  public:
269  void ExitWithScope() final;
270 };
271 
277 class ForFrame : public TIRFrame {
278  public:
280 };
281 
289  public:
294 
295  static void RegisterReflection() {
296  namespace refl = tvm::ffi::reflection;
297  refl::ObjectDef<AssertFrameNode>()
298  .def_ro("condition", &AssertFrameNode::condition)
299  .def_ro("message", &AssertFrameNode::message);
300  }
301 
302  static constexpr const char* _type_key = "script.ir_builder.tir.AssertFrame";
304 
305  public:
310  void ExitWithScope() final;
311 };
312 
318 class AssertFrame : public TIRFrame {
319  public:
321 };
322 
328 class LetFrameNode : public TIRFrameNode {
329  public:
334 
335  static void RegisterReflection() {
336  namespace refl = tvm::ffi::reflection;
337  refl::ObjectDef<LetFrameNode>()
338  .def_ro("var", &LetFrameNode::var)
339  .def_ro("value", &LetFrameNode::value);
340  }
341 
342  static constexpr const char* _type_key = "script.ir_builder.tir.LetFrame";
344 
345  public:
350  void ExitWithScope() final;
351 };
352 
358 class LetFrame : public TIRFrame {
359  public:
361 };
362 
368  public:
372  String attr_key;
375 
376  static void RegisterReflection() {
377  namespace refl = tvm::ffi::reflection;
378  refl::ObjectDef<LaunchThreadFrameNode>()
379  .def_ro("extent", &LaunchThreadFrameNode::extent)
380  .def_ro("attr_key", &LaunchThreadFrameNode::attr_key)
381  .def_ro("iter_var", &LaunchThreadFrameNode::iter_var);
382  }
383 
384  static constexpr const char* _type_key = "script.ir_builder.tir.LaunchThreadFrame";
386 
387  public:
392  void ExitWithScope() final;
393 };
394 
400 class LaunchThreadFrame : public TIRFrame {
401  public:
404 };
405 
412  public:
419 
420  static void RegisterReflection() {
421  namespace refl = tvm::ffi::reflection;
422  refl::ObjectDef<RealizeFrameNode>()
423  .def_ro("buffer_slice", &RealizeFrameNode::buffer_slice)
424  .def_ro("storage_scope", &RealizeFrameNode::storage_scope)
425  .def_ro("condition", &RealizeFrameNode::condition);
426  }
427 
428  static constexpr const char* _type_key = "script.ir_builder.tir.RealizeFrame";
430 
431  public:
436  void ExitWithScope() final;
437 };
438 
444 class RealizeFrame : public TIRFrame {
445  public:
447 };
448 
455  public:
457  Array<PrimExpr> extents;
465  Map<String, Any> annotations;
468 
469  static void RegisterReflection() {
470  namespace refl = tvm::ffi::reflection;
471  refl::ObjectDef<AllocateFrameNode>()
472  .def_ro("extents", &AllocateFrameNode::extents)
473  .def_ro("dtype", &AllocateFrameNode::dtype)
474  .def_ro("storage_scope", &AllocateFrameNode::storage_scope)
475  .def_ro("condition", &AllocateFrameNode::condition)
476  .def_ro("annotations", &AllocateFrameNode::annotations)
477  .def_ro("buffer_var", &AllocateFrameNode::buffer_var);
478  }
479 
480  static constexpr const char* _type_key = "script.ir_builder.tir.AllocateFrame";
482 
483  public:
488  void ExitWithScope() final;
489 };
490 
496 class AllocateFrame : public TIRFrame {
497  public:
499 };
500 
507  public:
511  Array<PrimExpr> extents;
517  Map<String, Any> annotations;
518 
519  static void RegisterReflection() {
520  namespace refl = tvm::ffi::reflection;
521  refl::ObjectDef<AllocateConstFrameNode>()
522  .def_ro("dtype", &AllocateConstFrameNode::dtype)
523  .def_ro("extents", &AllocateConstFrameNode::extents)
524  .def_ro("data", &AllocateConstFrameNode::data)
525  .def_ro("buffer_var", &AllocateConstFrameNode::buffer_var)
526  .def_ro("annotations", &AllocateConstFrameNode::annotations);
527  }
528 
529  static constexpr const char* _type_key = "script.ir_builder.tir.AllocateConstFrame";
531 
532  public:
537  void ExitWithScope() final;
538 };
539 
545 class AllocateConstFrame : public TIRFrame {
546  public:
549 };
555 class AttrFrameNode : public TIRFrameNode {
556  public:
558  Any node;
560  String attr_key;
563 
564  static void RegisterReflection() {
565  namespace refl = tvm::ffi::reflection;
566  refl::ObjectDef<AttrFrameNode>()
567  .def_ro("node", &AttrFrameNode::node)
568  .def_ro("attr_key", &AttrFrameNode::attr_key)
569  .def_ro("value", &AttrFrameNode::value);
570  }
571 
572  static constexpr const char* _type_key = "script.ir_builder.tir.AttrFrame";
574 
575  public:
580  void ExitWithScope() final;
581 };
582 
588 class AttrFrame : public TIRFrame {
589  public:
591 };
592 
598 class WhileFrameNode : public TIRFrameNode {
599  public:
602 
603  static void RegisterReflection() {
604  namespace refl = tvm::ffi::reflection;
605  refl::ObjectDef<WhileFrameNode>().def_ro("condition", &WhileFrameNode::condition);
606  }
607 
608  static constexpr const char* _type_key = "script.ir_builder.tir.WhileFrame";
610 
611  public:
616  void ExitWithScope() final;
617 };
618 
624 class WhileFrame : public TIRFrame {
625  public:
627 };
628 
634 class IfFrameNode : public TIRFrameNode {
635  public:
639  Optional<Array<tvm::tir::Stmt>> then_stmts;
641  Optional<Array<tvm::tir::Stmt>> else_stmts;
642 
643  static void RegisterReflection() {
644  namespace refl = tvm::ffi::reflection;
645  refl::ObjectDef<IfFrameNode>()
646  .def_ro("condition", &IfFrameNode::condition)
647  .def_ro("then_stmts", &IfFrameNode::then_stmts)
648  .def_ro("else_stmts", &IfFrameNode::else_stmts);
649  }
650 
651  static constexpr const char* _type_key = "script.ir_builder.tir.IfFrame";
653 
654  public:
659  void ExitWithScope() final;
660 };
661 
667 class IfFrame : public TIRFrame {
668  public:
670 };
671 
677 class ThenFrameNode : public TIRFrameNode {
678  public:
679  static void RegisterReflection() {
680  namespace refl = tvm::ffi::reflection;
681  refl::ObjectDef<ThenFrameNode>();
682  }
683 
684  static constexpr const char* _type_key = "script.ir_builder.tir.ThenFrame";
686 
687  public:
692  void EnterWithScope() final;
697  void ExitWithScope() final;
698 };
699 
705 class ThenFrame : public TIRFrame {
706  public:
708 };
709 
715 class ElseFrameNode : public TIRFrameNode {
716  public:
717  static void RegisterReflection() {
718  namespace refl = tvm::ffi::reflection;
719  refl::ObjectDef<ElseFrameNode>();
720  }
721 
722  static constexpr const char* _type_key = "script.ir_builder.tir.ElseFrame";
724 
725  public:
730  void EnterWithScope() final;
735  void ExitWithScope() final;
736 };
737 
743 class ElseFrame : public TIRFrame {
744  public:
746 };
747 
749  public:
753  bool allocated;
754 
755  static void RegisterReflection() {
756  namespace refl = tvm::ffi::reflection;
757  refl::ObjectDef<DeclBufferFrameNode>()
758  .def_ro("buffer", &DeclBufferFrameNode::buffer)
759  .def_ro("allocated", &DeclBufferFrameNode::allocated);
760  }
761 
762  static constexpr const char* _type_key = "script.ir_builder.tir.DeclBufferFrame";
764 
765  public:
766  void ExitWithScope() final;
767 };
768 
769 class DeclBufferFrame : public TIRFrame {
770  public:
772 };
773 
774 } // namespace tir
775 } // namespace ir_builder
776 } // namespace script
777 } // namespace tvm
778 
779 #endif // TVM_SCRIPT_IR_BUILDER_TIR_FRAME_H_
Reference to PrimExprNode.
Definition: expr.h:129
Runtime primitive data type.
Definition: data_type.h:47
Managed NDArray. The array is backed by reference counted blocks.
Definition: ndarray.h:53
Managed reference to an IRBuilderFrameNode.
Definition: base.h:103
A frame represents the allocate constant.
Definition: frame.h:506
tvm::tir::Var buffer_var
The buffer var.
Definition: frame.h:515
Map< String, Any > annotations
Additional annotations about the allocation.
Definition: frame.h:517
Array< PrimExpr > extents
The extents of the allocate.
Definition: frame.h:511
TVM_DECLARE_FINAL_OBJECT_INFO(AllocateConstFrameNode, TIRFrameNode)
tvm::runtime::NDArray data
The data associated with the constant.
Definition: frame.h:513
void ExitWithScope() final
The method called when exiting RAII scope.
DataType dtype
The data type of the buffer.
Definition: frame.h:509
static void RegisterReflection()
Definition: frame.h:519
Managed reference to AllocateConstFrameNode.
Definition: frame.h:545
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(AllocateConstFrame, TIRFrame, AllocateConstFrameNode)
A frame represents the allocate.
Definition: frame.h:454
Map< String, Any > annotations
Additional annotation hints.
Definition: frame.h:465
tvm::tir::Var buffer_var
The buffer var.
Definition: frame.h:467
TVM_DECLARE_FINAL_OBJECT_INFO(AllocateFrameNode, TIRFrameNode)
DataType dtype
The data type of the buffer.
Definition: frame.h:459
PrimExpr condition
The condition.
Definition: frame.h:463
static void RegisterReflection()
Definition: frame.h:469
void ExitWithScope() final
The method called when exiting RAII scope.
String storage_scope
The storage scope.
Definition: frame.h:461
Array< PrimExpr > extents
The extents of the allocate.
Definition: frame.h:457
Managed reference to AllocateFrameNode.
Definition: frame.h:496
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(AllocateFrame, TIRFrame, AllocateFrameNode)
A frame that represents the assert statement. Proceeds if the condition is true, otherwise aborts wit...
Definition: frame.h:288
static void RegisterReflection()
Definition: frame.h:295
TVM_DECLARE_FINAL_OBJECT_INFO(AssertFrameNode, TIRFrameNode)
PrimExpr message
The output error message when the assertion failed.
Definition: frame.h:293
PrimExpr condition
The PrimExpr to test.
Definition: frame.h:291
void ExitWithScope() final
The method called when exiting RAII scope.
Managed reference to AssertFrameNode.
Definition: frame.h:318
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(AssertFrame, TIRFrame, AssertFrameNode)
A frame that represents attribute node.
Definition: frame.h:555
TVM_DECLARE_FINAL_OBJECT_INFO(AttrFrameNode, TIRFrameNode)
String attr_key
Attribute type key.
Definition: frame.h:560
void ExitWithScope() final
The method called when exiting RAII scope.
static void RegisterReflection()
Definition: frame.h:564
Any node
The node to annotate the attribute.
Definition: frame.h:558
PrimExpr value
The value of the attribute.
Definition: frame.h:562
Managed reference to AttrFrameNode.
Definition: frame.h:588
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(AttrFrame, TIRFrame, AttrFrameNode)
A frame that represents the block.
Definition: frame.h:126
Optional< tvm::tir::Stmt > init
The init statement of the bolck.
Definition: frame.h:137
String name
The name of the block.
Definition: frame.h:129
void ExitWithScope() final
The method called when exiting RAII scope.
Array< tvm::tir::IterVar > iter_vars
The variables of the block.
Definition: frame.h:131
static void RegisterReflection()
Definition: frame.h:154
Optional< Array< tvm::tir::BufferRegion > > writes
The write buffer regions of the block.
Definition: frame.h:135
Array< tvm::tir::Buffer > alloc_buffers
The buffer allocated in the block.
Definition: frame.h:139
Optional< PrimExpr > predicate
The predicate of the block realization, the block will only be executed when the predicate is true.
Definition: frame.h:150
Array< tvm::tir::MatchBufferRegion > match_buffers
The match buffer regions.
Definition: frame.h:141
Array< PrimExpr > iter_values
The corresponding values of the iter vars.
Definition: frame.h:145
Optional< Array< tvm::tir::BufferRegion > > reads
The read buffer regions of the block.
Definition: frame.h:133
Optional< Map< String, Any > > annotations
The annotation of the block.
Definition: frame.h:143
TVM_DECLARE_FINAL_OBJECT_INFO(BlockFrameNode, TIRFrameNode)
bool no_realize
The flag whether to construct BlockRealize or Block.
Definition: frame.h:152
Managed reference to BlockFrameNode.
Definition: frame.h:187
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(BlockFrame, TIRFrame, BlockFrameNode)
A frame that represents the block initialization statment.
Definition: frame.h:197
TVM_DECLARE_FINAL_OBJECT_INFO(BlockInitFrameNode, TIRFrameNode)
static void RegisterReflection()
Definition: frame.h:199
void EnterWithScope() final
The method called when entering RAII scope.
Managed reference to BlockInitFrameNode.
Definition: frame.h:225
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(BlockInitFrame, TIRFrame, BlockInitFrameNode)
void ExitWithScope() final
The method called when exiting RAII scope.
static void RegisterReflection()
Definition: frame.h:755
tvm::tir::Buffer buffer
The declared buffer.
Definition: frame.h:751
TVM_DECLARE_FINAL_OBJECT_INFO(DeclBufferFrameNode, TIRFrameNode)
bool allocated
The buffer allocated or not.
Definition: frame.h:753
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(DeclBufferFrame, TIRFrame, DeclBufferFrameNode)
A frame that represents else.
Definition: frame.h:715
static void RegisterReflection()
Definition: frame.h:717
void EnterWithScope() final
The method called when entering RAII scope.
TVM_DECLARE_FINAL_OBJECT_INFO(ElseFrameNode, TIRFrameNode)
Managed reference to ElseFrameNode.
Definition: frame.h:743
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(ElseFrame, TIRFrame, ElseFrameNode)
A frame that represents the for loop.
Definition: frame.h:235
static void RegisterReflection()
Definition: frame.h:253
FMakeForLoop f_make_for_loop
The for loop generating function.
Definition: frame.h:251
Array< Range > doms
The domains of iteration.
Definition: frame.h:249
Array< tvm::tir::Var > vars
The loop variable.
Definition: frame.h:247
ffi::TypedFunction< tvm::tir::Stmt(Array< tvm::tir::Var > loop_vars, Array< Range > loop_extents, tvm::tir::Stmt loop_body)> FMakeForLoop
Functions that generate loop nests.
Definition: frame.h:245
void ExitWithScope() final
The method called when exiting RAII scope.
TVM_DECLARE_FINAL_OBJECT_INFO(ForFrameNode, TIRFrameNode)
Managed reference to ForFrameNode.
Definition: frame.h:277
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(ForFrame, TIRFrame, ForFrameNode)
A frame that represents if statement.
Definition: frame.h:634
TVM_DECLARE_FINAL_OBJECT_INFO(IfFrameNode, TIRFrameNode)
Optional< Array< tvm::tir::Stmt > > else_stmts
The stetements in the false branch.
Definition: frame.h:641
void ExitWithScope() final
The method called when exiting RAII scope.
Optional< Array< tvm::tir::Stmt > > then_stmts
The statements in the true branch.
Definition: frame.h:639
PrimExpr condition
The condition of the if statement.
Definition: frame.h:637
static void RegisterReflection()
Definition: frame.h:643
Managed reference to IfFrameNode.
Definition: frame.h:667
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(IfFrame, TIRFrame, IfFrameNode)
The LaunchThreadFrameNode.
Definition: frame.h:367
void ExitWithScope() final
The method called when exiting RAII scope.
tvm::tir::IterVar iter_var
The iteration variable.
Definition: frame.h:374
TVM_DECLARE_FINAL_OBJECT_INFO(LaunchThreadFrameNode, TIRFrameNode)
static void RegisterReflection()
Definition: frame.h:376
String attr_key
The attribute key, could be either virtual_thread or thread_extent.
Definition: frame.h:372
PrimExpr extent
The extent of environment thread.
Definition: frame.h:370
Managed reference to LaunchThreadFrameNode.
Definition: frame.h:400
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(LaunchThreadFrame, TIRFrame, LaunchThreadFrameNode)
A frame represents the let binding expression, which binds a var.
Definition: frame.h:328
tvm::tir::Var var
The variable we bind to.
Definition: frame.h:331
PrimExpr value
The value we bind var to.
Definition: frame.h:333
static void RegisterReflection()
Definition: frame.h:335
TVM_DECLARE_FINAL_OBJECT_INFO(LetFrameNode, TIRFrameNode)
void ExitWithScope() final
The method called when exiting RAII scope.
Managed reference to LetFrameNode.
Definition: frame.h:358
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(LetFrame, TIRFrame, LetFrameNode)
A frame that represents the PrimFunc containing TIR statements.
Definition: frame.h:68
static void RegisterReflection()
Definition: frame.h:87
Map< String, Any > attrs
Additional attributes storing the meta-data.
Definition: frame.h:81
void ExitWithScope() final
The method called when exiting RAII scope.
Map< tvm::tir::Var, tvm::tir::Buffer > buffer_map
Maps some parameters to specific Buffer data structures.
Definition: frame.h:79
Map< tvm::tir::Var, tvm::tir::IterVar > env_threads
The variable map bound to thread env.
Definition: frame.h:83
Array< tvm::tir::Buffer > root_alloc_buffers
The buffer allocated in root block.
Definition: frame.h:85
Optional< String > name
The name of the block.
Definition: frame.h:71
static constexpr const char * _type_key
Definition: frame.h:100
TVM_DECLARE_FINAL_OBJECT_INFO(PrimFuncFrameNode, TIRFrameNode)
Array< tvm::tir::Var > args
Function parameters.
Definition: frame.h:73
Optional< Type > ret_type
The return type of the function.
Definition: frame.h:77
bool is_private
Whether the PrimFunc is annotated as private.
Definition: frame.h:75
Managed reference to PrimFuncFrameNode.
Definition: frame.h:116
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(PrimFuncFrame, TIRFrame, PrimFuncFrameNode)
A frame that represents realization.
Definition: frame.h:411
static void RegisterReflection()
Definition: frame.h:420
TVM_DECLARE_FINAL_OBJECT_INFO(RealizeFrameNode, TIRFrameNode)
void ExitWithScope() final
The method called when exiting RAII scope.
String storage_scope
The storage scope associated with this realization.
Definition: frame.h:416
PrimExpr condition
The condition expression.
Definition: frame.h:418
tvm::tir::BufferRegion buffer_slice
The region of buffer access.
Definition: frame.h:414
Managed reference to RealizeFrameNode.
Definition: frame.h:444
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(RealizeFrame, TIRFrame, RealizeFrameNode)
A base frame that represents the TIR fame with body of statements.
Definition: frame.h:36
Array< tvm::tir::Stmt > stmts
The Stmt within in this frame.
Definition: frame.h:39
TVM_DECLARE_BASE_OBJECT_INFO(TIRFrameNode, IRBuilderFrameNode)
static constexpr const char * _type_key
Definition: frame.h:46
static void RegisterReflection()
Definition: frame.h:41
Managed reference to TIRFrameNode.
Definition: frame.h:55
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(TIRFrame, IRBuilderFrame, TIRFrameNode)
A frame that represents then.
Definition: frame.h:677
TVM_DECLARE_FINAL_OBJECT_INFO(ThenFrameNode, TIRFrameNode)
static void RegisterReflection()
Definition: frame.h:679
void EnterWithScope() final
The method called when entering RAII scope.
Managed reference to ThenFrameNode.
Definition: frame.h:705
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(ThenFrame, TIRFrame, ThenFrameNode)
A frame that represents while loop.
Definition: frame.h:598
TVM_DECLARE_FINAL_OBJECT_INFO(WhileFrameNode, TIRFrameNode)
static void RegisterReflection()
Definition: frame.h:603
PrimExpr condition
The termination condition of while.
Definition: frame.h:601
void ExitWithScope() final
The method called when exiting RAII scope.
Managed reference to WhileFrameNode.
Definition: frame.h:624
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(WhileFrame, TIRFrame, WhileFrameNode)
Managed reference to BufferRegionNode.
Definition: stmt.h:871
Buffer is a symbolic n-darray structure. It is a composition of primitive symbolic types,...
Definition: buffer.h:157
Iteration Variable, represents an iteration over an integer interval.
Definition: var.h:298
Container of all statements.
Definition: stmt.h:64
a named variable in TIR
Definition: var.h:78
Definition: repr_printer.h:91
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
TIR statements.