Loading...
Searching...
No Matches
Expr.h
Go to the documentation of this file.
#ifndef HALIDE_EXPR_H
#define HALIDE_EXPR_H
/** \file
* Base classes for Halide expressions (\ref Halide::Expr) and statements (\ref Halide::Internal::Stmt)
*/
#include <string>
#include <vector>
#include "IntrusivePtr.h"
#include "Type.h"
namespace Halide {
struct bfloat16_t;
struct float16_t;
namespace Internal {
class IRMutator;
class IRVisitor;
/** All our IR node types get unique IDs for the purposes of RTTI */
enum class IRNodeType {
// Exprs, in order of strength. Code in IRMatch.h and the
// simplifier relies on this order for canonicalization of
// expressions, so you may need to update those modules if you
// change this list.
IntImm,
UIntImm,
FloatImm,
StringImm,
Broadcast,
Cast,
Reinterpret,
Variable,
Add,
Sub,
Mod,
Mul,
Div,
Min,
Max,
EQ,
NE,
LT,
LE,
GT,
GE,
And,
Or,
Not,
Select,
Load,
Ramp,
Call,
Let,
Shuffle,
VectorReduce,
// Stmts
LetStmt,
AssertStmt,
ProducerConsumer,
For,
Acquire,
Store,
Provide,
Allocate,
Free,
Realize,
Block,
Fork,
IfThenElse,
Evaluate,
Prefetch,
Atomic,
HoistedStorage
};
constexpr IRNodeType StrongestExprNodeType = IRNodeType::VectorReduce;
/** The abstract base classes for a node in the Halide IR. */
struct IRNode {
/** We use the visitor pattern to traverse IR nodes throughout the
* compiler, so we have a virtual accept method which accepts
* visitors.
*/
virtual void accept(IRVisitor *v) const = 0;
IRNode(IRNodeType t)
: node_type(t) {
}
virtual ~IRNode() = default;
/** These classes are all managed with intrusive reference
* counting, so we also track a reference count. It's mutable
* so that we can do reference counting even through const
* references to IR nodes.
*/
mutable RefCount ref_count;
/** Each IR node subclass has a unique identifier. We can compare
* these values to do runtime type identification. We don't
* compile with rtti because that injects run-time type
* identification stuff everywhere (and often breaks when linking
* external libraries compiled without it), and we only want it
* for IR nodes. One might want to put this value in the vtable,
* but that adds another level of indirection, and for Exprs we
* have 32 free bits in between the ref count and the Type
* anyway, so this doesn't increase the memory footprint of an IR node.
*/
IRNodeType node_type;
};
template<>
inline RefCount &ref_count<IRNode>(const IRNode *t) noexcept {
return t->ref_count;
}
template<>
inline void destroy<IRNode>(const IRNode *t) {
delete t;
}
/** IR nodes are split into expressions and statements. These are
similar to expressions and statements in C - expressions
represent some value and have some type (e.g. x + 3), and
statements are side-effecting pieces of code that do not
represent a value (e.g. assert(x > 3)) */
/** A base class for statement nodes. They have no properties or
methods beyond base IR nodes for now. */
struct BaseStmtNode : public IRNode {
BaseStmtNode(IRNodeType t)
: IRNode(t) {
}
virtual Stmt mutate_stmt(IRMutator *v) const = 0;
};
/** A base class for expression nodes. They all contain their types
* (e.g. Int(32), Float(32)) */
struct BaseExprNode : public IRNode {
BaseExprNode(IRNodeType t)
: IRNode(t) {
}
virtual Expr mutate_expr(IRMutator *v) const = 0;
Type type;
};
/** We use the "curiously recurring template pattern" to avoid
duplicated code in the IR Nodes. These classes live between the
abstract base classes and the actual IR Nodes in the
inheritance hierarchy. It provides an implementation of the
accept function necessary for the visitor pattern to work, and
a concrete instantiation of a unique IRNodeType per class. */
template<typename T>
struct ExprNode : public BaseExprNode {
void accept(IRVisitor *v) const override;
Expr mutate_expr(IRMutator *v) const override;
ExprNode()
: BaseExprNode(T::_node_type) {
}
~ExprNode() override = default;
};
template<typename T>
struct StmtNode : public BaseStmtNode {
void accept(IRVisitor *v) const override;
Stmt mutate_stmt(IRMutator *v) const override;
StmtNode()
: BaseStmtNode(T::_node_type) {
}
~StmtNode() override = default;
};
/** IR nodes are passed around opaque handles to them. This is a
base class for those handles. It manages the reference count,
and dispatches visitors. */
struct IRHandle : public IntrusivePtr<const IRNode> {
HALIDE_ALWAYS_INLINE
IRHandle() = default;
HALIDE_ALWAYS_INLINE
IRHandle(const IRNode *p)
: IntrusivePtr<const IRNode>(p) {
}
/** Dispatch to the correct visitor method for this node. E.g. if
* this node is actually an Add node, then this will call
* IRVisitor::visit(const Add *) */
void accept(IRVisitor *v) const {
ptr->accept(v);
}
/** Downcast this ir node to its actual type (e.g. Add, or
* Select). This returns nullptr if the node is not of the requested
* type. Example usage:
*
* if (const Add *add = node->as<Add>()) {
* // This is an add node
* }
*/
template<typename T>
const T *as() const {
if (ptr && ptr->node_type == T::_node_type) {
return (const T *)ptr;
}
return nullptr;
}
IRNodeType node_type() const {
return ptr->node_type;
}
};
/** Integer constants */
struct IntImm : public ExprNode<IntImm> {
int64_t value;
static const IntImm *make(Type t, int64_t value);
static const IRNodeType _node_type = IRNodeType::IntImm;
};
/** Unsigned integer constants */
struct UIntImm : public ExprNode<UIntImm> {
uint64_t value;
static const UIntImm *make(Type t, uint64_t value);
static const IRNodeType _node_type = IRNodeType::UIntImm;
};
/** Floating point constants */
struct FloatImm : public ExprNode<FloatImm> {
double value;
static const FloatImm *make(Type t, double value);
static const IRNodeType _node_type = IRNodeType::FloatImm;
};
/** String constants */
struct StringImm : public ExprNode<StringImm> {
std::string value;
static const StringImm *make(const std::string &val);
static const IRNodeType _node_type = IRNodeType::StringImm;
};
} // namespace Internal
/** A fragment of Halide syntax. It's implemented as reference-counted
* handle to a concrete expression node, but it's immutable, so you
* can treat it as a value type. */
struct Expr : public Internal::IRHandle {
/** Make an undefined expression */
HALIDE_ALWAYS_INLINE
Expr() = default;
/** Make an expression from a concrete expression node pointer (e.g. Add) */
HALIDE_ALWAYS_INLINE
Expr(const Internal::BaseExprNode *n)
: IRHandle(n) {
}
/** Make an expression representing numeric constants of various types. */
// @{
explicit Expr(int8_t x)
: IRHandle(Internal::IntImm::make(Int(8), x)) {
}
explicit Expr(int16_t x)
: IRHandle(Internal::IntImm::make(Int(16), x)) {
}
Expr(int32_t x)
: IRHandle(Internal::IntImm::make(Int(32), x)) {
}
explicit Expr(int64_t x)
: IRHandle(Internal::IntImm::make(Int(64), x)) {
}
explicit Expr(uint8_t x)
: IRHandle(Internal::UIntImm::make(UInt(8), x)) {
}
explicit Expr(uint16_t x)
: IRHandle(Internal::UIntImm::make(UInt(16), x)) {
}
explicit Expr(uint32_t x)
: IRHandle(Internal::UIntImm::make(UInt(32), x)) {
}
explicit Expr(uint64_t x)
: IRHandle(Internal::UIntImm::make(UInt(64), x)) {
}
Expr(float16_t x)
: IRHandle(Internal::FloatImm::make(Float(16), (double)x)) {
}
Expr(bfloat16_t x)
: IRHandle(Internal::FloatImm::make(BFloat(16), (double)x)) {
}
#ifdef HALIDE_CPP_COMPILER_HAS_FLOAT16
explicit Expr(_Float16 x)
: IRHandle(Internal::FloatImm::make(Float(16), (double)x)) {
}
#endif
Expr(float x)
: IRHandle(Internal::FloatImm::make(Float(32), x)) {
}
explicit Expr(double x)
: IRHandle(Internal::FloatImm::make(Float(64), x)) {
}
// @}
/** Make an expression representing a const string (i.e. a StringImm) */
Expr(const std::string &s)
: IRHandle(Internal::StringImm::make(s)) {
}
/** Override get() to return a BaseExprNode * instead of an IRNode * */
HALIDE_ALWAYS_INLINE
const Internal::BaseExprNode *get() const {
return (const Internal::BaseExprNode *)ptr;
}
/** Get the type of this expression node */
HALIDE_ALWAYS_INLINE
Type type() const {
return get()->type;
}
};
/** This lets you use an Expr as a key in a map of the form
* map<Expr, Foo, ExprCompare> */
struct ExprCompare {
bool operator()(const Expr &a, const Expr &b) const {
return a.get() < b.get();
}
};
/** A single-dimensional span. Includes all numbers between min and
* (min + extent - 1). */
struct Range {
Expr min, extent;
Range() = default;
Range(const Expr &min_in, const Expr &extent_in);
};
/** A multi-dimensional box. The outer product of the elements */
typedef std::vector<Range> Region;
/** An enum describing different address spaces to be used with Func::store_in. */
enum class MemoryType {
/** Let Halide select a storage type automatically */
Auto,
/** Heap/global memory. Allocated using halide_malloc, or
* halide_device_malloc */
Heap,
/** Stack memory. Allocated using alloca. Requires a constant
* size. Corresponds to per-thread local memory on the GPU. If all
* accesses are at constant coordinates, may be promoted into the
* register file at the discretion of the register allocator. */
Stack,
/** Register memory. The allocation should be promoted into the
* register file. All stores must be at constant coordinates. May
* be spilled to the stack at the discretion of the register
* allocator. */
Register,
/** Allocation is stored in GPU shared memory. Also known as
* "local" in OpenCL, and "threadgroup" in metal. Can be shared
* across GPU threads within the same block. */
GPUShared,
/** Allocation is stored in GPU texture memory and accessed through
* hardware sampler */
GPUTexture,
/** Allocate Locked Cache Memory to act as local memory */
LockedCache,
/** Vector Tightly Coupled Memory. HVX (Hexagon) local memory available on
* v65+. This memory has higher performance and lower power. Ideal for
* intermediate buffers. Necessary for vgather-vscatter instructions
* on Hexagon */
VTCM,
/** AMX Tile register for X86. Any data that would be used in an AMX matrix
* multiplication must first be loaded into an AMX tile register. */
AMXTile,
};
namespace Internal {
/** An enum describing a type of loop traversal. Used in schedules,
* and in the For loop IR node. Serial is a conventional ordered for
* loop. Iterations occur in increasing order, and each iteration must
* appear to have finished before the next begins. Parallel, GPUBlock,
* and GPUThread are parallel and unordered: iterations may occur in
* any order, and multiple iterations may occur
* simultaneously. Vectorized and GPULane are parallel and
* synchronous: they act as if all iterations occur at the same time
* in lockstep. */
enum class ForType {
Serial,
Parallel,
Vectorized,
Unrolled,
Extern,
GPUBlock,
GPUThread,
GPULane,
};
/** Check if for_type executes for loop iterations in parallel and unordered. */
bool is_unordered_parallel(ForType for_type);
/** Returns true if for_type executes for loop iterations in parallel. */
bool is_parallel(ForType for_type);
/** Returns true if for_type is GPUBlock, GPUThread, or GPULane. */
bool is_gpu(ForType for_type);
/** A reference-counted handle to a statement node. */
struct Stmt : public IRHandle {
Stmt() = default;
Stmt(const BaseStmtNode *n)
: IRHandle(n) {
}
/** Override get() to return a BaseStmtNode * instead of an IRNode * */
HALIDE_ALWAYS_INLINE
const BaseStmtNode *get() const {
return (const Internal::BaseStmtNode *)ptr;
}
/** This lets you use a Stmt as a key in a map of the form
* map<Stmt, Foo, Stmt::Compare> */
struct Compare {
bool operator()(const Stmt &a, const Stmt &b) const {
return a.ptr < b.ptr;
}
};
};
} // namespace Internal
} // namespace Halide
#endif
HALIDE_ALWAYS_INLINE
#define HALIDE_ALWAYS_INLINE
Definition HalideRuntime.h:49
IntrusivePtr.h
Support classes for reference-counting via intrusive shared pointers.
Type.h
Defines halide types.
Halide::Internal::IRMutator
A base class for passes over the IR which modify it (e.g.
Definition IRMutator.h:26
Halide::Internal::IRVisitor
A base class for algorithms that need to recursively walk over the IR.
Definition IRVisitor.h:19
Halide::Internal::RefCount
A class representing a reference count to be used with IntrusivePtr.
Definition IntrusivePtr.h:19
Halide::Internal
Definition AbstractGenerator.h:24
Halide::Internal::StrongestExprNodeType
constexpr IRNodeType StrongestExprNodeType
Definition Expr.h:81
Halide::Internal::ForType
ForType
An enum describing a type of loop traversal.
Definition Expr.h:406
Halide::Internal::ForType::Vectorized
@ Vectorized
Definition Expr.h:409
Halide::Internal::ForType::GPUThread
@ GPUThread
Definition Expr.h:413
Halide::Internal::ForType::Extern
@ Extern
Definition Expr.h:411
Halide::Internal::ForType::Serial
@ Serial
Definition Expr.h:407
Halide::Internal::ForType::Parallel
@ Parallel
Definition Expr.h:408
Halide::Internal::ForType::GPUBlock
@ GPUBlock
Definition Expr.h:412
Halide::Internal::ForType::GPULane
@ GPULane
Definition Expr.h:414
Halide::Internal::ForType::Unrolled
@ Unrolled
Definition Expr.h:410
Halide::Internal::ref_count< IRNode >
RefCount & ref_count< IRNode >(const IRNode *t) noexcept
Definition Expr.h:117
Halide::Internal::is_gpu
bool is_gpu(ForType for_type)
Returns true if for_type is GPUBlock, GPUThread, or GPULane.
Halide::Internal::is_unordered_parallel
bool is_unordered_parallel(ForType for_type)
Check if for_type executes for loop iterations in parallel and unordered.
Halide::Internal::is_parallel
bool is_parallel(ForType for_type)
Returns true if for_type executes for loop iterations in parallel.
Halide::Internal::destroy< IRNode >
void destroy< IRNode >(const IRNode *t)
Definition Expr.h:122
Halide::Internal::IRNodeType
IRNodeType
All our IR node types get unique IDs for the purposes of RTTI.
Definition Expr.h:25
Halide::Internal::IRNodeType::VectorReduce
@ VectorReduce
Definition Expr.h:60
Halide::Internal::IRNodeType::UIntImm
@ UIntImm
Definition Expr.h:31
Halide::Internal::IRNodeType::FloatImm
@ FloatImm
Definition Expr.h:32
Halide::Internal::IRNodeType::StringImm
@ StringImm
Definition Expr.h:33
Halide::Internal::IRNodeType::IntImm
@ IntImm
Definition Expr.h:30
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::BFloat
Type BFloat(int bits, int lanes=1)
Construct a floating-point type in the bfloat format.
Definition Type.h:556
Halide::UInt
Type UInt(int bits, int lanes=1)
Constructing an unsigned integer type.
Definition Type.h:546
Halide::Float
Type Float(int bits, int lanes=1)
Construct a floating-point type.
Definition Type.h:551
Halide::Int
Type Int(int bits, int lanes=1)
Constructing a signed integer type.
Definition Type.h:541
Halide::Region
std::vector< Range > Region
A multi-dimensional box.
Definition Expr.h:350
Halide::MemoryType
MemoryType
An enum describing different address spaces to be used with Func::store_in.
Definition Expr.h:353
Halide::MemoryType::Auto
@ Auto
Let Halide select a storage type automatically.
Definition Expr.h:355
Halide::MemoryType::Register
@ Register
Register memory.
Definition Expr.h:371
Halide::MemoryType::Stack
@ Stack
Stack memory.
Definition Expr.h:365
Halide::MemoryType::VTCM
@ VTCM
Vector Tightly Coupled Memory.
Definition Expr.h:388
Halide::MemoryType::AMXTile
@ AMXTile
AMX Tile register for X86.
Definition Expr.h:392
Halide::MemoryType::LockedCache
@ LockedCache
Allocate Locked Cache Memory to act as local memory.
Definition Expr.h:383
Halide::MemoryType::Heap
@ Heap
Heap/global memory.
Definition Expr.h:359
Halide::MemoryType::GPUTexture
@ GPUTexture
Allocation is stored in GPU texture memory and accessed through hardware sampler.
Definition Expr.h:380
Halide::MemoryType::GPUShared
@ GPUShared
Allocation is stored in GPU shared memory.
Definition Expr.h:376
uint64_t
unsigned __INT64_TYPE__ uint64_t
Definition runtime_internal.h:23
int64_t
signed __INT64_TYPE__ int64_t
Definition runtime_internal.h:22
int32_t
signed __INT32_TYPE__ int32_t
Definition runtime_internal.h:24
uint8_t
unsigned __INT8_TYPE__ uint8_t
Definition runtime_internal.h:29
uint16_t
unsigned __INT16_TYPE__ uint16_t
Definition runtime_internal.h:27
uint32_t
unsigned __INT32_TYPE__ uint32_t
Definition runtime_internal.h:25
int16_t
signed __INT16_TYPE__ int16_t
Definition runtime_internal.h:26
int8_t
signed __INT8_TYPE__ int8_t
Definition runtime_internal.h:28
Halide::ExprCompare
This lets you use an Expr as a key in a map of the form map<Expr, Foo, ExprCompare>.
Definition Expr.h:334
Halide::ExprCompare::operator()
bool operator()(const Expr &a, const Expr &b) const
Definition Expr.h:335
Halide::Expr
A fragment of Halide syntax.
Definition Expr.h:258
Halide::Expr::Expr
Expr(float x)
Definition Expr.h:306
Halide::Expr::Expr
HALIDE_ALWAYS_INLINE Expr()=default
Make an undefined expression.
Halide::Expr::Expr
Expr(int32_t x)
Definition Expr.h:277
Halide::Expr::Expr
Expr(bfloat16_t x)
Definition Expr.h:298
Halide::Expr::Expr
Expr(uint32_t x)
Definition Expr.h:289
Halide::Expr::Expr
Expr(const std::string &s)
Make an expression representing a const string (i.e.
Definition Expr.h:315
Halide::Expr::type
HALIDE_ALWAYS_INLINE Type type() const
Get the type of this expression node.
Definition Expr.h:327
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::Expr::Expr
Expr(int64_t x)
Definition Expr.h:280
Halide::Expr::Expr
Expr(int16_t x)
Definition Expr.h:274
Halide::Expr::Expr
Expr(uint64_t x)
Definition Expr.h:292
Halide::Expr::Expr
Expr(uint16_t x)
Definition Expr.h:286
Halide::Expr::Expr
Expr(double x)
Definition Expr.h:309
Halide::Expr::Expr
Expr(int8_t x)
Make an expression representing numeric constants of various types.
Definition Expr.h:271
Halide::Expr::Expr
HALIDE_ALWAYS_INLINE Expr(const Internal::BaseExprNode *n)
Make an expression from a concrete expression node pointer (e.g.
Definition Expr.h:265
Halide::Expr::Expr
Expr(uint8_t x)
Definition Expr.h:283
Halide::Expr::Expr
Expr(float16_t x)
Definition Expr.h:295
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::BaseExprNode::type
Type type
Definition Expr.h:148
Halide::Internal::BaseExprNode::mutate_expr
virtual Expr mutate_expr(IRMutator *v) const =0
Halide::Internal::BaseExprNode::BaseExprNode
BaseExprNode(IRNodeType t)
Definition Expr.h:144
Halide::Internal::BaseStmtNode
IR nodes are split into expressions and statements.
Definition Expr.h:134
Halide::Internal::BaseStmtNode::BaseStmtNode
BaseStmtNode(IRNodeType t)
Definition Expr.h:135
Halide::Internal::BaseStmtNode::mutate_stmt
virtual Stmt mutate_stmt(IRMutator *v) const =0
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::ExprNode::~ExprNode
~ExprNode() override=default
Halide::Internal::ExprNode::ExprNode
ExprNode()
Definition Expr.h:161
Halide::Internal::ExprNode::mutate_expr
Expr mutate_expr(IRMutator *v) const override
Halide::Internal::ExprNode::accept
void accept(IRVisitor *v) const override
We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept ...
Halide::Internal::FloatImm
Floating point constants.
Definition Expr.h:236
Halide::Internal::FloatImm::_node_type
static const IRNodeType _node_type
Definition Expr.h:241
Halide::Internal::FloatImm::value
double value
Definition Expr.h:237
Halide::Internal::FloatImm::make
static const FloatImm * make(Type t, double value)
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::IRHandle
IR nodes are passed around opaque handles to them.
Definition Expr.h:180
Halide::Internal::IRHandle::accept
void accept(IRVisitor *v) const
Dispatch to the correct visitor method for this node.
Definition Expr.h:192
Halide::Internal::IRHandle::IRHandle
HALIDE_ALWAYS_INLINE IRHandle()=default
Halide::Internal::IRHandle::as
const T * as() const
Downcast this ir node to its actual type (e.g.
Definition Expr.h:205
Halide::Internal::IRHandle::node_type
IRNodeType node_type() const
Definition Expr.h:212
Halide::Internal::IRHandle::IRHandle
HALIDE_ALWAYS_INLINE IRHandle(const IRNode *p)
Definition Expr.h:185
Halide::Internal::IRNode
The abstract base classes for a node in the Halide IR.
Definition Expr.h:84
Halide::Internal::IRNode::~IRNode
virtual ~IRNode()=default
Halide::Internal::IRNode::accept
virtual void accept(IRVisitor *v) const =0
We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept ...
Halide::Internal::IRNode::node_type
IRNodeType node_type
Each IR node subclass has a unique identifier.
Definition Expr.h:113
Halide::Internal::IRNode::ref_count
RefCount ref_count
These classes are all managed with intrusive reference counting, so we also track a reference count.
Definition Expr.h:101
Halide::Internal::IRNode::IRNode
IRNode(IRNodeType t)
Definition Expr.h:91
Halide::Internal::IfThenElse
An if-then-else block.
Definition IR.h:466
Halide::Internal::IntImm
Integer constants.
Definition Expr.h:218
Halide::Internal::IntImm::_node_type
static const IRNodeType _node_type
Definition Expr.h:223
Halide::Internal::IntImm::make
static const IntImm * make(Type t, int64_t value)
Halide::Internal::IntImm::value
int64_t value
Definition Expr.h:219
Halide::Internal::IntrusivePtr< const IRNode >::IntrusivePtr
HALIDE_ALWAYS_INLINE IntrusivePtr()=default
Halide::Internal::IntrusivePtr< const IRNode >::ptr
const IRNode * ptr
Definition IntrusivePtr.h:94
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::Compare
This lets you use a Stmt as a key in a map of the form map<Stmt, Foo, Stmt::Compare>.
Definition Expr.h:441
Halide::Internal::Stmt::Compare::operator()
bool operator()(const Stmt &a, const Stmt &b) const
Definition Expr.h:442
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition Expr.h:427
Halide::Internal::Stmt::Stmt
Stmt(const BaseStmtNode *n)
Definition Expr.h:429
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::Stmt::Stmt
Stmt()=default
Halide::Internal::StmtNode::accept
void accept(IRVisitor *v) const override
We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept ...
Halide::Internal::StmtNode::mutate_stmt
Stmt mutate_stmt(IRMutator *v) const override
Halide::Internal::StmtNode::StmtNode
StmtNode()
Definition Expr.h:171
Halide::Internal::StmtNode::~StmtNode
~StmtNode() override=default
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::StringImm::value
std::string value
Definition Expr.h:246
Halide::Internal::StringImm::make
static const StringImm * make(const std::string &val)
Halide::Internal::StringImm::_node_type
static const IRNodeType _node_type
Definition Expr.h:250
Halide::Internal::Sub
The difference of two expressions.
Definition IR.h:65
Halide::Internal::UIntImm
Unsigned integer constants.
Definition Expr.h:227
Halide::Internal::UIntImm::_node_type
static const IRNodeType _node_type
Definition Expr.h:232
Halide::Internal::UIntImm::make
static const UIntImm * make(Type t, uint64_t value)
Halide::Internal::UIntImm::value
uint64_t value
Definition Expr.h:228
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
Halide::Range::Range
Range()=default
Halide::Range::min
Expr min
Definition Expr.h:343
Halide::Range::extent
Expr extent
Definition Expr.h:343
Halide::Range::Range
Range(const Expr &min_in, const Expr &extent_in)
Halide::Type
Types in the halide type system.
Definition Type.h:283
Halide::bfloat16_t
Class that provides a type that implements half precision floating point using the bfloat16 format.
Definition Float16.h:158
Halide::float16_t
Class that provides a type that implements half precision floating point (IEEE754 2008 binary16) in s...
Definition Float16.h:17