Skip to main content

ClikaRT::spec::SymInt

class

Header: ClikaRT/compute/symbolic.h

A tensor dimension: a concrete size, or a symbolic value with inclusive [lower, upper] bounds. Compose with + - * (bounds propagate) and floor_div; compare with eq/ne/lt/le/gt/geSymBool.

Static member functions

unknown()

static SymInt unknown(
    std::int64_t lower = 0,
    std::int64_t upper = kUnbounded,
    std::string_view label = ""
)

A fresh symbolic dimension bounded by [lower, upper] (a data-dependent extent). label is a debug tag. upper == kUnbounded ⇒ no upper bound.

Declared in ClikaRT/compute/symbolic.h, line 82

Member functions

SymInt(int64_t)

SymInt(std::int64_t concrete)

A concrete dimension value; implicit, so a plain integer composes directly.

Declared in ClikaRT/compute/symbolic.h, line 68

SymInt(SymInt)

SymInt(const SymInt& other)

Copy: an independent value (a symbolic node, when present, is not shared).

Declared in ClikaRT/compute/symbolic.h, line 70

SymInt(SymInt)

SymInt(SymInt&& other) noexcept

Move: takes over the symbolic node; other reverts to a concrete default.

Declared in ClikaRT/compute/symbolic.h, line 72

operator=(SymInt)

SymInt& operator=(const SymInt& other)

Copy-assign; same value semantics as the copy ctor.

Declared in ClikaRT/compute/symbolic.h, line 74

operator=(SymInt)

SymInt& operator=(SymInt&& other) noexcept

Move-assign; same transfer as the move ctor.

Declared in ClikaRT/compute/symbolic.h, line 76

~SymInt()

~SymInt()

Releases the symbolic node, if any.

Declared in ClikaRT/compute/symbolic.h, line 78

operator+()

SymInt operator+(const SymInt& other) const

Symbolic-aware a + b; the [lower, upper] bounds propagate.

Declared in ClikaRT/compute/symbolic.h, line 86

operator-()

SymInt operator-(const SymInt& other) const

Symbolic-aware a - b; bounds propagate.

Declared in ClikaRT/compute/symbolic.h, line 88

operator*()

SymInt operator*(const SymInt& other) const

Symbolic-aware a * b; bounds propagate.

Declared in ClikaRT/compute/symbolic.h, line 90

floor_div()

SymInt floor_div(const SymInt& other) const

Floor division. A divide-by-zero (or an unsupported symbolic form) raises ClikaRT::Error.

Declared in ClikaRT/compute/symbolic.h, line 94

eq()

SymBool eq(const SymInt& other) const

Declared in ClikaRT/compute/symbolic.h, line 96

ne()

SymBool ne(const SymInt& other) const

Inequality → SymBool (concrete when both sides are).

Declared in ClikaRT/compute/symbolic.h, line 98

lt()

SymBool lt(const SymInt& other) const

Strict less-than → SymBool (concrete when both sides are).

Declared in ClikaRT/compute/symbolic.h, line 100

le()

SymBool le(const SymInt& other) const

Less-or-equal → SymBool (concrete when both sides are).

Declared in ClikaRT/compute/symbolic.h, line 102

gt()

SymBool gt(const SymInt& other) const

Strict greater-than → SymBool (concrete when both sides are).

Declared in ClikaRT/compute/symbolic.h, line 104

ge()

SymBool ge(const SymInt& other) const

Greater-or-equal → SymBool (concrete when both sides are).

Declared in ClikaRT/compute/symbolic.h, line 106

is_concrete()

bool is_concrete() const noexcept

True when this holds a plain int64 (no symbolic node).

Declared in ClikaRT/compute/symbolic.h, line 109

concrete_value()

std::optional<std::int64_t> concrete_value() const

The size iff is_concrete(), else nullopt.

Declared in ClikaRT/compute/symbolic.h, line 111

lower_bound()

std::int64_t lower_bound() const

Inclusive bounds; for a concrete value both equal it.

Declared in ClikaRT/compute/symbolic.h, line 113

upper_bound()

std::int64_t upper_bound() const

Inclusive upper bound; kUnbounded when none was declared.

Declared in ClikaRT/compute/symbolic.h, line 115

Static data members

kUnbounded

static std::int64_t kUnbounded = INT64_MAX

No upper bound (an unbounded symbol). It is declarable, but a dimension that reaches a real allocation needs a finite upper bound; eager allocation refuses an unbounded dim.

Declared in ClikaRT/compute/symbolic.h, line 65