205 const T *
as()
const {
207 return (
const T *)
ptr;
301#ifdef HALIDE_CPP_COMPILER_HAS_FLOAT16
#define HALIDE_ALWAYS_INLINE
Support classes for reference-counting via intrusive shared pointers.
A base class for passes over the IR which modify it (e.g.
A base class for algorithms that need to recursively walk over the IR.
A class representing a reference count to be used with IntrusivePtr.
constexpr IRNodeType StrongestExprNodeType
ForType
An enum describing a type of loop traversal.
RefCount & ref_count< IRNode >(const IRNode *t) noexcept
bool is_gpu(ForType for_type)
Returns true if for_type is GPUBlock, GPUThread, or GPULane.
bool is_unordered_parallel(ForType for_type)
Check if for_type executes for loop iterations in parallel and unordered.
bool is_parallel(ForType for_type)
Returns true if for_type executes for loop iterations in parallel.
void destroy< IRNode >(const IRNode *t)
IRNodeType
All our IR node types get unique IDs for the purposes of RTTI.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Type BFloat(int bits, int lanes=1)
Construct a floating-point type in the bfloat format.
Type UInt(int bits, int lanes=1)
Constructing an unsigned integer type.
Type Float(int bits, int lanes=1)
Construct a floating-point type.
@ Internal
Not visible externally, similar to 'static' linkage in C.
Type Int(int bits, int lanes=1)
Constructing a signed integer type.
Internal::ConstantInterval cast(Type t, const Internal::ConstantInterval &a)
Cast operators for ConstantIntervals.
std::vector< Range > Region
A multi-dimensional box.
MemoryType
An enum describing different address spaces to be used with Func::store_in.
@ Auto
Let Halide select a storage type automatically.
@ Register
Register memory.
@ VTCM
Vector Tightly Coupled Memory.
@ AMXTile
AMX Tile register for X86.
@ LockedCache
Allocate Locked Cache Memory to act as local memory.
@ Heap
Heap/global memory.
@ GPUTexture
Allocation is stored in GPU texture memory and accessed through hardware sampler.
@ GPUShared
Allocation is stored in GPU shared memory.
unsigned __INT64_TYPE__ uint64_t
signed __INT64_TYPE__ int64_t
signed __INT32_TYPE__ int32_t
unsigned __INT8_TYPE__ uint8_t
unsigned __INT16_TYPE__ uint16_t
unsigned __INT32_TYPE__ uint32_t
signed __INT16_TYPE__ int16_t
signed __INT8_TYPE__ int8_t
This lets you use an Expr as a key in a map of the form map<Expr, Foo, ExprCompare>
bool operator()(const Expr &a, const Expr &b) const
A fragment of Halide syntax.
HALIDE_ALWAYS_INLINE Expr()=default
Make an undefined expression.
Expr(const std::string &s)
Make an expression representing a const string (i.e.
HALIDE_ALWAYS_INLINE Type type() const
Get the type of this expression node.
HALIDE_ALWAYS_INLINE const Internal::BaseExprNode * get() const
Override get() to return a BaseExprNode * instead of an IRNode *.
Expr(int8_t x)
Make an expression representing numeric constants of various types.
HALIDE_ALWAYS_INLINE Expr(const Internal::BaseExprNode *n)
Make an expression from a concrete expression node pointer (e.g.
The sum of two expressions.
Allocate a scratch area called with the given name, type, and size.
Logical and - are both expressions true.
If the 'condition' is false, then evaluate and return the message, which should be a call to an error...
Lock all the Store nodes in the body statement.
A base class for expression nodes.
virtual Expr mutate_expr(IRMutator *v) const =0
BaseExprNode(IRNodeType t)
IR nodes are split into expressions and statements.
BaseStmtNode(IRNodeType t)
virtual Stmt mutate_stmt(IRMutator *v) const =0
A sequence of statements to be executed in-order.
A vector with 'lanes' elements, in which every element is 'value'.
The actual IR nodes begin here.
The ratio of two expressions.
Is the first expression equal to the second.
Evaluate and discard an expression, presumably because it has some side-effect.
We use the "curiously recurring template pattern" to avoid duplicated code in the IR Nodes.
~ExprNode() override=default
Expr mutate_expr(IRMutator *v) const override
void accept(IRVisitor *v) const override
We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept ...
Floating point constants.
static const IRNodeType _node_type
static const FloatImm * make(Type t, double value)
A pair of statements executed concurrently.
Free the resources associated with the given buffer.
Is the first expression greater than or equal to the second.
Is the first expression greater than the second.
Represents a location where storage will be hoisted to for a Func / Realize node with a given name.
IR nodes are passed around opaque handles to them.
void accept(IRVisitor *v) const
Dispatch to the correct visitor method for this node.
HALIDE_ALWAYS_INLINE IRHandle()=default
const T * as() const
Downcast this ir node to its actual type (e.g.
IRNodeType node_type() const
HALIDE_ALWAYS_INLINE IRHandle(const IRNode *p)
The abstract base classes for a node in the Halide IR.
virtual ~IRNode()=default
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 ...
IRNodeType node_type
Each IR node subclass has a unique identifier.
RefCount ref_count
These classes are all managed with intrusive reference counting, so we also track a reference count.
static const IRNodeType _node_type
static const IntImm * make(Type t, int64_t value)
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
Is the first expression less than or equal to the second.
Is the first expression less than the second.
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.
The greater of two values.
The lesser of two values.
The product of two expressions.
Is the first expression not equal to the second.
Logical not - true if the expression false.
Logical or - is at least one of the expression true.
Represent a multi-dimensional region of a Func or an ImageParam that needs to be prefetched.
This node is a helpful annotation to do with permissions.
This defines the value of a function at a multi-dimensional location.
A linear ramp vector node.
Allocate a multi-dimensional buffer of the given type and size.
Reinterpret value as another type, without affecting any of the bits (on little-endian systems).
Construct a new vector by taking elements from another sequence of vectors.
This lets you use a Stmt as a key in a map of the form map<Stmt, Foo, Stmt::Compare>
bool operator()(const Stmt &a, const Stmt &b) const
A reference-counted handle to a statement node.
Stmt(const BaseStmtNode *n)
HALIDE_ALWAYS_INLINE const BaseStmtNode * get() const
Override get() to return a BaseStmtNode * instead of an IRNode *.
void accept(IRVisitor *v) const override
We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept ...
Stmt mutate_stmt(IRMutator *v) const override
~StmtNode() override=default
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
static const StringImm * make(const std::string &val)
static const IRNodeType _node_type
The difference of two expressions.
Unsigned integer constants.
static const IRNodeType _node_type
static const UIntImm * make(Type t, uint64_t value)
Horizontally reduce a vector to a scalar or narrower vector using the given commutative and associati...
A single-dimensional span.
Range(const Expr &min_in, const Expr &extent_in)
Types in the halide type system.
Class that provides a type that implements half precision floating point (IEEE754 2008 binary16) in s...