tvm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
tvm::sym::IntSet Class Reference

Managed reference to IntSetObj. More...

#include <int_set.h>

Inheritance diagram for tvm::sym::IntSet:
Collaboration diagram for tvm::sym::IntSet:

Public Member Functions

TVM_TIRX_DLL ffi::Optional< Range > CoverRange (ffi::Optional< Range > max_range) const
 Find a range that covers the region.
 
TVM_TIRX_DLL PrimExpr min () const
 
TVM_TIRX_DLL PrimExpr max () const
 
TVM_TIRX_DLL SignType GetSignType () const
 
TVM_TIRX_DLL bool IsNothing () const
 
TVM_TIRX_DLL bool IsEverything () const
 
TVM_TIRX_DLL bool IsSinglePoint () const
 
TVM_TIRX_DLL bool CanProveSinglePoint (const Analyzer &ana) const
 Check if we can prove it is a single point.
 
TVM_TIRX_DLL bool CanProvePositive () const
 
TVM_TIRX_DLL bool CanProveNegative () const
 
TVM_TIRX_DLL bool CanProveNonPositive () const
 
TVM_TIRX_DLL bool CanProveNonNegative () const
 
TVM_TIRX_DLL bool HasUpperBound () const
 
TVM_TIRX_DLL bool HasLowerBound () const
 
TVM_TIRX_DLL PrimExpr PointValue () const
 The single point value, call only if IsSinglePoint is true.
 
TVM_TIRX_DLL bool MatchRange (const tvm::Range &r) const
 Try to match IntSet with range r.
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE (IntSet, ffi::ObjectRef, IntSetObj)
 

Static Public Member Functions

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

Detailed Description

Managed reference to IntSetObj.

See also
IntSetObj

Member Function Documentation

◆ CanProveNegative()

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

◆ CanProveNonNegative()

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

◆ CanProveNonPositive()

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

◆ CanProvePositive()

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

◆ CanProveSinglePoint()

TVM_TIRX_DLL bool tvm::sym::IntSet::CanProveSinglePoint ( const 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()

TVM_TIRX_DLL ffi::Optional< Range > tvm::sym::IntSet::CoverRange ( ffi::Optional< Range >  max_range) const

Find a range that covers the region.

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

◆ Everything()

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

◆ FromMinExtent()

static TVM_TIRX_DLL IntSet tvm::sym::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 TVM_TIRX_DLL IntSet tvm::sym::IntSet::FromRange ( tvm::Range  r)
static

Construct a set representing a range.

Parameters
rThe range
Returns
The constructed set.

◆ GetSignType()

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

◆ HasLowerBound()

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

◆ HasUpperBound()

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

◆ Interval()

static TVM_TIRX_DLL IntSet tvm::sym::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()

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

◆ IsNothing()

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

◆ IsSinglePoint()

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

◆ MatchRange()

TVM_TIRX_DLL bool tvm::sym::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()

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

◆ min()

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

◆ Nothing()

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

◆ PointValue()

TVM_TIRX_DLL PrimExpr tvm::sym::IntSet::PointValue ( ) const

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

Returns
The point value.

◆ SinglePoint()

static TVM_TIRX_DLL IntSet tvm::sym::IntSet::SinglePoint ( PrimExpr  point)
static

construct a point set.

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

◆ TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE()

tvm::sym::IntSet::TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE ( IntSet  ,
ffi::ObjectRef  ,
IntSetObj   
)

◆ Vector()

static TVM_TIRX_DLL IntSet tvm::sym::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: