397 const std::vector<Expr> &
extents,
730 bool is_intrinsic(std::initializer_list<IntrinsicOp> intrinsics)
const {
748 if (c->is_intrinsic(i)) {
864 const std::vector<int> &
indices);
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines the Partition enum.
Routines for statically determining what expressions are divisible by.
Defines the internal representation of parameters to halide piplines.
Defines the PrefetchDirective struct.
Defines internal classes related to Reduction Domains.
const std::string & name() const
A reference-counted handle to Halide's internal representation of a function.
A reference-counted handle on a reduction domain, which is just a vector of ReductionVariable.
A reference-counted handle to a parameter to a halide pipeline.
const std::string & name() const
Get the name of this parameter.
Type type() const
Get the type of this parameter.
ForType
An enum describing a type of loop traversal.
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.
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,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
DeviceAPI
An enum describing a type of device API.
std::vector< Range > Region
A multi-dimensional box.
MemoryType
An enum describing different address spaces to be used with Func::store_in.
Partition
Different ways to handle loops with a potentially optimizable boundary conditions.
signed __INT32_TYPE__ int32_t
A fragment of Halide syntax.
HALIDE_ALWAYS_INLINE Type type() const
Get the type of this expression node.
static const IRNodeType _node_type
static Stmt make(Expr semaphore, Expr count, Stmt body)
The sum of two expressions.
static Expr make(Expr a, Expr b)
static const IRNodeType _node_type
Allocate a scratch area called with the given name, type, and size.
std::vector< Expr > extents
static int32_t constant_allocation_size(const std::vector< Expr > &extents, const std::string &name)
A routine to check if the extents are all constants, and if so verify the total size is less than 2^3...
static const IRNodeType _node_type
int32_t constant_allocation_size() const
std::string free_function
static Stmt make(const std::string &name, Type type, MemoryType memory_type, const std::vector< Expr > &extents, Expr condition, Stmt body, Expr new_expr=Expr(), const std::string &free_function=std::string(), int padding=0)
Logical and - are both expressions true.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
If the 'condition' is false, then evaluate and return the message, which should be a call to an error...
static const IRNodeType _node_type
static Stmt make(Expr condition, Expr message)
Lock all the Store nodes in the body statement.
static const IRNodeType _node_type
static Stmt make(const std::string &producer_name, const std::string &mutex_name, Stmt body)
std::string producer_name
A sequence of statements to be executed in-order.
static Stmt make(const std::vector< Stmt > &stmts)
Construct zero or more Blocks to invoke a list of statements in order.
static Stmt make(Stmt first, Stmt rest)
static const IRNodeType _node_type
A vector with 'lanes' elements, in which every element is 'value'.
static Expr make(Expr value, int lanes)
static const IRNodeType _node_type
static Expr make(Type type, const std::string &name, const std::vector< Expr > &args, CallType call_type, FunctionPtr func=FunctionPtr(), int value_index=0, Buffer<> image=Buffer<>(), Parameter param=Parameter())
static HALIDE_EXPORT ConstString buffer_get_max
static const Call * as_tag(const Expr &e)
static Expr make(const Function &func, const std::vector< Expr > &args, int idx=0)
Convenience constructor for calls to other halide functions.
static HALIDE_EXPORT ConstString buffer_get_host_dirty
static HALIDE_EXPORT ConstString buffer_set_bounds
static const Call * as_intrinsic(const Expr &e, std::initializer_list< IntrinsicOp > intrinsics)
Returns a pointer to a call node if the expression is a call to one of the requested intrinsics.
const char *const ConstString
@ call_cached_indirect_function
@ signed_integer_overflow
@ add_image_checks_marker
@ rounding_mul_shift_right
@ load_typed_struct_member
@ profiling_enable_instance_marker
@ target_natural_vector_size
@ size_of_halide_buffer_t
@ Extern
A call to an external C-ABI function, possibly with side-effects.
@ ExternCPlusPlus
A call to an external C-ABI function, possibly with side-effects.
@ Image
A load from an input image.
@ Halide
A call to a Func.
@ Intrinsic
A possibly-side-effecty compiler intrinsic, which has special handling during codegen.
@ PureExtern
A call to a guaranteed-side-effect-free external function.
@ PureIntrinsic
A side-effect-free version of the above.
static HALIDE_EXPORT ConstString buffer_get_min
bool is_intrinsic() const
static HALIDE_EXPORT ConstString buffer_get_device_interface
static HALIDE_EXPORT ConstString buffer_get_dimensions
static HALIDE_EXPORT ConstString buffer_get_device_dirty
static HALIDE_EXPORT ConstString buffer_crop
static HALIDE_EXPORT ConstString buffer_get_host
static Expr make(const Buffer<> &image, const std::vector< Expr > &args)
Convenience constructor for loads from concrete images.
static HALIDE_EXPORT ConstString buffer_get_device
static HALIDE_EXPORT ConstString buffer_init
bool is_pure() const
Check if a call node is pure within a pipeline, meaning that the same args always give the same resul...
static HALIDE_EXPORT ConstString buffer_get_stride
static HALIDE_EXPORT ConstString buffer_get_extent
bool is_intrinsic(std::initializer_list< IntrinsicOp > intrinsics) const
static const char * get_intrinsic_name(IntrinsicOp op)
bool is_intrinsic(IntrinsicOp op) const
static Expr make(const Parameter ¶m, const std::vector< Expr > &args)
Convenience constructor for loads from images parameters.
static const IRNodeType _node_type
static HALIDE_EXPORT ConstString trace
static HALIDE_EXPORT ConstString buffer_get_shape
static Expr make(Type type, IntrinsicOp op, const std::vector< Expr > &args, CallType call_type, FunctionPtr func=FunctionPtr(), int value_index=0, const Buffer<> &image=Buffer<>(), Parameter param=Parameter())
static HALIDE_EXPORT ConstString buffer_is_bounds_query
static HALIDE_EXPORT ConstString buffer_get_type
static HALIDE_EXPORT ConstString buffer_set_device_dirty
static HALIDE_EXPORT ConstString buffer_set_host_dirty
static HALIDE_EXPORT ConstString buffer_init_from_buffer
The actual IR nodes begin here.
static const IRNodeType _node_type
static Expr make(Type t, Expr v)
bool is_reinterpret() const
Check if the cast is equivalent to a reinterpret.
The ratio of two expressions.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
Is the first expression equal to the second.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
Evaluate and discard an expression, presumably because it has some side-effect.
static const IRNodeType _node_type
We use the "curiously recurring template pattern" to avoid duplicated code in the IR Nodes.
Partition partition_policy
bool is_unordered_parallel() const
static const IRNodeType _node_type
static Stmt make(const std::string &name, Expr min, Expr extent, ForType for_type, Partition partition_policy, DeviceAPI device_api, Stmt body)
A pair of statements executed concurrently.
static Stmt make(Stmt first, Stmt rest)
static const IRNodeType _node_type
Free the resources associated with the given buffer.
static const IRNodeType _node_type
static Stmt make(const std::string &name)
A possibly-weak pointer to a Halide function.
Is the first expression greater than or equal to the second.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
Is the first expression greater than the second.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
Represents a location where storage will be hoisted to for a Func / Realize node with a given name.
static Stmt make(const std::string &name, Stmt body)
static const IRNodeType _node_type
const T * as() const
Downcast this ir node to its actual type (e.g.
static const IRNodeType _node_type
static Stmt make(Expr condition, Stmt then_case, Stmt else_case=Stmt())
Is the first expression less than or equal to the second.
static Expr make(Expr a, Expr b)
static const IRNodeType _node_type
Is the first expression less than the second.
static Expr make(Expr a, Expr b)
static const IRNodeType _node_type
A let expression, like you might find in a functional language.
static Expr make(const std::string &name, Expr value, Expr body)
static const IRNodeType _node_type
The statement form of a let node.
static Stmt make(const std::string &name, Expr value, Stmt body)
static const IRNodeType _node_type
Load a value from a named symbol if predicate is true.
static Expr make(Type type, const std::string &name, Expr index, Buffer<> image, Parameter param, Expr predicate, ModulusRemainder alignment)
static const IRNodeType _node_type
ModulusRemainder alignment
The greater of two values.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
The lesser of two values.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
The result of modulus_remainder analysis.
The product of two expressions.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
Is the first expression not equal to the second.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
Logical not - true if the expression false.
static const IRNodeType _node_type
Logical or - is at least one of the expression true.
static Expr make(Expr a, Expr b)
static const IRNodeType _node_type
Represent a multi-dimensional region of a Func or an ImageParam that needs to be prefetched.
static Stmt make(const std::string &name, const std::vector< Type > &types, const Region &bounds, const PrefetchDirective &prefetch, Expr condition, Stmt body)
static const IRNodeType _node_type
PrefetchDirective prefetch
std::vector< Type > types
This node is a helpful annotation to do with permissions.
static const IRNodeType _node_type
static Stmt make_consume(const std::string &name, Stmt body)
static Stmt make_produce(const std::string &name, Stmt body)
static Stmt make(const std::string &name, bool is_producer, Stmt body)
This defines the value of a function at a multi-dimensional location.
static const IRNodeType _node_type
std::vector< Expr > values
static Stmt make(const std::string &name, const std::vector< Expr > &values, const std::vector< Expr > &args, const Expr &predicate)
A linear ramp vector node.
static const IRNodeType _node_type
static Expr make(Expr base, Expr stride, int lanes)
Allocate a multi-dimensional buffer of the given type and size.
static Stmt make(const std::string &name, const std::vector< Type > &types, MemoryType memory_type, const Region &bounds, Expr condition, Stmt body)
std::vector< Type > types
static const IRNodeType _node_type
Reinterpret value as another type, without affecting any of the bits (on little-endian systems).
static const IRNodeType _node_type
static Expr make(Type t, Expr v)
static Expr make(Expr condition, Expr true_value, Expr false_value)
static const IRNodeType _node_type
Construct a new vector by taking elements from another sequence of vectors.
static Expr make_slice(Expr vector, int begin, int stride, int size)
Convenience constructor for making a shuffle representing a contiguous subset of a vector.
bool is_interleave() const
Check if this shuffle is an interleaving of the vector arguments.
static Expr make_extract_element(Expr vector, int i)
Convenience constructor for making a shuffle representing extracting a single element.
bool is_extract_element() const
Check if this shuffle is extracting a scalar from the vector arguments.
bool is_broadcast() const
Check if this shuffle can be represented as a repeating pattern that repeats the same shuffle of the ...
static Expr make_concat(const std::vector< Expr > &vectors)
Convenience constructor for making a shuffle representing a concatenation of the vectors.
static Expr make(const std::vector< Expr > &vectors, const std::vector< int > &indices)
int broadcast_factor() const
static const IRNodeType _node_type
static Expr make_broadcast(Expr vector, int factor)
Convenience constructor for making a shuffle representing a broadcast of a vector.
std::vector< Expr > vectors
bool is_concat() const
Check if this shuffle is a concatenation of the vector arguments.
bool is_slice() const
Check if this shuffle is a contiguous strict subset of the vector arguments, and if so,...
std::vector< int > indices
Indices indicating which vector element to place into the result.
int slice_stride() const
Check if this shuffle is a contiguous strict subset of the vector arguments, and if so,...
static Expr make_interleave(const std::vector< Expr > &vectors)
Convenience constructor for making a shuffle representing an interleaving of vectors of the same leng...
int slice_begin() const
Check if this shuffle is a contiguous strict subset of the vector arguments, and if so,...
A reference-counted handle to a statement node.
Store a 'value' to the buffer called 'name' at a given 'index' if 'predicate' is true.
static const IRNodeType _node_type
ModulusRemainder alignment
static Stmt make(const std::string &name, Expr value, Expr index, Parameter param, Expr predicate, ModulusRemainder alignment)
The difference of two expressions.
static const IRNodeType _node_type
static Expr make(Expr a, Expr b)
static Expr make(Type type, const std::string &name, const Buffer<> &image)
static Expr make(Type type, const std::string &name, Parameter param)
static Expr make(Type type, const std::string &name, Buffer<> image, Parameter param, ReductionDomain reduction_domain)
Buffer image
References to properties of literal image parameters.
ReductionDomain reduction_domain
Reduction variables hang onto their domains.
static Expr make(Type type, const std::string &name)
Parameter param
References to scalar parameters, or to the dimensions of buffer parameters hang onto those expression...
static Expr make(Type type, const std::string &name, ReductionDomain reduction_domain)
static const IRNodeType _node_type
Horizontally reduce a vector to a scalar or narrower vector using the given commutative and associati...
static const IRNodeType _node_type
static Expr make(Operator op, Expr vec, int lanes)
Types in the halide type system.
HALIDE_ALWAYS_INLINE int bits() const
Return the bit size of a single element of this type.
HALIDE_ALWAYS_INLINE bool is_int_or_uint() const
Is this type an integer type of any sort?