Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::Internal::ConstantInterval Struct Reference

A class to represent ranges of integers. More...

#include <ConstantInterval.h>

Public Member Functions

 ConstantInterval ()=default
 
 ConstantInterval (int64_t min, int64_t max)
 Construct an interval from a lower and upper bound.
 
bool is_everything () const
 Is the interval the entire range.
 
bool is_single_point () const
 Is the interval just a single value (min == max)
 
bool is_single_point (int64_t x) const
 Is the interval a particular single value.
 
bool is_bounded () const
 Does the interval have a finite upper and lower bound.
 
void include (const ConstantInterval &i)
 Expand the interval to include another Interval.
 
void include (int64_t x)
 Expand the interval to include a point.
 
bool contains (int32_t x) const
 Test if the interval contains a particular value.
 
bool contains (int64_t x) const
 Test if the interval contains a particular value.
 
bool contains (uint64_t x) const
 Test if the interval contains a particular unsigned value.
 
bool operator== (const ConstantInterval &other) const
 Equivalent to same_as.
 
void operator+= (const ConstantInterval &other)
 In-place versions of the arithmetic operators below.
 
void operator+= (int64_t)
 
void operator-= (const ConstantInterval &other)
 
void operator-= (int64_t)
 
void operator*= (const ConstantInterval &other)
 
void operator*= (int64_t)
 
void operator/= (const ConstantInterval &other)
 
void operator/= (int64_t)
 
void operator%= (const ConstantInterval &other)
 
void operator%= (int64_t)
 
ConstantInterval operator- () const
 Negate an interval.
 
void cast_to (const Type &t)
 Track what happens if a constant integer interval is forced to fit into a concrete integer type.
 

Static Public Member Functions

static ConstantInterval everything ()
 The interval representing everything.
 
static ConstantInterval single_point (int64_t x)
 Construct an interval representing a single point.
 
static ConstantInterval bounded_below (int64_t min)
 Construct intervals bounded above or below.
 
static ConstantInterval bounded_above (int64_t max)
 
static ConstantInterval make_union (const ConstantInterval &a, const ConstantInterval &b)
 Construct the smallest interval containing two intervals.
 
static ConstantInterval make_intersection (const ConstantInterval &a, const ConstantInterval &b)
 Construct the largest interval contained within two intervals.
 
static ConstantInterval bounds_of_type (Type)
 Get constant integer bounds on a type.
 

Public Attributes

int64_t min = 0
 The lower and upper bound of the interval.
 
int64_t max = 0
 
bool min_defined = false
 
bool max_defined = false
 

Detailed Description

A class to represent ranges of integers.

Can be unbounded above or below, but they cannot be empty.

Definition at line 18 of file ConstantInterval.h.

Constructor & Destructor Documentation

◆ ConstantInterval() [1/2]

Halide::Internal::ConstantInterval::ConstantInterval ( )
default

◆ ConstantInterval() [2/2]

Halide::Internal::ConstantInterval::ConstantInterval ( int64_t min,
int64_t max )

Construct an interval from a lower and upper bound.

Member Function Documentation

◆ everything()

static ConstantInterval Halide::Internal::ConstantInterval::everything ( )
static

The interval representing everything.

◆ single_point()

static ConstantInterval Halide::Internal::ConstantInterval::single_point ( int64_t x)
static

Construct an interval representing a single point.

Referenced by Halide::Internal::Simplify::ExprInfo::trim_bounds_using_alignment().

◆ bounded_below()

static ConstantInterval Halide::Internal::ConstantInterval::bounded_below ( int64_t min)
static

Construct intervals bounded above or below.

◆ bounded_above()

static ConstantInterval Halide::Internal::ConstantInterval::bounded_above ( int64_t max)
static

◆ is_everything()

bool Halide::Internal::ConstantInterval::is_everything ( ) const

Is the interval the entire range.

◆ is_single_point() [1/2]

bool Halide::Internal::ConstantInterval::is_single_point ( ) const

Is the interval just a single value (min == max)

Referenced by Halide::Internal::Simplify::ExprInfo::trim_bounds_using_alignment().

◆ is_single_point() [2/2]

bool Halide::Internal::ConstantInterval::is_single_point ( int64_t x) const

Is the interval a particular single value.

◆ is_bounded()

bool Halide::Internal::ConstantInterval::is_bounded ( ) const

Does the interval have a finite upper and lower bound.

Referenced by Halide::Internal::Simplify::ExprInfo::trim_bounds_using_alignment().

◆ include() [1/2]

void Halide::Internal::ConstantInterval::include ( const ConstantInterval & i)

Expand the interval to include another Interval.

◆ include() [2/2]

void Halide::Internal::ConstantInterval::include ( int64_t x)

Expand the interval to include a point.

◆ contains() [1/3]

bool Halide::Internal::ConstantInterval::contains ( int32_t x) const

Test if the interval contains a particular value.

◆ contains() [2/3]

bool Halide::Internal::ConstantInterval::contains ( int64_t x) const

Test if the interval contains a particular value.

◆ contains() [3/3]

bool Halide::Internal::ConstantInterval::contains ( uint64_t x) const

Test if the interval contains a particular unsigned value.

◆ make_union()

static ConstantInterval Halide::Internal::ConstantInterval::make_union ( const ConstantInterval & a,
const ConstantInterval & b )
static

Construct the smallest interval containing two intervals.

◆ make_intersection()

static ConstantInterval Halide::Internal::ConstantInterval::make_intersection ( const ConstantInterval & a,
const ConstantInterval & b )
static

Construct the largest interval contained within two intervals.

Throws an error if the interval is empty.

Referenced by Halide::Internal::Simplify::ExprInfo::intersect().

◆ operator==()

bool Halide::Internal::ConstantInterval::operator== ( const ConstantInterval & other) const

Equivalent to same_as.

Exists so that the autoscheduler can compare two map<string, Interval> for equality in order to cache computations.

◆ operator+=() [1/2]

void Halide::Internal::ConstantInterval::operator+= ( const ConstantInterval & other)

In-place versions of the arithmetic operators below.

◆ operator+=() [2/2]

void Halide::Internal::ConstantInterval::operator+= ( int64_t )

◆ operator-=() [1/2]

void Halide::Internal::ConstantInterval::operator-= ( const ConstantInterval & other)

◆ operator-=() [2/2]

void Halide::Internal::ConstantInterval::operator-= ( int64_t )

◆ operator*=() [1/2]

void Halide::Internal::ConstantInterval::operator*= ( const ConstantInterval & other)

◆ operator*=() [2/2]

void Halide::Internal::ConstantInterval::operator*= ( int64_t )

◆ operator/=() [1/2]

void Halide::Internal::ConstantInterval::operator/= ( const ConstantInterval & other)

◆ operator/=() [2/2]

void Halide::Internal::ConstantInterval::operator/= ( int64_t )

◆ operator%=() [1/2]

void Halide::Internal::ConstantInterval::operator%= ( const ConstantInterval & other)

◆ operator%=() [2/2]

void Halide::Internal::ConstantInterval::operator%= ( int64_t )

◆ operator-()

ConstantInterval Halide::Internal::ConstantInterval::operator- ( ) const

Negate an interval.

◆ cast_to()

void Halide::Internal::ConstantInterval::cast_to ( const Type & t)

Track what happens if a constant integer interval is forced to fit into a concrete integer type.

Referenced by Halide::Internal::Simplify::ExprInfo::cast_to().

◆ bounds_of_type()

static ConstantInterval Halide::Internal::ConstantInterval::bounds_of_type ( Type )
static

Get constant integer bounds on a type.

Member Data Documentation

◆ min

int64_t Halide::Internal::ConstantInterval::min = 0

The lower and upper bound of the interval.

They are included in the interval.

Definition at line 21 of file ConstantInterval.h.

Referenced by Halide::Internal::Simplify::ExprInfo::trim_bounds_using_alignment().

◆ max

int64_t Halide::Internal::ConstantInterval::max = 0

◆ min_defined

bool Halide::Internal::ConstantInterval::min_defined = false

◆ max_defined

bool Halide::Internal::ConstantInterval::max_defined = false

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