Submodules module[source]

Group a sequence of :class:`ir.Eq`s into one or more :class:`Cluster`s.[source]

Attempt grouping :class:`PartialCluster`s together to create bigger :class:`PartialCluster`s (i.e., containing more expressions).


This function relies on advanced data dependency analysis tools based upon classic Lamport theory. module

class, ispace, dspace, atomics=None, guards=None)[source]


A Cluster is an immutable PartialCluster.


Build a new cluster with expressions exprs having same iteration space and atomics as self.


Concatenate the expressions in other to those in self. self and other must have same ispace. Duplicate expressions are dropped. The DataSpace is updated accordingly.


Bases: list

An iterable of :class:`PartialCluster`s.


Return the cumulative DataSpace of this ClusterGroup.


Return the arithmetic data type of this ClusterGroup. If at least one Cluster is performing floating point arithmetic, then any Cluster performing integer arithmetic is ignored. If two Clusters are performing floating point calculations with different precision, return the data type with highest precision.


Return a new ClusterGroup in which all of self’s PartialClusters have been turned into actual Clusters.


Return the metadata carried by this ClusterGroup, a 2-tuple consisting of data type and data space.


Return a new ClusterGroup in which all of self’s Clusters have been promoted to PartialClusters. Any metadata attached to self is lost. module

class, **kwargs)[source]

Bases: collections.OrderedDict

A FlowGraph represents an ordered sequence of operations. Operations, of type Node, are the nodes of the graph. An edge from n0 to n1 indicates that n1 reads from n0. For example, the sequence:

temp0 = a*b
temp1 = temp0*c
temp2 = temp0*d
temp3 = temp1 + temp2

is represented by the following FlowGraph:

temp0 ---> temp1
  |          |
  |          |
  v          v
temp2 ---> temp3

The input and output edges of a node n are encoded in n.reads and n.readby, respectively.

Operations may involve scalars and indexed objects (arrays). The indices of the indexed objects represent either “space” or “time” dimensions.

extract(key, readby=False)[source]

Return the list of nodes appearing in key.reads, in program order (ie, based on the order in which the nodes appear in self). If readby is True, then return instead the list of nodes appearing key.readby, in program order.

Given the following sequence of operations:

t1 = ...
t0 = ...
u[i, j] = ... v ...
u[3, j] = ...
v = t0 + t1 + u[z, k]
t2 = ...

Assuming key == v and readby is False (as by default), return the following list of Node objects:

[t1, t0, u[i, j], u[3, j]]

If readby is True, return:

[v, t2]

Return True if key is used as array index in an expression of the FlowGraph, False otherwise.


Return all occurrences of the tensors in self keyed by function.


Check if expr is time invariant. expr may be an expression e explicitly tracked by the FlowGraph or even a generic subexpression of e. If no expr is provided, then time invariance of the entire FlowGraph is assessed.

trace(key, readby=False, strict=False)[source]

Return the sequence of operations required to compute the node key. If readby = True, then return the sequence of operations that will depend on key, instead. With strict = True, drop key from the result.


Return all symbols appearing in self for which a node is not available.

Module contents