1#ifndef HALIDE_CLOSURE_H
2#define HALIDE_CLOSURE_H
89 void include(
const Stmt &s,
const std::string &loop_variable =
"");
94 std::map<std::string, Type>
vars;
Subtypes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines the base class for things that recursively walk over the IR.
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR.
A helper class to manage closures.
Closure(Closure &&)=default
std::map< std::string, Type > vars
External variables referenced.
void found_buffer_ref(const std::string &name, Type type, bool read, bool written, const Halide::Buffer<> &image)
void visit(const LetStmt *op) override
Closure(const Closure &)=delete
Stmt unpack_from_struct(const Expr &, const Stmt &) const
Unpack a closure around a Stmt, putting all the names in scope.
std::map< std::string, Buffer > buffers
External allocations referenced.
void visit(const Let *op) override
void visit(const For *op) override
Closure & operator=(const Closure &)=delete
void visit(const Load *op) override
Expr pack_into_struct() const
Pack a closure into a struct.
void include(const Stmt &s, const std::string &loop_variable="")
Traverse a statement and find all references to external symbols.
void visit(const Store *op) override
void visit(const Atomic *op) override
void visit(const Allocate *op) override
void visit(const Variable *op) override
Closure & operator=(Closure &&)=default
A base class for algorithms that need to recursively walk over the IR.
virtual void visit(const IntImm *)
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
MemoryType
An enum describing different address spaces to be used with Func::store_in.
@ Auto
Let Halide select a storage type automatically.
unsigned __INT8_TYPE__ uint8_t
A fragment of Halide syntax.
Allocate a scratch area called with the given name, type, and size.
Lock all the Store nodes in the body statement.
Information about a buffer reference from a closure.
bool write
The buffer is written to.
size_t size
The size of the buffer if known, otherwise zero.
uint8_t dimensions
The dimensionality of the buffer.
bool read
The buffer is read from.
Type type
The type of the buffer referenced.
MemoryType memory_type
The buffer is a texture.
A let expression, like you might find in a functional language.
The statement form of a let node.
Load a value from a named symbol if predicate is true.
A reference-counted handle to a statement node.
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
Types in the halide type system.