tvm
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
schedule.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 
24 // Acknowledgement: Many schedule primitives originate from Halide and Loopy.
25 #ifndef TVM_TE_SCHEDULE_H_
26 #define TVM_TE_SCHEDULE_H_
27 
28 #include <tvm/support/with.h>
29 #include <tvm/te/tensor.h>
30 #include <tvm/te/tensor_intrin.h>
31 #include <tvm/tir/expr.h>
32 #include <tvm/tir/index_map.h>
33 
34 #include <string>
35 #include <unordered_map>
36 
37 namespace tvm {
38 namespace te {
39 // Node container for Stage
40 class StageNode;
41 // Node container for Schedule
42 class ScheduleNode;
43 // Node container for IterVarRelation
44 class IterVarRelationNode;
45 // Attribute of itervar.
46 class IterVarAttrNode;
47 
49 enum AttachType : int {
51  kInline = 2,
53  kScope = 4,
55 };
56 
58 class Stage : public ObjectRef {
59  public:
60  Stage() {}
61  explicit Stage(ObjectPtr<Object> n) : ObjectRef(n) {}
67  explicit Stage(Operation op, const ScheduleNode* sch);
72  inline const StageNode* operator->() const;
77  inline StageNode* operator->();
82  TVM_DLL Stage& set_scope(std::string scope); // NOLINT(*)
89  TVM_DLL Stage& compute_at(Stage parent, IterVar scope); // NOLINT(*)
94  TVM_DLL Stage& compute_inline(); // NOLINT(*)
99  TVM_DLL Stage& compute_root(); // NOLINT(*)
107  TVM_DLL Stage& bind(IterVar ivar, IterVar thread_ivar);
118  TVM_DLL Stage& set_store_predicate(PrimExpr predicate);
127  TVM_DLL Stage& env_threads(Array<IterVar> threads);
136  TVM_DLL Stage& split(IterVar parent, PrimExpr factor, IterVar* p_outer,
137  IterVar* p_inner); // NOLINT(*)
147  TVM_DLL Stage& split_by_nparts(IterVar parent, PrimExpr nparts, IterVar* p_outer,
148  IterVar* p_inner); // NOLINT(*)
156  TVM_DLL Stage& fuse(IterVar outer, IterVar inner, IterVar* p_target); // NOLINT(*)
170  TVM_DLL Stage& fuse(const Array<IterVar>& axes, IterVar* p_target); // NOLINT(*)
176  TVM_DLL Stage& reorder(const Array<IterVar>& order); // NOLINT(*)
192  TVM_DLL Stage& tile(IterVar x_parent, IterVar y_parent, // NOLINT(*)
193  PrimExpr x_factor, PrimExpr y_factor, IterVar* p_x_outer, IterVar* p_y_outer,
194  IterVar* p_x_inner, IterVar* p_y_inner);
200  TVM_DLL Stage& vectorize(IterVar var); // NOLINT(*)
208  TVM_DLL Stage& tensorize(IterVar var, TensorIntrin f); // NOLINT(*)
214  TVM_DLL Stage& unroll(IterVar var); // NOLINT(*)
220  TVM_DLL Stage& parallel(IterVar var); // NOLINT(*)
230  TVM_DLL Stage& pragma(IterVar var, const std::string& pragma_type,
231  const PrimExpr& pragma_value = PrimExpr()); // NOLINT(*)
239  TVM_DLL Stage& prefetch(const Tensor& domain, IterVar var, PrimExpr offset); // NOLINT(*)
250  TVM_DLL Stage& storage_align(IterVar axis, int factor, int offset); // NOLINT(*)
255  TVM_DLL Stage& double_buffer(); // NOLINT(*)
260  TVM_DLL Stage& rolling_buffer(); // NOLINT(*)
285  TVM_DLL Stage& transform_layout(const Array<Var>& initial_indices,
286  const Array<PrimExpr>& final_indices,
287  Array<IterVar>* out_iter_vars = nullptr);
300  bool is_scheduled() const;
308  Stage GetAttachSpec() const;
309  // declare container type
311 };
312 
318 class Schedule : public ObjectRef {
319  public:
320  Schedule() {}
327  TVM_DLL explicit Schedule(Array<Operation> ops);
332  Schedule copy() const;
337  TVM_DLL Stage operator[](const Operation& op);
343  TVM_DLL Stage operator[](const Tensor& tensor) { return this->operator[](tensor->op); }
353  TVM_DLL Stage create_group(const Array<Tensor>& outputs, const Array<Tensor>& inputs,
354  bool include_inputs = false);
364  TVM_DLL Tensor cache_read(const Tensor& tensor, const std::string& scope,
365  const Array<Operation>& readers);
382  TVM_DLL Array<Tensor> cache_write(const Array<Tensor>& tensor, const std::string& scope);
399  TVM_DLL Tensor cache_write(const Tensor& tensor, const std::string& scope);
413  TVM_DLL Array<Tensor> rfactor(const Tensor& tensor, const IterVar& axis, int factor_axis = 0);
422  Schedule normalize();
423 
433  Schedule normalize_for_feature_extraction();
434 
439  inline const ScheduleNode* operator->() const;
444  inline ScheduleNode* operator->();
445  // declare container type
447 };
448 
457  private:
458  friend class With<ScheduleContext>;
459  ScheduleContext(const ScheduleNode* sch_node, String current_primitive_name);
460  void EnterWithScope();
461  void ExitWithScope();
462 
464  Schedule sch_;
466  String current_primitive_name_;
467 };
468 
473 class IterVarRelation : public ObjectRef {
474  public:
481  inline const IterVarRelationNode* operator->() const;
482 };
483 
487 class IterVarAttr : public ObjectRef {
488  public:
495  inline const IterVarAttrNode* operator->() const;
496 };
497 
513 class StageNode : public Object {
514  public:
565  AttachType attach_type{kGroupRoot};
573  std::string scope;
575  bool is_output{false};
577  bool double_buffer{false};
579  bool rolling_buffer{false};
594  int num_child_stages{0};
595 
597  v->Visit("op", &op);
598  v->Visit("origin_op", &origin_op);
599  v->Visit("all_iter_vars", &all_iter_vars);
600  v->Visit("leaf_iter_vars", &leaf_iter_vars);
601  v->Visit("env_threads", &env_threads);
602  v->Visit("relations", &relations);
603  v->Visit("iter_var_attrs", &iter_var_attrs);
604  v->Visit("attach_type", &attach_type);
605  v->Visit("attach_ivar", &attach_ivar);
606  v->Visit("attach_stage", &attach_stage);
607  v->Visit("scope", &scope);
608  v->Visit("is_output", &is_output);
609  v->Visit("double_buffer", &double_buffer);
610  v->Visit("layout_transforms", &layout_transforms);
611  v->Visit("axis_separators", &axis_separators);
612  v->Visit("group", &group);
613  v->Visit("num_child_stages", &num_child_stages);
614  }
615 
616  static constexpr const char* _type_key = "Stage";
618 };
619 
621 class ScheduleNode : public Object {
622  public:
640  std::unordered_map<const Object*, Stage> op2stage_cache_;
656 
658  v->Visit("outputs", &outputs);
659  v->Visit("stages", &stages);
660  v->Visit("groups", &groups);
661  v->Visit("stage_map", &stage_map);
662  v->Visit("schedule_record", &schedule_record);
663  v->Visit("primitive_record", &primitive_record);
664  v->Visit("keep_schedule_record", &keep_schedule_record);
665  }
666 
668  void InitCache();
670  void InvalidateCache();
671 
677  TVM_DLL bool Contain(const Operation& op) const;
678 
684  TVM_DLL bool Contain(const Tensor& tensor) const { return Contain(tensor->op); }
685 
686  static constexpr const char* _type_key = "Schedule";
688 };
689 
695 inline Schedule create_schedule(Array<Operation> ops) { return Schedule(ops); }
696 
698 class IterVarAttrNode : public Object {
699  public:
701  IterVarType iter_type{kDataPar};
714  int dim_align_factor{0};
716  int dim_align_offset{0};
725 
727  v->Visit("iter_type", &iter_type);
728  v->Visit("bind_thread", &bind_thread);
729  v->Visit("prefetch_data", &prefetch_data);
730  v->Visit("prefetch_offset", &prefetch_offset);
731  v->Visit("tensor_intrin", &tensor_intrin);
732  v->Visit("dim_align_factor", &dim_align_factor);
733  v->Visit("dim_align_offset", &dim_align_offset);
734  v->Visit("pragma_keys", &pragma_keys);
735  v->Visit("pragma_values", &pragma_values);
736  }
737 
738  static constexpr const char* _type_key = "IterVarAttr";
740 };
741 
743 class IterVarRelationNode : public Object {
744  public:
745  static constexpr const char* _type_key = "IterVarRelation";
747 };
748 
754  public:
765 
767  v->Visit("parent", &parent);
768  v->Visit("outer", &outer);
769  v->Visit("inner", &inner);
770  v->Visit("factor", &factor);
771  v->Visit("nparts", &nparts);
772  }
773 
774  static constexpr const char* _type_key = "Split";
776 };
777 
782 class Split : public IterVarRelation {
783  public:
784  TVM_DLL Split(IterVar parent, IterVar outer, IterVar inner, PrimExpr factor, PrimExpr nparts);
785 
787 };
788 
793  public:
800 
802  v->Visit("outer", &outer);
803  v->Visit("inner", &inner);
804  v->Visit("fused", &fused);
805  }
806 
807  static constexpr const char* _type_key = "Fuse";
809 };
810 
815 class Fuse : public IterVarRelation {
816  public:
817  TVM_DLL Fuse(IterVar outer, IterVar inner, IterVar fused);
818 
820 };
821 
828  public:
833 
835  v->Visit("parent", &parent);
836  v->Visit("rebased", &rebased);
837  }
838 
839  static constexpr const char* _type_key = "Rebase";
841 };
842 
847 class Rebase : public IterVarRelation {
848  public:
849  TVM_DLL Rebase(IterVar parent, IterVar rebased);
850 
852 };
853 
858  public:
861 
862  void VisitAttrs(AttrVisitor* v) { v->Visit("iter", &iter); }
863 
864  static constexpr const char* _type_key = "Singleton";
866 };
867 
872 class Singleton : public IterVarRelation {
873  public:
874  TVM_DLL explicit Singleton(IterVar iter);
875 
877 };
878 
883  public:
892 
900 
906 
913 
915  v->Visit("original_variables", &original_variables);
916  v->Visit("transformed_variables", &transformed_variables);
917  v->Visit("forward_transformation", &forward_transformation);
918  v->Visit("inverse_transformation", &inverse_transformation);
919  }
920 
921  static constexpr const char* _type_key = "Transform";
923 };
924 
925 class Transform : public IterVarRelation {
926  public:
927  TVM_DLL explicit Transform(Array<IterVar> original_variables,
928  Array<IterVar> transformed_variables, IndexMap forward_transformation,
929  IndexMap inverse_transformation);
930 
932 };
933 
936  public:
943 
944  void VisitAttrs(AttrVisitor* v) { v->Visit("clauses", &clauses); }
945 
946  static constexpr const char* _type_key = "SpecializedCondition";
948 };
949 
954  public:
959  TVM_DLL SpecializedCondition(Array<PrimExpr> conditions); // NOLINT(*)
960 
965  TVM_DLL static SpecializedCondition Current();
966 
968  class Internal;
969 
970  private:
971  // enable with syntax.
972  friend class Internal;
973  friend class With<SpecializedCondition>;
975  TVM_DLL void EnterWithScope();
977  TVM_DLL void ExitWithScope();
978 };
979 
980 // implementations
981 inline const StageNode* Stage::operator->() const { return static_cast<const StageNode*>(get()); }
982 inline StageNode* Stage::operator->() { return static_cast<StageNode*>(get_mutable()); }
983 
984 inline const ScheduleNode* Schedule::operator->() const {
985  return static_cast<const ScheduleNode*>(get());
986 }
987 inline ScheduleNode* Schedule::operator->() { return static_cast<ScheduleNode*>(get_mutable()); }
988 
990  return static_cast<const IterVarRelationNode*>(get());
991 }
992 
994  return static_cast<const IterVarAttrNode*>(get());
995 }
996 
997 } // namespace te
998 } // namespace tvm
999 #endif // TVM_TE_SCHEDULE_H_
Context helper to collect debug information of Schedule.
Definition: schedule.h:456
Array< Stage > groups
List of all stage groups.
Definition: schedule.h:633
Stage()
Definition: schedule.h:60
Array< Schedule > schedule_record
list of all transformed schedules User can display the optimization strategy via TEDD step by step to...
Definition: schedule.h:647
Split the parent domain into product of outer and iter.
Definition: schedule.h:753
Array< IterVar > original_variables
The loop variables that were replaced by the transformation.
Definition: schedule.h:891
Stage & compute_root()
Compute the function at group root.
Managed reference to RebaseNode.
Definition: schedule.h:847
represents a stage.
Definition: schedule.h:513
A custom smart pointer for Object.
Definition: object.h:358
IterVar bind_thread
The thread this iter Var binds, can be null.
Definition: schedule.h:703
Global schedule container For operations and all the operations they depend on. The schedule per Oper...
Definition: schedule.h:318
IterVar outer
The outer domain.
Definition: schedule.h:795
Stage operator[](const Tensor &tensor)
Short hand for getting the stage of tensor&#39;s operation.
Definition: schedule.h:343
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:596
Schedule create_schedule(Array< Operation > ops)
Create a schedule for array of ops(and their dependencies).
Definition: schedule.h:695
Stage(ObjectPtr< Object > n)
Definition: schedule.h:61
Array< Operation > outputs
The output operations in original data flow graph.
Definition: schedule.h:624
Definition: schedule.h:54
const ScheduleNode * attach_sch
The schedule current stage is attached to.
Definition: schedule.h:571
const IterVarRelationNode * operator->() const
access the internal node container
Definition: schedule.h:989
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:657
Fuse two domains into one domain.
Definition: schedule.h:792
Stage attach_stage
The stage this node attaches to.
Definition: schedule.h:569
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
IterVar fused
The target domain.
Definition: schedule.h:799
IterVar inner
The inner domain.
Definition: schedule.h:760
IndexMap inverse_transformation
Map from transformed variables to the original variables.
Definition: schedule.h:912
Schedule()
Definition: schedule.h:320
Operation that produces tensors.
Definition: tensor.h:47
IterVar inner
The inner domain.
Definition: schedule.h:797
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:834
Iteration Variable, represents an iteration over an integer interval.
Definition: var.h:308
PrimExpr nparts
Number of parts, only factor or nparts can be given.
Definition: schedule.h:764
Stage, contains scheduling for a stage of computation.
Definition: schedule.h:58
IndexMap forward_transformation
Map from the original variables to the transformed variables.
Definition: schedule.h:905
IterVar attach_ivar
The attach point of this schedule.
Definition: schedule.h:567
Stage & compute_at(Stage parent, IterVar scope)
specify the schedule to be computed at the parent schedule&#39;s scope.
AttachType
the attachment type
Definition: schedule.h:49
Array< IntImm > axis_separators
List of axes after which to divide physical axes.
Definition: schedule.h:587
Specialized condition to enable op specialization.
Definition: schedule.h:953
base class of all object containers.
Definition: object.h:167
std::string scope
The thread storage scope level of the stage.
Definition: schedule.h:573
Array< IterVar > all_iter_vars
All the nodes in the iter var.
Definition: schedule.h:539
Stage & set_scope(std::string scope)
set the memory scope of the stage
Operation op
The operation of stage, can be different from original op. If it is null, then this stage is a group ...
Definition: schedule.h:519
Optional< Bool > keep_schedule_record
Flag to keep schedule record or not.
Definition: schedule.h:655
Definition: schedule.h:51
Managed reference to SplitNode.
Definition: schedule.h:782
Stage & set_store_predicate(PrimExpr predicate)
Set the predicate to determine whether a store to the array should be performed. Use this when there ...
Defines a remapping of buffer indices.
IterVarAttr()
Definition: schedule.h:489
bool is_scheduled() const
whether the stage has been scheduled.
Stage & double_buffer()
Compute current stage with double buffering.
Container for specialization conditions.
Definition: schedule.h:935
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
TensorIntrin tensor_intrin
Tensor intrinsic used in tensorization, when the axis is marked as Tensorized.
Definition: schedule.h:712
Dataflow tensor object.
Definition: schedule.h:925
Stage & unroll(IterVar var)
Unroll iteration.
IterVarType
Type of iteration variable. Each IterVar have a specific type.
Definition: var.h:185
Rebase the iteration to make min to be 0. This is useful to normalize the Schedule to make every leaf...
Definition: schedule.h:827
Stage group
The parent group of the current stage. The stage cannot be assigned to stages outside the group...
Definition: schedule.h:592
The schedule relation between IterVars can be Split, Fuse.
Definition: schedule.h:473
Managed reference to TensorIntrinNode.
Definition: tensor_intrin.h:93
Array< IndexMap > layout_transforms
Layout transformations to be applied onto the stage&#39;s tensors.
Definition: schedule.h:581
TIR expressions.
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:801
IterVarRelation(ObjectPtr< Object > n)
Definition: schedule.h:476
Array< String > primitive_record
list of all applied primitive names.
Definition: schedule.h:651
Definition: schedule.h:50
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Definition: index_map.h:177
Stage & transform_layout(const Array< Var > &initial_indices, const Array< PrimExpr > &final_indices, Array< IterVar > *out_iter_vars=nullptr)
Defines a layout transformation to be applied to the buffer.
Stage & reorder(const Array< IterVar > &order)
Reorder the iteration.
Array< Tensor > prefetch_data
List of tensor to be prefetched in this loop.
Definition: schedule.h:705
const StageNode * operator->() const
access the internal node container
Definition: schedule.h:981
node container for IterVar attr
Definition: schedule.h:698
Managed reference to SingletonNode.
Definition: schedule.h:872
const IterVarAttrNode * operator->() const
access the internal node container
Definition: schedule.h:993
Stage & set_axis_separators(const Array< IntImm > &axis_separators)
Defines separators between groups of axes.
Stage & compute_inline()
Compute the function inline.
Array< IterVar > env_threads
Specify threads to be launched at the stage. This is only valid for composite ops such as Scan...
Definition: schedule.h:553
Reference to string objects.
Definition: string.h:98
Stage & tile(IterVar x_parent, IterVar y_parent, PrimExpr x_factor, PrimExpr y_factor, IterVar *p_x_outer, IterVar *p_y_outer, IterVar *p_x_inner, IterVar *p_y_inner)
Perform tiling on two dimensions The final loop order from outmost to inner most are [x_outer...
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:914
const ScheduleNode * operator->() const
access the internal node container
Definition: schedule.h:984
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:713
Transform iterator according to some arbitrary expression.
Definition: schedule.h:882
RAII wrapper function to enter and exit a context object similar to python&#39;s with syntax...
Definition: with.h:58
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:726
Data parallel iteration. This normally corresponds to axis of Tensor. Allow all IterVar manipulations...
Definition: var.h:194
Array< IterVar > leaf_iter_vars
The current active leaf iter vars in the stage.
Definition: schedule.h:547
Definition: schedule.h:52
IterVar parent
The parent domain.
Definition: schedule.h:756
Var var(std::string name_hint, DataType t=DataType::Int(32))
Construct a new Var expression.
Base class of all object reference.
Definition: object.h:511
Singleton iterator [0, 1)
Definition: schedule.h:857
Stage & parallel(IterVar var)
Parallelize iteration.
Definition: schedule.h:53
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:102
Array< PrimExpr > pragma_keys
Additional pragma keys, array of StringImm.
Definition: schedule.h:720
Managed reference to FuseNode.
Definition: schedule.h:815
PrimExpr factor
The split factor.
Definition: schedule.h:762
Stage & env_threads(Array< IterVar > threads)
Specify environment threads that launched around the group&#39;s scope. This can only be used in group st...
constexpr const char * axis_separators
Marks the physical axis separators.
Definition: stmt.h:1391
Stage & vectorize(IterVar var)
Vectorize iteration.
#define TVM_DECLARE_FINAL_OBJECT_INFO(TypeName, ParentType)
helper macro to declare type information in a final class.
Definition: object.h:671
Tensor intrinsic operations.
Schedule(ObjectPtr< Object > n)
Definition: schedule.h:321
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:862
Stage & bind(IterVar ivar, IterVar thread_ivar)
Bind the IterVar to thread index.
Stage & rolling_buffer()
Compute current stage with rolling buffering.
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places.
Definition: map.h:1271
Stage & pragma(IterVar var, const std::string &pragma_type, const PrimExpr &pragma_value=PrimExpr())
Annotate the iteration with pragma.
Array< IterVar > transformed_variables
The variables generated by the transformation.
Definition: schedule.h:899
Map< IterVar, IterVarAttr > iter_var_attrs
additional attributes about iter var.
Definition: schedule.h:563
PrimExpr store_predicate
The predicate under which store can happen Use this when there can be duplicated threads doing the sa...
Definition: schedule.h:559
Array< IterVarRelation > relations
The relation bwteen of IterVars.
Definition: schedule.h:561
Stage GetAttachSpec() const
Get attachment spec of current stage. If the stage compute at Group root, this function will traverse...
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
IterVar rebased
The inner domain.
Definition: schedule.h:832
IterVarRelation()
Definition: schedule.h:475
Stage & split(IterVar parent, PrimExpr factor, IterVar *p_outer, IterVar *p_inner)
Split the parent by factor, generate.
IterVar outer
The outer domain.
Definition: schedule.h:758
Operation origin_op
The original operator. The op field can change during schedule to alternate the dataflow, while origin_op remains fixed.
Definition: schedule.h:525
Stage & fuse(IterVar outer, IterVar inner, IterVar *p_target)
Fuse the inner outer domain to the target.
IterVarAttr(ObjectPtr< Object > n)
Definition: schedule.h:490
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:944
base node of iteration var
Definition: schedule.h:743
Reference to PrimExprNode.
Definition: expr.h:114
void VisitAttrs(AttrVisitor *v)
Definition: schedule.h:766
node container for schedule
Definition: schedule.h:621
std::unordered_map< const Object *, Stage > op2stage_cache_
Internal stage map to map internal ops to stages. This is created on demand and can be invalidated...
Definition: schedule.h:640
Stage & storage_align(IterVar axis, int factor, int offset)
Set alignment requirement for specific dimension.
bool Contain(const Tensor &tensor) const
Check if the schedule contains a Tensor.
Definition: schedule.h:684
Object * get_mutable() const
Definition: object.h:576
Stage & split_by_nparts(IterVar parent, PrimExpr nparts, IterVar *p_outer, IterVar *p_inner)
Split the iteration with given number of parts.
Array< PrimExpr > prefetch_offset
The offset used in each prefetch.
Definition: schedule.h:707
Array< Stage > stages
list of all stages for ops. The stages are sorted in dependency order.
Definition: schedule.h:629
#define TVM_DECLARE_BASE_OBJECT_INFO(TypeName, ParentType)
helper macro to declare a base object type that can be inherited.
Definition: object.h:648
Additional scheduable attributes about IterVar.
Definition: schedule.h:487
Stage & tensorize(IterVar var, TensorIntrin f)
Replace computation of the current stage by tensor intrinsic f.
Array< PrimExpr > pragma_values
Additional values of pragma, if any.
Definition: schedule.h:724
Map< Operation, Stage > stage_map
map of original operation to the stages
Definition: schedule.h:635
Array< PrimExpr > clauses
List of conditions in conjunctive joint form (CNF). Each condition should be a simple expression...
Definition: schedule.h:942
IterVar iter
The singleton iterator.
Definition: schedule.h:860
Stage & prefetch(const Tensor &domain, IterVar var, PrimExpr offset)
Fetch data in advance.
RAII wrapper function to enter and exit a context object similar to python&#39;s with syntax...
IterVar parent
The parent domain.
Definition: schedule.h:830