Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Halide::Internal::Call Struct Reference

A function call. More...

`#include <IR.h>`

Inheritance diagram for Halide::Internal::Call:

## Public Types
enum | CallType { Image , Extern , ExternCPlusPlus , PureExtern , Halide , Intrinsic , PureIntrinsic }
enum | IntrinsicOp { abs , absd , add_image_checks_marker , alloca , bitwise_and , bitwise_not , bitwise_or , bitwise_xor , bool_to_mask , bundle , call_cached_indirect_function , cast_mask , concat_bits , count_leading_zeros , count_trailing_zeros , debug_to_file , declare_box_touched , div_round_to_zero , dynamic_shuffle , extract_bits , extract_mask_element , get_user_context , gpu_thread_barrier , halving_add , halving_sub , hvx_gather , hvx_scatter , hvx_scatter_acc , hvx_scatter_release , if_then_else , if_then_else_mask , image_load , image_store , lerp , likely , likely_if_innermost , load_typed_struct_member , make_struct , memoize_expr , mod_round_to_zero , mul_shift_right , mux , popcount , prefetch , profiling_enable_instance_marker , promise_clamped , random , register_destructor , require , require_mask , return_second , rewrite_buffer , round , rounding_halving_add , rounding_mul_shift_right , rounding_shift_left , rounding_shift_right , saturating_add , saturating_sub , saturating_cast , scatter_gather , select_mask , shift_left , shift_right , signed_integer_overflow , size_of_halide_buffer_t , skip_stages_marker , sliding_window_marker , sorted_avg , strict_add , strict_cast , strict_div , strict_eq , strict_le , strict_lt , strict_max , strict_min , strict_mul , strict_sub , stringify , target_arch_is , target_bits , target_has_feature , target_natural_vector_size , target_os_is , undef , unreachable , unsafe_promise_clamped , widen_right_add , widen_right_mul , widen_right_sub , widening_add , widening_mul , widening_shift_left , widening_shift_right , widening_sub , get_runtime_vscale , IntrinsicOpCount }
typedef const char *const | ConstString

## Public Member Functions
bool | is_pure () const
| Check if a call node is pure within a pipeline, meaning that the same args always give the same result, and the calls can be reordered, duplicated, unified, etc without changing the meaning of anything.
bool | is_intrinsic () const
bool | is_intrinsic (IntrinsicOp op) const
bool | is_intrinsic (std::initializer_list< IntrinsicOp > intrinsics) const
bool | is_tag () const
bool | is_extern () const
bool | is_strict_float_intrinsic () const
Public Member Functions inherited from Halide::Internal::ExprNode< Call >
void | accept (IRVisitor *v) const override
| We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept method which accepts visitors.
Expr | mutate_expr (IRMutator *v) const override
| ExprNode ()
| ~ExprNode () override=default
Public Member Functions inherited from Halide::Internal::BaseExprNode
| BaseExprNode (IRNodeType t)
Public Member Functions inherited from Halide::Internal::IRNode
| IRNode (IRNodeType t)
virtual | ~IRNode ()=default

## Static Public Member Functions
static const char * | get_intrinsic_name (IntrinsicOp op)
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 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 Expr | make (const Function &func, const std::vector< Expr > &args, int idx=0)
| Convenience constructor for calls to other halide functions.
static Expr | make (const Buffer<> &image, const std::vector< Expr > &args)
| Convenience constructor for loads from concrete images.
static Expr | make (const Parameter &param, const std::vector< Expr > &args)
| Convenience constructor for loads from images parameters.
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.
static const Call * | as_tag (const Expr &e)

## Public Attributes
std::string | name
std::vector< Expr > | args
CallType | call_type
FunctionPtr | func
int | value_index
Buffer | image
Parameter | param
Public Attributes inherited from Halide::Internal::BaseExprNode
Type | type
Public Attributes inherited from Halide::Internal::IRNode
RefCount | ref_count
| These classes are all managed with intrusive reference counting, so we also track a reference count.
IRNodeType | node_type
| Each IR node subclass has a unique identifier.

## Static Public Attributes
static HALIDE_EXPORT ConstString | buffer_get_dimensions
static HALIDE_EXPORT ConstString | buffer_get_min
static HALIDE_EXPORT ConstString | buffer_get_extent
static HALIDE_EXPORT ConstString | buffer_get_stride
static HALIDE_EXPORT ConstString | buffer_get_max
static HALIDE_EXPORT ConstString | buffer_get_host
static HALIDE_EXPORT ConstString | buffer_get_device
static HALIDE_EXPORT ConstString | buffer_get_device_interface
static HALIDE_EXPORT ConstString | buffer_get_shape
static HALIDE_EXPORT ConstString | buffer_get_host_dirty
static HALIDE_EXPORT ConstString | buffer_get_device_dirty
static HALIDE_EXPORT ConstString | buffer_get_type
static HALIDE_EXPORT ConstString | buffer_set_host_dirty
static HALIDE_EXPORT ConstString | buffer_set_device_dirty
static HALIDE_EXPORT ConstString | buffer_is_bounds_query
static HALIDE_EXPORT ConstString | buffer_init
static HALIDE_EXPORT ConstString | buffer_init_from_buffer
static HALIDE_EXPORT ConstString | buffer_crop
static HALIDE_EXPORT ConstString | buffer_set_bounds
static HALIDE_EXPORT ConstString | trace
static const IRNodeType | _node_type = IRNodeType::Call

## Detailed Description

A function call.

This can represent a call to some extern function (like sin), but it's also our multi-dimensional version of a Load, so it can be a load from an input image, or a call to another halide function. These two types of call nodes don't survive all the way down to code generation - the lowering process converts them to Load nodes.

Definition at line 500 of file IR.h.

## Member Typedef Documentation

## ◆ ConstString

typedef const char* const Halide::Internal::Call::ConstString

Definition at line 519 of file IR.h.

## Member Enumeration Documentation

## ◆ CallType

enum Halide::Internal::Call::CallType

Enumerator
Image | A load from an input image.
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.
PureExtern | A call to a guaranteed-side-effect-free external function.
Halide | A call to a Func.
Intrinsic | A possibly-side-effecty compiler intrinsic, which has special handling during codegen.
PureIntrinsic | A side-effect-free version of the above.

Definition at line 503 of file IR.h.

## ◆ IntrinsicOp

enum Halide::Internal::Call::IntrinsicOp

Enumerator
abs |
absd |
add_image_checks_marker |
alloca |
bitwise_and |
bitwise_not |
bitwise_or |
bitwise_xor |
bool_to_mask |
bundle |
call_cached_indirect_function |
cast_mask |
concat_bits |
count_leading_zeros |
count_trailing_zeros |
debug_to_file |
declare_box_touched |
div_round_to_zero |
dynamic_shuffle |
extract_bits |
extract_mask_element |
get_user_context |
gpu_thread_barrier |
halving_add |
halving_sub |
hvx_gather |
hvx_scatter |
hvx_scatter_acc |
hvx_scatter_release |
if_then_else |
if_then_else_mask |
image_load |
image_store |
lerp |
likely |
likely_if_innermost |
load_typed_struct_member |
make_struct |
memoize_expr |
mod_round_to_zero |
mul_shift_right |
mux |
popcount |
prefetch |
profiling_enable_instance_marker |
promise_clamped |
random |
register_destructor |
require |
require_mask |
return_second |
rewrite_buffer |
round |
rounding_halving_add |
rounding_mul_shift_right |
rounding_shift_left |
rounding_shift_right |
saturating_add |
saturating_sub |
saturating_cast |
scatter_gather |
select_mask |
shift_left |
shift_right |
signed_integer_overflow |
size_of_halide_buffer_t |
skip_stages_marker |
sliding_window_marker |
sorted_avg |
strict_add |
strict_cast |
strict_div |
strict_eq |
strict_le |
strict_lt |
strict_max |
strict_min |
strict_mul |
strict_sub |
stringify |
target_arch_is |
target_bits |
target_has_feature |
target_natural_vector_size |
target_os_is |
undef |
unreachable |
unsafe_promise_clamped |
widen_right_add |
widen_right_mul |
widen_right_sub |
widening_add |
widening_mul |
widening_shift_left |
widening_shift_right |
widening_sub |
get_runtime_vscale |
IntrinsicOpCount |

Definition at line 528 of file IR.h.

## Member Function Documentation

## ◆ get_intrinsic_name()

static const char * Halide::Internal::Call::get_intrinsic_name | ( | IntrinsicOp | op | ) |
| static

Referenced by is_intrinsic().

## ◆ make() [1/5]

static Expr Halide::Internal::Call::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

Referenced by make(), and make().

## ◆ make() [2/5]

static Expr Halide::Internal::Call::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

## ◆ make() [3/5]

static Expr Halide::Internal::Call::make | ( | const Function & | func,
|  | const std::vector< Expr > & | args,
|  | int | idx = `0`
| ) |  |
| static

Convenience constructor for calls to other halide functions.

## ◆ make() [4/5]

static Expr Halide::Internal::Call::make | ( | const Buffer<> & | image,
|  | const std::vector< Expr > & | args
| ) |  |
| inline static

Convenience constructor for loads from concrete images.

Definition at line 727 of file IR.h.

References args, Image, image, make(), Halide::Buffer< T, Dims >::name(), and Halide::Buffer< T, Dims >::type().

## ◆ make() [5/5]

static Expr Halide::Internal::Call::make | ( | const Parameter & | param,
|  | const std::vector< Expr > & | args
| ) |  |
| inline static

Convenience constructor for loads from images parameters.

Definition at line 732 of file IR.h.

References args, Image, make(), Halide::Parameter::name(), param, and Halide::Parameter::type().

## ◆ is_pure()

bool Halide::Internal::Call::is_pure | ( |  | ) | const
| inline

Check if a call node is pure within a pipeline, meaning that the same args always give the same result, and the calls can be reordered, duplicated, unified, etc without changing the meaning of anything.

Not transitive - doesn't guarantee the args themselves are pure. An example of a pure Call node is sqrt. If in doubt, don't mark a Call node as pure.

Definition at line 742 of file IR.h.

References call_type, Image, PureExtern, and PureIntrinsic.

## ◆ is_intrinsic() [1/3]

bool Halide::Internal::Call::is_intrinsic | ( |  | ) | const
| inline

Definition at line 748 of file IR.h.

References call_type, Intrinsic, and PureIntrinsic.

Referenced by is_intrinsic(), is_intrinsic(), is_strict_float_intrinsic(), is_tag(), Halide::Internal::IRMatcher::Intrin< intrin, Args >::match(), and Halide::Internal::IRMatcher::Overflow::match().

## ◆ is_intrinsic() [2/3]

bool Halide::Internal::Call::is_intrinsic | ( | IntrinsicOp | op | ) | const
| inline

Definition at line 753 of file IR.h.

References get_intrinsic_name(), and is_intrinsic().

## ◆ is_intrinsic() [3/3]

bool Halide::Internal::Call::is_intrinsic | ( | std::initializer_list< IntrinsicOp > | intrinsics | ) | const
| inline

Definition at line 757 of file IR.h.

References Halide::cast(), and is_intrinsic().

## ◆ is_tag()

bool Halide::Internal::Call::is_tag | ( |  | ) | const
| inline

Definition at line 766 of file IR.h.

References is_intrinsic(), likely, and likely_if_innermost.

## ◆ as_intrinsic()

static const Call * Halide::Internal::Call::as_intrinsic | ( | const Expr & | e,
|  | std::initializer_list< IntrinsicOp > | intrinsics
| ) |  |
| inline static

Returns a pointer to a call node if the expression is a call to one of the requested intrinsics.

Definition at line 772 of file IR.h.

References Halide::Internal::IRHandle::as(), and Halide::cast().

Referenced by as_tag().

## ◆ as_tag()

static const Call * Halide::Internal::Call::as_tag | ( | const Expr & | e | ) |
| inline static

Definition at line 783 of file IR.h.

References as_intrinsic(), likely, and likely_if_innermost.

## ◆ is_extern()

bool Halide::Internal::Call::is_extern | ( |  | ) | const
| inline

Definition at line 787 of file IR.h.

References call_type, Extern, ExternCPlusPlus, and PureExtern.

## ◆ is_strict_float_intrinsic()

bool Halide::Internal::Call::is_strict_float_intrinsic | ( |  | ) | const
| inline

Definition at line 793 of file IR.h.

References is_intrinsic(), strict_add, strict_cast, strict_div, strict_eq, strict_le, strict_lt, strict_max, strict_min, strict_mul, and strict_sub.

## Member Data Documentation

## ◆ name

std::string Halide::Internal::Call::name

Definition at line 501 of file IR.h.

Referenced by Halide::SimdOpCheckTest::check_one().

## ◆ args

std::vector<Expr> Halide::Internal::Call::args

Definition at line 502 of file IR.h.

Referenced by Halide::SimdOpCheckTest::check_one(), make(), and make().

## ◆ call_type

CallType Halide::Internal::Call::call_type

Definition at line 511 of file IR.h.

Referenced by Halide::SimdOpCheckTest::check_one(), is_extern(), is_intrinsic(), and is_pure().

## ◆ buffer_get_dimensions

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_dimensions
| static

Definition at line 678 of file IR.h.

## ◆ buffer_get_min

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_min
| static

Definition at line 679 of file IR.h.

## ◆ buffer_get_extent

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_extent
| static

Definition at line 680 of file IR.h.

## ◆ buffer_get_stride

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_stride
| static

Definition at line 681 of file IR.h.

## ◆ buffer_get_max

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_max
| static

Definition at line 682 of file IR.h.

## ◆ buffer_get_host

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_host
| static

Definition at line 683 of file IR.h.

## ◆ buffer_get_device

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_device
| static

Definition at line 684 of file IR.h.

## ◆ buffer_get_device_interface

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_device_interface
| static

Definition at line 685 of file IR.h.

## ◆ buffer_get_shape

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_shape
| static

Definition at line 686 of file IR.h.

## ◆ buffer_get_host_dirty

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_host_dirty
| static

Definition at line 687 of file IR.h.

## ◆ buffer_get_device_dirty

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_device_dirty
| static

Definition at line 688 of file IR.h.

## ◆ buffer_get_type

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_get_type
| static

Definition at line 689 of file IR.h.

## ◆ buffer_set_host_dirty

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_set_host_dirty
| static

Definition at line 690 of file IR.h.

## ◆ buffer_set_device_dirty

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_set_device_dirty
| static

Definition at line 691 of file IR.h.

## ◆ buffer_is_bounds_query

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_is_bounds_query
| static

Definition at line 692 of file IR.h.

## ◆ buffer_init

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_init
| static

Definition at line 693 of file IR.h.

## ◆ buffer_init_from_buffer

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_init_from_buffer
| static

Definition at line 694 of file IR.h.

## ◆ buffer_crop

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_crop
| static

Definition at line 695 of file IR.h.

## ◆ buffer_set_bounds

HALIDE_EXPORT ConstString Halide::Internal::Call::buffer_set_bounds
| static

Definition at line 696 of file IR.h.

## ◆ trace

HALIDE_EXPORT ConstString Halide::Internal::Call::trace
| static

Definition at line 697 of file IR.h.

## ◆ func

FunctionPtr Halide::Internal::Call::func

Definition at line 701 of file IR.h.

Referenced by Halide::SimdOpCheckTest::check_one().

## ◆ value_index

int Halide::Internal::Call::value_index

Definition at line 705 of file IR.h.

## ◆ image

Buffer Halide::Internal::Call::image

Definition at line 709 of file IR.h.

Referenced by make().

## ◆ param

Parameter Halide::Internal::Call::param

Definition at line 713 of file IR.h.

Referenced by make().

## ◆ _node_type

const IRNodeType Halide::Internal::Call::_node_type = IRNodeType::Call
| static

Definition at line 807 of file IR.h.

Referenced by Halide::Internal::IRMatcher::Overflow::match().

The documentation for this struct was generated from the following file:

- src/IR.h