Loading...
Searching...
No Matches
IRVisitor.h
Go to the documentation of this file.
#ifndef HALIDE_IR_VISITOR_H
#define HALIDE_IR_VISITOR_H
#include <set>
#include "IR.h"
/** \file
* Defines the base class for things that recursively walk over the IR
*/
namespace Halide {
namespace Internal {
/** A base class for algorithms that need to recursively walk over the
* IR. The default implementations just recursively walk over the
* children. Override the ones you care about.
*/
class IRVisitor {
public:
IRVisitor() = default;
virtual ~IRVisitor() = default;
protected:
// ExprNode<> and StmtNode<> are allowed to call visit (to implement accept())
template<typename T>
friend struct ExprNode;
template<typename T>
friend struct StmtNode;
virtual void visit(const IntImm *);
virtual void visit(const UIntImm *);
virtual void visit(const FloatImm *);
virtual void visit(const StringImm *);
virtual void visit(const Cast *);
virtual void visit(const Reinterpret *);
virtual void visit(const Variable *);
virtual void visit(const Add *);
virtual void visit(const Sub *);
virtual void visit(const Mul *);
virtual void visit(const Div *);
virtual void visit(const Mod *);
virtual void visit(const Min *);
virtual void visit(const Max *);
virtual void visit(const EQ *);
virtual void visit(const NE *);
virtual void visit(const LT *);
virtual void visit(const LE *);
virtual void visit(const GT *);
virtual void visit(const GE *);
virtual void visit(const And *);
virtual void visit(const Or *);
virtual void visit(const Not *);
virtual void visit(const Select *);
virtual void visit(const Load *);
virtual void visit(const Ramp *);
virtual void visit(const Broadcast *);
virtual void visit(const Call *);
virtual void visit(const Let *);
virtual void visit(const LetStmt *);
virtual void visit(const AssertStmt *);
virtual void visit(const ProducerConsumer *);
virtual void visit(const For *);
virtual void visit(const Store *);
virtual void visit(const Provide *);
virtual void visit(const Allocate *);
virtual void visit(const Free *);
virtual void visit(const Realize *);
virtual void visit(const Block *);
virtual void visit(const IfThenElse *);
virtual void visit(const Evaluate *);
virtual void visit(const Shuffle *);
virtual void visit(const VectorReduce *);
virtual void visit(const Prefetch *);
virtual void visit(const Fork *);
virtual void visit(const Acquire *);
virtual void visit(const Atomic *);
virtual void visit(const HoistedStorage *);
};
/** A base class for algorithms that walk recursively over the IR
* without visiting the same node twice. This is for passes that are
* capable of interpreting the IR as a DAG instead of a tree. */
class IRGraphVisitor : public IRVisitor {
protected:
/** By default these methods add the node to the visited set, and
* return whether or not it was already there. If it wasn't there,
* it delegates to the appropriate visit method. You can override
* them if you like. */
// @{
virtual void include(const Expr &);
virtual void include(const Stmt &);
// @}
private:
/** The nodes visited so far. Only includes nodes with a ref count greater
* than one, because we know that nodes with a ref count of 1 will only be
* visited once if their parents are only visited once. */
std::set<const IRNode *> visited;
protected:
/** These methods should call 'include' on the children to only
* visit them if they haven't been visited already. */
// @{
void visit(const IntImm *) override;
void visit(const UIntImm *) override;
void visit(const FloatImm *) override;
void visit(const StringImm *) override;
void visit(const Cast *) override;
void visit(const Reinterpret *) override;
void visit(const Variable *) override;
void visit(const Add *) override;
void visit(const Sub *) override;
void visit(const Mul *) override;
void visit(const Div *) override;
void visit(const Mod *) override;
void visit(const Min *) override;
void visit(const Max *) override;
void visit(const EQ *) override;
void visit(const NE *) override;
void visit(const LT *) override;
void visit(const LE *) override;
void visit(const GT *) override;
void visit(const GE *) override;
void visit(const And *) override;
void visit(const Or *) override;
void visit(const Not *) override;
void visit(const Select *) override;
void visit(const Load *) override;
void visit(const Ramp *) override;
void visit(const Broadcast *) override;
void visit(const Call *) override;
void visit(const Let *) override;
void visit(const LetStmt *) override;
void visit(const AssertStmt *) override;
void visit(const ProducerConsumer *) override;
void visit(const For *) override;
void visit(const Store *) override;
void visit(const Provide *) override;
void visit(const Allocate *) override;
void visit(const Free *) override;
void visit(const Realize *) override;
void visit(const Block *) override;
void visit(const IfThenElse *) override;
void visit(const Evaluate *) override;
void visit(const Shuffle *) override;
void visit(const VectorReduce *) override;
void visit(const Prefetch *) override;
void visit(const Acquire *) override;
void visit(const Fork *) override;
void visit(const Atomic *) override;
void visit(const HoistedStorage *) override;
// @}
};
/** A visitor/mutator capable of passing arbitrary arguments to the
* visit methods using CRTP and returning any types from them. All
* Expr visitors must have the same signature, and all Stmt visitors
* must have the same signature. Does not have default implementations
* of the visit methods. */
template<typename T, typename ExprRet, typename StmtRet>
class VariadicVisitor {
private:
template<typename... Args>
ExprRet dispatch_expr(const BaseExprNode *node, Args &&...args) {
if (node == nullptr) {
return ExprRet{};
}
switch (node->node_type) {
case IRNodeType::IntImm:
return ((T *)this)->visit((const IntImm *)node, std::forward<Args>(args)...);
case IRNodeType::UIntImm:
return ((T *)this)->visit((const UIntImm *)node, std::forward<Args>(args)...);
case IRNodeType::FloatImm:
return ((T *)this)->visit((const FloatImm *)node, std::forward<Args>(args)...);
case IRNodeType::StringImm:
return ((T *)this)->visit((const StringImm *)node, std::forward<Args>(args)...);
case IRNodeType::Broadcast:
return ((T *)this)->visit((const Broadcast *)node, std::forward<Args>(args)...);
case IRNodeType::Cast:
return ((T *)this)->visit((const Cast *)node, std::forward<Args>(args)...);
case IRNodeType::Reinterpret:
return ((T *)this)->visit((const Reinterpret *)node, std::forward<Args>(args)...);
case IRNodeType::Variable:
return ((T *)this)->visit((const Variable *)node, std::forward<Args>(args)...);
case IRNodeType::Add:
return ((T *)this)->visit((const Add *)node, std::forward<Args>(args)...);
case IRNodeType::Sub:
return ((T *)this)->visit((const Sub *)node, std::forward<Args>(args)...);
case IRNodeType::Mod:
return ((T *)this)->visit((const Mod *)node, std::forward<Args>(args)...);
case IRNodeType::Mul:
return ((T *)this)->visit((const Mul *)node, std::forward<Args>(args)...);
case IRNodeType::Div:
return ((T *)this)->visit((const Div *)node, std::forward<Args>(args)...);
case IRNodeType::Min:
return ((T *)this)->visit((const Min *)node, std::forward<Args>(args)...);
case IRNodeType::Max:
return ((T *)this)->visit((const Max *)node, std::forward<Args>(args)...);
case IRNodeType::EQ:
return ((T *)this)->visit((const EQ *)node, std::forward<Args>(args)...);
case IRNodeType::NE:
return ((T *)this)->visit((const NE *)node, std::forward<Args>(args)...);
case IRNodeType::LT:
return ((T *)this)->visit((const LT *)node, std::forward<Args>(args)...);
case IRNodeType::LE:
return ((T *)this)->visit((const LE *)node, std::forward<Args>(args)...);
case IRNodeType::GT:
return ((T *)this)->visit((const GT *)node, std::forward<Args>(args)...);
case IRNodeType::GE:
return ((T *)this)->visit((const GE *)node, std::forward<Args>(args)...);
case IRNodeType::And:
return ((T *)this)->visit((const And *)node, std::forward<Args>(args)...);
case IRNodeType::Or:
return ((T *)this)->visit((const Or *)node, std::forward<Args>(args)...);
case IRNodeType::Not:
return ((T *)this)->visit((const Not *)node, std::forward<Args>(args)...);
case IRNodeType::Select:
return ((T *)this)->visit((const Select *)node, std::forward<Args>(args)...);
case IRNodeType::Load:
return ((T *)this)->visit((const Load *)node, std::forward<Args>(args)...);
case IRNodeType::Ramp:
return ((T *)this)->visit((const Ramp *)node, std::forward<Args>(args)...);
case IRNodeType::Call:
return ((T *)this)->visit((const Call *)node, std::forward<Args>(args)...);
case IRNodeType::Let:
return ((T *)this)->visit((const Let *)node, std::forward<Args>(args)...);
case IRNodeType::Shuffle:
return ((T *)this)->visit((const Shuffle *)node, std::forward<Args>(args)...);
case IRNodeType::VectorReduce:
return ((T *)this)->visit((const VectorReduce *)node, std::forward<Args>(args)...);
// Explicitly list the Stmt types rather than using a
// default case so that when new IR nodes are added we
// don't miss them here.
case IRNodeType::LetStmt:
case IRNodeType::AssertStmt:
case IRNodeType::ProducerConsumer:
case IRNodeType::For:
case IRNodeType::Acquire:
case IRNodeType::Store:
case IRNodeType::Provide:
case IRNodeType::Allocate:
case IRNodeType::Free:
case IRNodeType::Realize:
case IRNodeType::Block:
case IRNodeType::Fork:
case IRNodeType::IfThenElse:
case IRNodeType::Evaluate:
case IRNodeType::Prefetch:
case IRNodeType::Atomic:
case IRNodeType::HoistedStorage:
internal_error << "Unreachable";
}
return ExprRet{};
}
template<typename... Args>
StmtRet dispatch_stmt(const BaseStmtNode *node, Args &&...args) {
if (node == nullptr) {
return StmtRet{};
}
switch (node->node_type) {
case IRNodeType::IntImm:
case IRNodeType::UIntImm:
case IRNodeType::FloatImm:
case IRNodeType::StringImm:
case IRNodeType::Broadcast:
case IRNodeType::Cast:
case IRNodeType::Reinterpret:
case IRNodeType::Variable:
case IRNodeType::Add:
case IRNodeType::Sub:
case IRNodeType::Mod:
case IRNodeType::Mul:
case IRNodeType::Div:
case IRNodeType::Min:
case IRNodeType::Max:
case IRNodeType::EQ:
case IRNodeType::NE:
case IRNodeType::LT:
case IRNodeType::LE:
case IRNodeType::GT:
case IRNodeType::GE:
case IRNodeType::And:
case IRNodeType::Or:
case IRNodeType::Not:
case IRNodeType::Select:
case IRNodeType::Load:
case IRNodeType::Ramp:
case IRNodeType::Call:
case IRNodeType::Let:
case IRNodeType::Shuffle:
case IRNodeType::VectorReduce:
internal_error << "Unreachable";
break;
case IRNodeType::LetStmt:
return ((T *)this)->visit((const LetStmt *)node, std::forward<Args>(args)...);
case IRNodeType::AssertStmt:
return ((T *)this)->visit((const AssertStmt *)node, std::forward<Args>(args)...);
case IRNodeType::ProducerConsumer:
return ((T *)this)->visit((const ProducerConsumer *)node, std::forward<Args>(args)...);
case IRNodeType::For:
return ((T *)this)->visit((const For *)node, std::forward<Args>(args)...);
case IRNodeType::Acquire:
return ((T *)this)->visit((const Acquire *)node, std::forward<Args>(args)...);
case IRNodeType::Store:
return ((T *)this)->visit((const Store *)node, std::forward<Args>(args)...);
case IRNodeType::Provide:
return ((T *)this)->visit((const Provide *)node, std::forward<Args>(args)...);
case IRNodeType::Allocate:
return ((T *)this)->visit((const Allocate *)node, std::forward<Args>(args)...);
case IRNodeType::Free:
return ((T *)this)->visit((const Free *)node, std::forward<Args>(args)...);
case IRNodeType::Realize:
return ((T *)this)->visit((const Realize *)node, std::forward<Args>(args)...);
case IRNodeType::Block:
return ((T *)this)->visit((const Block *)node, std::forward<Args>(args)...);
case IRNodeType::Fork:
return ((T *)this)->visit((const Fork *)node, std::forward<Args>(args)...);
case IRNodeType::IfThenElse:
return ((T *)this)->visit((const IfThenElse *)node, std::forward<Args>(args)...);
case IRNodeType::Evaluate:
return ((T *)this)->visit((const Evaluate *)node, std::forward<Args>(args)...);
case IRNodeType::Prefetch:
return ((T *)this)->visit((const Prefetch *)node, std::forward<Args>(args)...);
case IRNodeType::Atomic:
return ((T *)this)->visit((const Atomic *)node, std::forward<Args>(args)...);
case IRNodeType::HoistedStorage:
return ((T *)this)->visit((const HoistedStorage *)node, std::forward<Args>(args)...);
}
return StmtRet{};
}
public:
template<typename... Args>
HALIDE_ALWAYS_INLINE StmtRet dispatch(const Stmt &s, Args &&...args) {
return dispatch_stmt(s.get(), std::forward<Args>(args)...);
}
template<typename... Args>
HALIDE_ALWAYS_INLINE StmtRet dispatch(Stmt &&s, Args &&...args) {
return dispatch_stmt(s.get(), std::forward<Args>(args)...);
}
template<typename... Args>
HALIDE_ALWAYS_INLINE ExprRet dispatch(const Expr &e, Args &&...args) {
return dispatch_expr(e.get(), std::forward<Args>(args)...);
}
template<typename... Args>
HALIDE_ALWAYS_INLINE ExprRet dispatch(Expr &&e, Args &&...args) {
return dispatch_expr(e.get(), std::forward<Args>(args)...);
}
};
} // namespace Internal
} // namespace Halide
#endif
internal_error
#define internal_error
Definition Error.h:215
HALIDE_ALWAYS_INLINE
#define HALIDE_ALWAYS_INLINE
Definition HalideRuntime.h:49
IR.h
Subtypes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt).
Halide::Internal::IRGraphVisitor
A base class for algorithms that walk recursively over the IR without visiting the same node twice.
Definition IRVisitor.h:85
Halide::Internal::IRGraphVisitor::visit
void visit(const Div *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Shuffle *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const NE *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Block *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const EQ *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Let *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Provide *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const StringImm *) override
Halide::Internal::IRGraphVisitor::include
virtual void include(const Expr &)
By default these methods add the node to the visited set, and return whether or not it was already th...
Halide::Internal::IRGraphVisitor::visit
void visit(const For *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const HoistedStorage *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Ramp *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Or *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const UIntImm *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Mul *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const AssertStmt *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const GE *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Min *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Free *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Add *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Acquire *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Store *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Max *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const IntImm *) override
These methods should call 'include' on the children to only visit them if they haven't been visited a...
Halide::Internal::IRGraphVisitor::visit
void visit(const IfThenElse *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const LT *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const VectorReduce *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Atomic *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Sub *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Not *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Mod *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const ProducerConsumer *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const LetStmt *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const LE *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Allocate *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Load *) override
Halide::Internal::IRGraphVisitor::include
virtual void include(const Stmt &)
Halide::Internal::IRGraphVisitor::visit
void visit(const Realize *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Prefetch *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const FloatImm *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Fork *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Call *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Reinterpret *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const And *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Variable *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Evaluate *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Broadcast *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const GT *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Cast *) override
Halide::Internal::IRGraphVisitor::visit
void visit(const Select *) override
Halide::Internal::IRVisitor::visit
virtual void visit(const NE *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Mul *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Max *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Select *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Load *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Div *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Fork *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Sub *)
Halide::Internal::IRVisitor::visit
virtual void visit(const LE *)
Halide::Internal::IRVisitor::~IRVisitor
virtual ~IRVisitor()=default
Halide::Internal::IRVisitor::visit
virtual void visit(const ProducerConsumer *)
Halide::Internal::IRVisitor::visit
virtual void visit(const VectorReduce *)
Halide::Internal::IRVisitor::visit
virtual void visit(const GE *)
Halide::Internal::IRVisitor::visit
virtual void visit(const StringImm *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Allocate *)
Halide::Internal::IRVisitor::visit
virtual void visit(const IfThenElse *)
Halide::Internal::IRVisitor::StmtNode
friend struct StmtNode
Definition IRVisitor.h:30
Halide::Internal::IRVisitor::visit
virtual void visit(const For *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Prefetch *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Block *)
Halide::Internal::IRVisitor::visit
virtual void visit(const UIntImm *)
Halide::Internal::IRVisitor::visit
virtual void visit(const HoistedStorage *)
Halide::Internal::IRVisitor::visit
virtual void visit(const FloatImm *)
Halide::Internal::IRVisitor::visit
virtual void visit(const GT *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Mod *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Acquire *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Atomic *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Ramp *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Free *)
Halide::Internal::IRVisitor::visit
virtual void visit(const IntImm *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Or *)
Halide::Internal::IRVisitor::visit
virtual void visit(const EQ *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Broadcast *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Call *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Min *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Variable *)
Halide::Internal::IRVisitor::IRVisitor
IRVisitor()=default
Halide::Internal::IRVisitor::visit
virtual void visit(const Realize *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Add *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Shuffle *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Reinterpret *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Evaluate *)
Halide::Internal::IRVisitor::visit
virtual void visit(const AssertStmt *)
Halide::Internal::IRVisitor::visit
virtual void visit(const And *)
Halide::Internal::IRVisitor::visit
virtual void visit(const LetStmt *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Store *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Provide *)
Halide::Internal::IRVisitor::ExprNode
friend struct ExprNode
Definition IRVisitor.h:27
Halide::Internal::IRVisitor::visit
virtual void visit(const LT *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Cast *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Not *)
Halide::Internal::IRVisitor::visit
virtual void visit(const Let *)
Halide::Internal::VariadicVisitor
A visitor/mutator capable of passing arbitrary arguments to the visit methods using CRTP and returnin...
Definition IRVisitor.h:163
Halide::Internal::VariadicVisitor::dispatch
HALIDE_ALWAYS_INLINE StmtRet dispatch(const Stmt &s, Args &&...args)
Definition IRVisitor.h:337
Halide::Internal::VariadicVisitor::dispatch
HALIDE_ALWAYS_INLINE ExprRet dispatch(Expr &&e, Args &&...args)
Definition IRVisitor.h:352
Halide::Internal::VariadicVisitor::dispatch
HALIDE_ALWAYS_INLINE StmtRet dispatch(Stmt &&s, Args &&...args)
Definition IRVisitor.h:342
Halide::Internal::VariadicVisitor::dispatch
HALIDE_ALWAYS_INLINE ExprRet dispatch(const Expr &e, Args &&...args)
Definition IRVisitor.h:347
Halide::Internal
Definition AbstractGenerator.h:24
Halide::Internal::IRNodeType::VectorReduce
@ VectorReduce
Definition Expr.h:60
Halide::Internal::IRNodeType::UIntImm
@ UIntImm
Definition Expr.h:31
Halide::Internal::IRNodeType::Prefetch
@ Prefetch
Definition Expr.h:76
Halide::Internal::IRNodeType::Reinterpret
@ Reinterpret
Definition Expr.h:36
Halide::Internal::IRNodeType::ProducerConsumer
@ ProducerConsumer
Definition Expr.h:64
Halide::Internal::IRNodeType::EQ
@ EQ
Definition Expr.h:45
Halide::Internal::IRNodeType::Provide
@ Provide
Definition Expr.h:68
Halide::Internal::IRNodeType::Fork
@ Fork
Definition Expr.h:73
Halide::Internal::IRNodeType::For
@ For
Definition Expr.h:65
Halide::Internal::IRNodeType::Or
@ Or
Definition Expr.h:52
Halide::Internal::IRNodeType::FloatImm
@ FloatImm
Definition Expr.h:32
Halide::Internal::IRNodeType::Div
@ Div
Definition Expr.h:42
Halide::Internal::IRNodeType::Variable
@ Variable
Definition Expr.h:37
Halide::Internal::IRNodeType::Cast
@ Cast
Definition Expr.h:35
Halide::Internal::IRNodeType::Atomic
@ Atomic
Definition Expr.h:77
Halide::Internal::IRNodeType::AssertStmt
@ AssertStmt
Definition Expr.h:63
Halide::Internal::IRNodeType::Mul
@ Mul
Definition Expr.h:41
Halide::Internal::IRNodeType::Max
@ Max
Definition Expr.h:44
Halide::Internal::IRNodeType::StringImm
@ StringImm
Definition Expr.h:33
Halide::Internal::IRNodeType::Min
@ Min
Definition Expr.h:43
Halide::Internal::IRNodeType::Mod
@ Mod
Definition Expr.h:40
Halide::Internal::IRNodeType::Acquire
@ Acquire
Definition Expr.h:66
Halide::Internal::IRNodeType::Ramp
@ Ramp
Definition Expr.h:56
Halide::Internal::IRNodeType::LetStmt
@ LetStmt
Definition Expr.h:62
Halide::Internal::IRNodeType::Not
@ Not
Definition Expr.h:53
Halide::Internal::IRNodeType::IfThenElse
@ IfThenElse
Definition Expr.h:74
Halide::Internal::IRNodeType::Evaluate
@ Evaluate
Definition Expr.h:75
Halide::Internal::IRNodeType::Free
@ Free
Definition Expr.h:70
Halide::Internal::IRNodeType::HoistedStorage
@ HoistedStorage
Definition Expr.h:78
Halide::Internal::IRNodeType::Broadcast
@ Broadcast
Definition Expr.h:34
Halide::Internal::IRNodeType::And
@ And
Definition Expr.h:51
Halide::Internal::IRNodeType::Call
@ Call
Definition Expr.h:57
Halide::Internal::IRNodeType::LT
@ LT
Definition Expr.h:47
Halide::Internal::IRNodeType::Allocate
@ Allocate
Definition Expr.h:69
Halide::Internal::IRNodeType::Let
@ Let
Definition Expr.h:58
Halide::Internal::IRNodeType::Realize
@ Realize
Definition Expr.h:71
Halide::Internal::IRNodeType::GT
@ GT
Definition Expr.h:49
Halide::Internal::IRNodeType::LE
@ LE
Definition Expr.h:48
Halide::Internal::IRNodeType::IntImm
@ IntImm
Definition Expr.h:30
Halide::Internal::IRNodeType::NE
@ NE
Definition Expr.h:46
Halide::Internal::IRNodeType::Select
@ Select
Definition Expr.h:54
Halide::Internal::IRNodeType::Block
@ Block
Definition Expr.h:72
Halide::Internal::IRNodeType::Sub
@ Sub
Definition Expr.h:39
Halide::Internal::IRNodeType::Shuffle
@ Shuffle
Definition Expr.h:59
Halide::Internal::IRNodeType::Add
@ Add
Definition Expr.h:38
Halide::Internal::IRNodeType::Load
@ Load
Definition Expr.h:55
Halide::Internal::IRNodeType::GE
@ GE
Definition Expr.h:50
Halide::Internal::IRNodeType::Store
@ Store
Definition Expr.h:67
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::Expr
A fragment of Halide syntax.
Definition Expr.h:258
Halide::Expr::get
HALIDE_ALWAYS_INLINE const Internal::BaseExprNode * get() const
Override get() to return a BaseExprNode * instead of an IRNode *.
Definition Expr.h:321
Halide::Internal::Acquire
Definition IR.h:872
Halide::Internal::Add
The sum of two expressions.
Definition IR.h:56
Halide::Internal::Allocate
Allocate a scratch area called with the given name, type, and size.
Definition IR.h:371
Halide::Internal::And
Logical and - are both expressions true.
Definition IR.h:175
Halide::Internal::AssertStmt
If the 'condition' is false, then evaluate and return the message, which should be a call to an error...
Definition IR.h:294
Halide::Internal::Atomic
Lock all the Store nodes in the body statement.
Definition IR.h:994
Halide::Internal::BaseExprNode
A base class for expression nodes.
Definition Expr.h:143
Halide::Internal::BaseStmtNode
IR nodes are split into expressions and statements.
Definition Expr.h:134
Halide::Internal::Block
A sequence of statements to be executed in-order.
Definition IR.h:442
Halide::Internal::Broadcast
A vector with 'lanes' elements, in which every element is 'value'.
Definition IR.h:259
Halide::Internal::Call
A function call.
Definition IR.h:490
Halide::Internal::Cast
The actual IR nodes begin here.
Definition IR.h:30
Halide::Internal::Div
The ratio of two expressions.
Definition IR.h:83
Halide::Internal::EQ
Is the first expression equal to the second.
Definition IR.h:121
Halide::Internal::Evaluate
Evaluate and discard an expression, presumably because it has some side-effect.
Definition IR.h:476
Halide::Internal::FloatImm
Floating point constants.
Definition Expr.h:236
Halide::Internal::For
A for loop.
Definition IR.h:848
Halide::Internal::Fork
A pair of statements executed concurrently.
Definition IR.h:457
Halide::Internal::Free
Free the resources associated with the given buffer.
Definition IR.h:413
Halide::Internal::GE
Is the first expression greater than or equal to the second.
Definition IR.h:166
Halide::Internal::GT
Is the first expression greater than the second.
Definition IR.h:157
Halide::Internal::HoistedStorage
Represents a location where storage will be hoisted to for a Func / Realize node with a given name.
Definition IR.h:978
Halide::Internal::IRNode::node_type
IRNodeType node_type
Each IR node subclass has a unique identifier.
Definition Expr.h:113
Halide::Internal::IfThenElse
An if-then-else block.
Definition IR.h:466
Halide::Internal::IntImm
Integer constants.
Definition Expr.h:218
Halide::Internal::LE
Is the first expression less than or equal to the second.
Definition IR.h:148
Halide::Internal::LT
Is the first expression less than the second.
Definition IR.h:139
Halide::Internal::Let
A let expression, like you might find in a functional language.
Definition IR.h:271
Halide::Internal::LetStmt
The statement form of a let node.
Definition IR.h:282
Halide::Internal::Load
Load a value from a named symbol if predicate is true.
Definition IR.h:217
Halide::Internal::Max
The greater of two values.
Definition IR.h:112
Halide::Internal::Min
The lesser of two values.
Definition IR.h:103
Halide::Internal::Mod
The remainder of a / b.
Definition IR.h:94
Halide::Internal::Mul
The product of two expressions.
Definition IR.h:74
Halide::Internal::NE
Is the first expression not equal to the second.
Definition IR.h:130
Halide::Internal::Not
Logical not - true if the expression false.
Definition IR.h:193
Halide::Internal::Or
Logical or - is at least one of the expression true.
Definition IR.h:184
Halide::Internal::Prefetch
Represent a multi-dimensional region of a Func or an ImageParam that needs to be prefetched.
Definition IR.h:956
Halide::Internal::ProducerConsumer
This node is a helpful annotation to do with permissions.
Definition IR.h:315
Halide::Internal::Provide
This defines the value of a function at a multi-dimensional location.
Definition IR.h:354
Halide::Internal::Ramp
A linear ramp vector node.
Definition IR.h:247
Halide::Internal::Realize
Allocate a multi-dimensional buffer of the given type and size.
Definition IR.h:427
Halide::Internal::Reinterpret
Reinterpret value as another type, without affecting any of the bits (on little-endian systems).
Definition IR.h:47
Halide::Internal::Select
A ternary operator.
Definition IR.h:204
Halide::Internal::Shuffle
Construct a new vector by taking elements from another sequence of vectors.
Definition IR.h:884
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition Expr.h:427
Halide::Internal::Stmt::get
HALIDE_ALWAYS_INLINE const BaseStmtNode * get() const
Override get() to return a BaseStmtNode * instead of an IRNode *.
Definition Expr.h:435
Halide::Internal::Store
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
Definition IR.h:333
Halide::Internal::StringImm
String constants.
Definition Expr.h:245
Halide::Internal::Sub
The difference of two expressions.
Definition IR.h:65
Halide::Internal::UIntImm
Unsigned integer constants.
Definition Expr.h:227
Halide::Internal::Variable
A named variable.
Definition IR.h:801
Halide::Internal::VectorReduce
Horizontally reduce a vector to a scalar or narrower vector using the given commutative and associati...
Definition IR.h:1012