tvm
Public Member Functions | Static Public Member Functions | List of all members
tvm::arith::IntSet Class Reference

Managed reference to IntSetNode. More...

#include <int_set.h>

Inheritance diagram for tvm::arith::IntSet:
Collaboration diagram for tvm::arith::IntSet:

Public Member Functions

Range CoverRange (Range max_range) const
 Find a range that covers the region. More...
 
PrimExpr min () const
 
PrimExpr max () const
 
SignType GetSignType () const
 
bool IsNothing () const
 
bool IsEverything () const
 
bool IsSinglePoint () const
 
bool CanProveSinglePoint (Analyzer *ana) const
 Check if we can prove it is a single point. More...
 
bool CanProvePositive () const
 
bool CanProveNegative () const
 
bool CanProveNonPositive () const
 
bool CanProveNonNegative () const
 
bool HasUpperBound () const
 
bool HasLowerBound () const
 
PrimExpr PointValue () const
 The single point value, call only if IsSinglePoint is true. More...
 
bool MatchRange (const tvm::Range &r) const
 Try to match IntSet with range r. More...
 
 TVM_DEFINE_OBJECT_REF_METHODS (IntSet, ObjectRef, IntSetNode)
 
- Public Member Functions inherited from tvm::runtime::ObjectRef
 ObjectRef ()=default
 default constructor More...
 
 ObjectRef (ObjectPtr< Object > data)
 Constructor from existing object ptr. More...
 
bool same_as (const ObjectRef &other) const
 Comparator. More...
 
bool operator== (const ObjectRef &other) const
 Comparator. More...
 
bool operator!= (const ObjectRef &other) const
 Comparator. More...
 
bool operator< (const ObjectRef &other) const
 Comparator. More...
 
bool defined () const
 
const Objectget () const
 
const Objectoperator-> () const
 
bool unique () const
 
int use_count () const
 
template<typename ObjectType , typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>>
const ObjectType * as () const
 Try to downcast the internal Object to a raw pointer of a corresponding type. More...
 
template<typename ObjectRefType , typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>>
Optional< ObjectRefType > as () const
 Try to downcast the ObjectRef to a Optional<T> of the requested type. More...
 

Static Public Member Functions

static IntSet Nothing ()
 
static IntSet Everything ()
 
static IntSet SinglePoint (PrimExpr point)
 construct a point set. More...
 
static IntSet Vector (PrimExpr vec)
 construct a integer set from vector expression. More...
 
static IntSet FromMinExtent (PrimExpr min, PrimExpr extent)
 Construct a set representing a range [min, min + extent). More...
 
static IntSet FromRange (tvm::Range r)
 Construct a set representing a range. More...
 
static IntSet Interval (PrimExpr min, PrimExpr max)
 Construct a set representing a interval. More...
 

Additional Inherited Members

- Public Types inherited from tvm::runtime::ObjectRef
using ContainerType = Object
 type indicate the container type. More...
 
- Static Public Attributes inherited from tvm::runtime::ObjectRef
static constexpr bool _type_is_nullable = true
 
- Protected Member Functions inherited from tvm::runtime::ObjectRef
Objectget_mutable () const
 
- Static Protected Member Functions inherited from tvm::runtime::ObjectRef
template<typename T >
static T DowncastNoCheck (ObjectRef ref)
 Internal helper function downcast a ref without check. More...
 
static void FFIClearAfterMove (ObjectRef *ref)
 Clear the object ref data field without DecRef after we successfully moved the field. More...
 
template<typename ObjectType >
static ObjectPtr< ObjectType > GetDataPtr (const ObjectRef &ref)
 Internal helper function get data_ as ObjectPtr of ObjectType. More...
 
- Protected Attributes inherited from tvm::runtime::ObjectRef
ObjectPtr< Objectdata_
 Internal pointer that backs the reference. More...
 

Detailed Description

Managed reference to IntSetNode.

See also
IntSetNode

Member Function Documentation

◆ CanProveNegative()

bool tvm::arith::IntSet::CanProveNegative ( ) const
Returns
Whether the set is proved to be smaller than 0

◆ CanProveNonNegative()

bool tvm::arith::IntSet::CanProveNonNegative ( ) const
Returns
Whether the set is proved to be larger than or equal to 0

◆ CanProveNonPositive()

bool tvm::arith::IntSet::CanProveNonPositive ( ) const
Returns
Whether the set is proved to be smaller than or equal to 0

◆ CanProvePositive()

bool tvm::arith::IntSet::CanProvePositive ( ) const
Returns
Whether the set is proved to be bigger than 0

◆ CanProveSinglePoint()

bool tvm::arith::IntSet::CanProveSinglePoint ( Analyzer ana) const

Check if we can prove it is a single point.

Unlike IsSinglePoint, which only checks ptr equality this function will invoke analyzer to do stonger proofs but also takes longer time.

Use this function in some of the primitives but do not use it in the inner loop of simplification.

Parameters
anaAnalyzer used in the proof.
Returns
Whether we can prove it is a single point

◆ CoverRange()

Range tvm::arith::IntSet::CoverRange ( Range  max_range) const

Find a range that covers the region.

Parameters
max_rangeThe range to be covered.
Returns
The covering range.

◆ Everything()

static IntSet tvm::arith::IntSet::Everything ( )
static
Returns
The set contains everything

◆ FromMinExtent()

static IntSet tvm::arith::IntSet::FromMinExtent ( PrimExpr  min,
PrimExpr  extent 
)
static

Construct a set representing a range [min, min + extent).

Parameters
minThe minimum of the range range
extentThe extent of the range.
Returns
The constructed set.

◆ FromRange()

static IntSet tvm::arith::IntSet::FromRange ( tvm::Range  r)
static

Construct a set representing a range.

Parameters
rThe range
Returns
The constructed set.

◆ GetSignType()

SignType tvm::arith::IntSet::GetSignType ( ) const
Returns
The sign of the elements in the integer set

◆ HasLowerBound()

bool tvm::arith::IntSet::HasLowerBound ( ) const
Returns
Whether the set has lower bound.

◆ HasUpperBound()

bool tvm::arith::IntSet::HasUpperBound ( ) const
Returns
Whether the set has upper bound.

◆ Interval()

static IntSet tvm::arith::IntSet::Interval ( PrimExpr  min,
PrimExpr  max 
)
static

Construct a set representing a interval.

Parameters
minThe minimum value of the interval.
maxThe maximum value of the interval.
Returns
The constructed set.

◆ IsEverything()

bool tvm::arith::IntSet::IsEverything ( ) const
Returns
Whether the set represent everything

◆ IsNothing()

bool tvm::arith::IntSet::IsNothing ( ) const
Returns
Whether the set represent nothing

◆ IsSinglePoint()

bool tvm::arith::IntSet::IsSinglePoint ( ) const
Returns
Whether the set is a single point

◆ MatchRange()

bool tvm::arith::IntSet::MatchRange ( const tvm::Range r) const

Try to match IntSet with range r.

Note
It is guanrateed that IntSet::FromRange(r).MatchRange(r) == true
Returns
true if we can prove they are the same.

◆ max()

PrimExpr tvm::arith::IntSet::max ( ) const
Returns
upper bound of the set

◆ min()

PrimExpr tvm::arith::IntSet::min ( ) const
Returns
Lower bound of the set

◆ Nothing()

static IntSet tvm::arith::IntSet::Nothing ( )
static
Returns
The set contains nothing

◆ PointValue()

PrimExpr tvm::arith::IntSet::PointValue ( ) const

The single point value, call only if IsSinglePoint is true.

Returns
The point value.

◆ SinglePoint()

static IntSet tvm::arith::IntSet::SinglePoint ( PrimExpr  point)
static

construct a point set.

Parameters
pointThe point in the set.
Returns
construct a single point set

◆ TVM_DEFINE_OBJECT_REF_METHODS()

tvm::arith::IntSet::TVM_DEFINE_OBJECT_REF_METHODS ( IntSet  ,
ObjectRef  ,
IntSetNode   
)

◆ Vector()

static IntSet tvm::arith::IntSet::Vector ( PrimExpr  vec)
static

construct a integer set from vector expression.

Parameters
vecThe vector expression, can also be single point.
Returns
The result set containing the indices in the vector.

The documentation for this class was generated from the following file: