1#ifndef HALIDE_ASSOCIATIVITY_H
2#define HALIDE_ASSOCIATIVITY_H
76 return !(*
this == other);
82 std::vector<Replacement>
xs;
83 std::vector<Replacement>
ys;
112 const std::string &f, std::vector<Expr> args, std::vector<Expr> exprs);
Tables listing associative operators and their identities.
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
bool equal(const RDom &bounds0, const RDom &bounds1)
Return true if bounds0 and bounds1 represent the same bounds.
void associativity_test()
AssociativeOp prove_associativity(const std::string &f, std::vector< Expr > args, std::vector< Expr > exprs)
Given an update definition of a Func 'f', determine its equivalent associative binary/unary operator ...
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A fragment of Halide syntax.
std::string var
Variable name that is used to replace the expr in 'op'.
bool operator!=(const Replacement &other) const
bool operator==(const Replacement &other) const
Replacement(const std::string &var, Expr expr)
Represent the equivalent associative op of an update definition.
std::vector< Replacement > ys
std::vector< Replacement > xs
AssociativeOp(size_t size)
AssociativePattern pattern
List of pairs of binary associative op and its identity.
AssociativeOp(const AssociativePattern &p, const std::vector< Replacement > &xs, const std::vector< Replacement > &ys, bool is_associative)
Represent an associative op with its identity.
bool is_commutative
Indicate if the associative op is also commutative.