Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::Internal::Call Struct Reference

A function call. More...

#include <IR.h>

Inheritance diagram for Halide::Internal::Call:
Halide::Internal::ExprNode< Call > Halide::Internal::BaseExprNode Halide::Internal::IRNode

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_float , 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
 
- 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 Callas_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 Callas_tag (const Expr &e)
 

Public Attributes

std::string name
 
std::vector< Exprargs
 
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 490 of file IR.h.

Member Typedef Documentation

◆ ConstString

Definition at line 509 of file IR.h.

Member Enumeration Documentation

◆ 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 493 of file IR.h.

◆ 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_float 
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 518 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 )
inlinestatic

Convenience constructor for loads from concrete images.

Definition at line 700 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 )
inlinestatic

Convenience constructor for loads from images parameters.

Definition at line 705 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 715 of file IR.h.

References call_type, Image, PureExtern, and PureIntrinsic.

◆ is_intrinsic() [1/3]

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

◆ is_intrinsic() [2/3]

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

Definition at line 726 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 730 of file IR.h.

References is_intrinsic().

◆ is_tag()

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

Definition at line 739 of file IR.h.

References is_intrinsic(), likely, likely_if_innermost, and strict_float.

◆ as_intrinsic()

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

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

Definition at line 745 of file IR.h.

References Halide::Internal::IRHandle::as().

Referenced by as_tag().

◆ as_tag()

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

Definition at line 756 of file IR.h.

References as_intrinsic(), likely, likely_if_innermost, and strict_float.

◆ is_extern()

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

Definition at line 760 of file IR.h.

References call_type, Extern, ExternCPlusPlus, and PureExtern.

Member Data Documentation

◆ name

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

Definition at line 491 of file IR.h.

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

◆ args

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

◆ call_type

CallType Halide::Internal::Call::call_type

Definition at line 501 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 651 of file IR.h.

◆ buffer_get_min

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

Definition at line 652 of file IR.h.

◆ buffer_get_extent

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

Definition at line 653 of file IR.h.

◆ buffer_get_stride

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

Definition at line 654 of file IR.h.

◆ buffer_get_max

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

Definition at line 655 of file IR.h.

◆ buffer_get_host

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

Definition at line 656 of file IR.h.

◆ buffer_get_device

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

Definition at line 657 of file IR.h.

◆ buffer_get_device_interface

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

Definition at line 658 of file IR.h.

◆ buffer_get_shape

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

Definition at line 659 of file IR.h.

◆ buffer_get_host_dirty

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

Definition at line 660 of file IR.h.

◆ buffer_get_device_dirty

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

Definition at line 661 of file IR.h.

◆ buffer_get_type

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

Definition at line 662 of file IR.h.

◆ buffer_set_host_dirty

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

Definition at line 663 of file IR.h.

◆ buffer_set_device_dirty

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

Definition at line 664 of file IR.h.

◆ buffer_is_bounds_query

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

Definition at line 665 of file IR.h.

◆ buffer_init

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

Definition at line 666 of file IR.h.

◆ buffer_init_from_buffer

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

Definition at line 667 of file IR.h.

◆ buffer_crop

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

Definition at line 668 of file IR.h.

◆ buffer_set_bounds

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

Definition at line 669 of file IR.h.

◆ trace

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

Definition at line 670 of file IR.h.

◆ func

FunctionPtr Halide::Internal::Call::func

Definition at line 674 of file IR.h.

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

◆ value_index

int Halide::Internal::Call::value_index

Definition at line 678 of file IR.h.

◆ image

Buffer Halide::Internal::Call::image

Definition at line 682 of file IR.h.

Referenced by make().

◆ param

Parameter Halide::Internal::Call::param

Definition at line 686 of file IR.h.

Referenced by make().

◆ _node_type

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

Definition at line 766 of file IR.h.

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


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