1 #ifndef HALIDE_IR_PRINTER_H 2 #define HALIDE_IR_PRINTER_H 27 std::ostream &
operator<<(std::ostream &stream,
const Expr &);
31 std::ostream &
operator<<(std::ostream &stream,
const Type &);
35 std::ostream &
operator<<(std::ostream &stream,
const Module &);
50 std::ostream &
operator<<(std::ostream &stream,
const LoopLevel &);
54 std::ostream &
operator<<(std::ostream &stream,
const Target &);
58 struct AssociativePattern;
64 std::ostream &
operator<<(std::ostream &stream,
const AssociativePattern &);
68 std::ostream &
operator<<(std::ostream &stream,
const AssociativeOp &);
72 std::ostream &
operator<<(std::ostream &stream,
const Stmt &);
85 std::ostream &
operator<<(std::ostream &stream,
const LoweredFunc &);
94 std::ostream &
operator<<(std::ostream &out,
const Closure &c);
122 void print_list(
const std::vector<Expr> &exprs);
170 void visit(
const EQ *)
override;
171 void visit(
const NE *)
override;
172 void visit(
const LT *)
override;
173 void visit(
const LE *)
override;
174 void visit(
const GT *)
override;
175 void visit(
const GE *)
override;
177 void visit(
const Or *)
override;
Unsigned integer constants.
bool implicit_parens
Certain expressions do not need parens around them, e.g.
The actual IR nodes begin here.
A base class for algorithms that need to recursively walk over the IR.
A fragment of Halide syntax.
void print_no_parens(const Expr &)
Emit an expression on the output stream without enclosing parens.
Is the first expression greater than the second.
A reference-counted handle to a statement node.
Load a value from a named symbol if predicate is true.
The difference of two expressions.
A vector with 'lanes' elements, in which every element is 'value'.
Partition
Different ways to handle loops with a potentially optimizable boundary conditions.
Logical and - are both expressions true.
Defines Module, an IR container that fully describes a Halide program.
TailStrategy
Different ways to handle a tail case in a split when the factor does not provably divide the extent...
Logical not - true if the expression false.
Horizontally reduce a vector to a scalar or narrower vector using the given commutative and associati...
Is the first expression less than the second.
std::ostream & operator<<(std::ostream &stream, const Stmt &)
Emit a halide statement on an output stream (such as std::cout) in a human-readable form...
The product of two expressions.
Lock all the Store nodes in the body statement.
Floating point constants.
void print_lets(const Let *let)
A helper for printing a chain of lets with line breaks.
The sum of two expressions.
A linear ramp vector node.
Allocate a multi-dimensional buffer of the given type and size.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
An IRVisitor that emits IR to the given output stream in a human readable form.
DimType
Each Dim below has a dim_type, which tells you what transformations are legal on it.
void close()
Either emits ")" or "", depending on the value of implicit_parens.
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
void print(const Expr &)
emit an expression on the output stream
void print_list(const std::vector< Expr > &exprs)
emit a comma delimited list of exprs, without any leading or trailing punctuation.
Allocate a scratch area called with the given name, type, and size.
Is the first expression greater than or equal to the second.
int indent
The current indentation level, useful for pretty-printing statements.
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
void visit(const IntImm *) override
This defines the value of a function at a multi-dimensional location.
Represent a multi-dimensional region of a Func or an ImageParam that needs to be prefetched.
The ratio of two expressions.
IRPrinter(std::ostream &)
Construct an IRPrinter pointed at a given output stream (e.g.
void open()
Either emits "(" or "", depending on the value of implicit_parens.
Is the first expression less than or equal to the second.
Is the first expression not equal to the second.
If the 'condition' is false, then evaluate and return the message, which should be a call to an error...
LinkageType
Type of linkage a function in a lowered Halide module can have.
Not visible externally, similar to 'static' linkage in C.
Is the first expression equal to the second.
Represents a location where storage will be hoisted to for a Func / Realize node with a given name...
The greater of two values.
A pair of statements executed concurrently.
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR...
ForType
An enum describing a type of loop traversal.
A let expression, like you might find in a functional language.
Free the resources associated with the given buffer.
Indentation get_indent() const
NameMangling
An enum to specify calling convention for extern stages.
std::ostream & operator<<(std::ostream &stream, const Expr &)
Emit an expression on an output stream (such as std::cout) in human-readable form.
A sequence of statements to be executed in-order.
The lesser of two values.
Scope known_type
The symbols whose types can be inferred from values printed already.
Reinterpret value as another type, without affecting any of the bits (on little-endian systems)...
std::ostream & stream
The stream on which we're outputting.
The statement form of a let node.
DeviceAPI
An enum describing a type of device API.
Logical or - is at least one of the expression true.
This node is a helpful annotation to do with permissions.
Evaluate and discard an expression, presumably because it has some side-effect.
Defines the base class for things that recursively walk over the IR.
Construct a new vector by taking elements from another sequence of vectors.
MemoryType
An enum describing different address spaces to be used with Func::store_in.