docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::symbolic::maps Namespace Reference

Classes

struct  DependenceDeltas
 Represents the set of dependence distance vectors between two access patterns. More...

Functions

bool is_monotonic (const Expression expr, const Symbol sym, const Assumptions &assums)
 Checks if an expression is monotonic with respect to a symbol.
bool intersects (const MultiExpression &expr1, const MultiExpression &expr2, const Symbol indvar, const Assumptions &assums1, const Assumptions &assums2)
 Checks if the integer domain of two maps intersect.
DependenceDeltas dependence_deltas (const MultiExpression &expr1, const MultiExpression &expr2, const Symbol indvar, const Assumptions &assums1, const Assumptions &assums2)
 Computes the dependence distance delta set between two access patterns.
DependenceDeltas dependence_deltas (const MultiExpression &expr1, const MultiExpression &expr2, const Symbol indvar, sdfg::symbolic::AssumptionsBounds &bounds1, sdfg::symbolic::AssumptionsBounds &bounds2)
 Same as dependence_deltas, but reuses caller-supplied AssumptionsBounds.

Function Documentation

◆ dependence_deltas() [1/2]

DependenceDeltas sdfg::symbolic::maps::dependence_deltas ( const MultiExpression & expr1,
const MultiExpression & expr2,
const Symbol indvar,
const Assumptions & assums1,
const Assumptions & assums2 )

Computes the dependence distance delta set between two access patterns.

Returns a DependenceDeltas struct containing the full ISL delta set representing all possible iteration-distance vectors between aliasing pairs of the two expressions. The dimensions correspond to all non-constant symbols (induction variables).

If the accesses are provably disjoint (via monotonicity or ISL analysis), returns an empty delta set.

◆ dependence_deltas() [2/2]

DependenceDeltas sdfg::symbolic::maps::dependence_deltas ( const MultiExpression & expr1,
const MultiExpression & expr2,
const Symbol indvar,
sdfg::symbolic::AssumptionsBounds & bounds1,
sdfg::symbolic::AssumptionsBounds & bounds2 )

Same as dependence_deltas, but reuses caller-supplied AssumptionsBounds.

◆ intersects()

bool sdfg::symbolic::maps::intersects ( const MultiExpression & expr1,
const MultiExpression & expr2,
const Symbol indvar,
const Assumptions & assums1,
const Assumptions & assums2 )

Checks if the integer domain of two maps intersect.

Parameters
expr1First multi-dimensional expression (e.g., memory access pattern)
expr2Second multi-dimensional expression
indvarThe induction variable that evolves
assums1Assumptions for the first expression including evolution maps
assums2Assumptions for the second expression including evolution maps
Returns
true if the integer domains of expr1 and expr2 can overlap
// Check if A[i] and A[j+5] intersect when both evolve 0 to 10
auto i = symbolic::symbol("i");
auto j = symbolic::symbol("j");
MultiExpression expr1 = {i};
Assumptions assums1, assums2;
assums1[i].add_lower_bound(symbolic::zero());
assums1[i].add_upper_bound(symbolic::integer(10));
assums2[j].add_lower_bound(symbolic::zero());
assums2[j].add_upper_bound(symbolic::integer(10));
bool overlap = intersects(expr1, expr2, i, assums1, assums2); // true (e.g., i=7, j=2)
Expression add(const Expression lhs, const Expression rhs)
Addition of two expressions.
Integer integer(int64_t value)
Creates an integer constant.
Integer zero()
Creates the integer constant 0.
Symbol symbol(const std::string &name)
Creates a symbolic variable with the given name.
std::vector< Expression > MultiExpression
Vector of symbolic expressions for multi-dimensional operations.
Definition symbolic.h:89
bool intersects(const MultiExpression &expr1, const MultiExpression &expr2, const Symbol indvar, const Assumptions &assums1, const Assumptions &assums2)
Checks if the integer domain of two maps intersect.

◆ is_monotonic()

bool sdfg::symbolic::maps::is_monotonic ( const Expression expr,
const Symbol sym,
const Assumptions & assums )

Checks if an expression is monotonic with respect to a symbol.

Parameters
exprThe expression to check
symThe symbol to check monotonicity with respect to
assumsAssumptions about symbols including the evolution map
Returns
true if expr is monotonic (always increasing or always decreasing) as sym evolves

An expression is monotonic if it consistently increases as the symbol evolves.