205 const T *
as()
const {
207 return (
const T *)
ptr;
301#ifdef HALIDE_CPP_COMPILER_HAS_FLOAT16
302 explicit Expr(_Float16 x)
#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.
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.
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
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)
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.
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
static const StringImm * make(const std::string &val)
static const IRNodeType _node_type
Unsigned integer constants.
static const IRNodeType _node_type
static const UIntImm * make(Type t, uint64_t value)
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 using the bfloat16 format.
Class that provides a type that implements half precision floating point (IEEE754 2008 binary16) in s...