24 #ifndef TVM_ARITH_INT_SET_H_ 25 #define TVM_ARITH_INT_SET_H_ 30 #include <unordered_map> 83 bool IsNothing()
const;
85 bool IsEverything()
const;
87 bool IsSinglePoint()
const;
101 bool CanProveSinglePoint(
Analyzer* ana)
const;
105 bool CanProvePositive()
const;
107 bool CanProveNegative()
const;
109 bool CanProveNonPositive()
const;
111 bool CanProveNonNegative()
const;
113 bool HasUpperBound()
const;
115 bool HasLowerBound()
const;
132 static IntSet Everything();
241 using ExprIntSetMap = std::unordered_map<PrimExpr, IntSet, ObjectPtrHash, ObjectPtrEqual>;
251 const std::unordered_map<const VarNode*, IntSet>& dom_map);
340 #endif // TVM_ARITH_INT_SET_H_ IntSet UnionLowerBound(const Array< IntSet > &sets)
Create a lower-bound of union set, where some of the segments may be dropped.
PrimExpr min(PrimExpr a, PrimExpr b, Span span=Span())
take minimum of two values
SignType
Sign type of an integer expression.
Definition: int_set.h:50
static constexpr const char * _type_key
Definition: int_set.h:59
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Map< Var, arith::IntSet > AsIntSet(const Map< Var, Range > &var_dom)
Converts the Ranges to IntSets.
ExprIntSetMap EvalSetForEachSubExpr(PrimExpr e, const std::unordered_map< const VarNode *, IntSet > &dom_map)
Find the integer set of every sub-expression, given the domain of each iteration variables.
base class of all object containers.
Definition: object.h:167
IntSet Union(const Array< IntSet > &sets)
Create a union set of all sets, possibly relaxed.
TVM_DECLARE_BASE_OBJECT_INFO(IntSetNode, Object)
Range constainer.
Definition: expr.h:715
Base class of all Integer set containers. represent a set of integers in one dimension.
Definition: int_set.h:57
IntSet EvalSet(PrimExpr e, const Map< IterVar, IntSet > &dom_map)
Find an symbolic integer set that contains all possible values of e given the domain of each iteratio...
std::unordered_map< PrimExpr, IntSet, ObjectPtrHash, ObjectPtrEqual > ExprIntSetMap
Map from Expr to IntSet.
Definition: int_set.h:241
Managed reference to IntSetNode.
Definition: int_set.h:68
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Map< Var, IntSet > ConvertDomMap(const std::unordered_map< const VarNode *, IntSet > &dom_map)
Convert std::unordered_map<const VarNode*, IntSet> to Map<Var, IntSet>
PrimExpr max(PrimExpr a, PrimExpr b, Span span=Span())
take maximum of two values
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:713
IntSet Intersect(const Array< IntSet > &sets)
Create an intersected set of all sets.
Base class of all object reference.
Definition: object.h:511
Optional< Array< IntSet > > EstimateRegionLowerBound(const Array< Range > ®ion, const Map< Var, Range > &var_dom, const PrimExpr &predicate, arith::Analyzer *analyzer)
Analyze the region with affine map, given the domain of variables and their predicate. Some subregion may be discarded during the lower-bound analysis.
Array< IntSet > UnionRegionLowerBound(const Array< Array< IntSet >> &nd_int_sets)
The union of N-dimensional integer sets.
Array< IntSet > UnionRegion(const Array< Array< IntSet >> &nd_int_sets)
The union of N-dimensional integer sets.
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
Optional< Array< IntSet > > EstimateRegionStrictBound(const Array< Range > ®ion, const Map< Var, Range > &var_dom, const PrimExpr &predicate, arith::Analyzer *analyzer)
Analyze the region with affine map, given the domain of variables and their predicate. The result should be strict, i.e. no region is discarded or relaxed.
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
static constexpr bool _type_has_method_sequal_reduce
Definition: int_set.h:60
Reference to PrimExprNode.
Definition: expr.h:114
Array< IntSet > EstimateRegionUpperBound(const Array< Range > ®ion, const Map< Var, Range > &var_dom, const PrimExpr &predicate, arith::Analyzer *analyzer)
Analyze the region with affine map, given the domain of variables and their predicate Relaxation of t...
Analyzer that contains bunch of sub-analyzers.
Definition: analyzer.h:579