Halide 19.0.0
Halide compiler and libraries
|
Represent the equivalent associative op of an update definition. More...
#include <Associativity.h>
Classes | |
struct | Replacement |
Public Member Functions | |
AssociativeOp ()=default | |
AssociativeOp (size_t size) | |
AssociativeOp (const AssociativePattern &p, const std::vector< Replacement > &xs, const std::vector< Replacement > &ys, bool is_associative) | |
bool | associative () const |
bool | commutative () const |
size_t | size () const |
Public Attributes | |
AssociativePattern | pattern |
List of pairs of binary associative op and its identity. | |
std::vector< Replacement > | xs |
std::vector< Replacement > | ys |
bool | is_associative = false |
Represent the equivalent associative op of an update definition.
For example, the following associative Expr, min(f(x), g(r.x) + 2), where f(x) is the self-recurrence term, is represented as:
'pattern' contains the list of equivalent binary/unary operators (+ identities) for each Tuple element in the update definition. 'pattern' also contains a boolean that indicates if the op is also commutative. 'xs' and 'ys' contain the corresponding definition of each variable in the list of binary operators.
For unary operator, 'xs' is not set, i.e. it will be a pair of empty string and undefined Expr: {"", Expr()}. 'pattern' will only contain the 'y' term in this case. For example, min(g(r.x), 4), will be represented as:
Self-assignment, f(x) = f(x), will be represented as:
For both unary operator and self-assignment cases, the identity does not matter. It can be anything.
Definition at line 61 of file Associativity.h.
|
default |
|
inline |
Definition at line 87 of file Associativity.h.
|
inline |
Definition at line 90 of file Associativity.h.
|
inline |
Definition at line 95 of file Associativity.h.
References is_associative.
|
inline |
Definition at line 98 of file Associativity.h.
References Halide::Internal::AssociativePattern::is_commutative, and pattern.
|
inline |
Definition at line 101 of file Associativity.h.
References pattern, and Halide::Internal::AssociativePattern::size().
AssociativePattern Halide::Internal::AssociativeOp::pattern |
List of pairs of binary associative op and its identity.
Definition at line 81 of file Associativity.h.
Referenced by commutative(), and size().
std::vector<Replacement> Halide::Internal::AssociativeOp::xs |
Definition at line 82 of file Associativity.h.
std::vector<Replacement> Halide::Internal::AssociativeOp::ys |
Definition at line 83 of file Associativity.h.
bool Halide::Internal::AssociativeOp::is_associative = false |
Definition at line 84 of file Associativity.h.
Referenced by associative().