Halide
Halide::Internal::Call Struct Reference

A function call. More...

#include <IR.h>

Inherits Halide::Internal::ExprNode< 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,
  count_leading_zeros, count_trailing_zeros, declare_box_touched, debug_to_file,
  div_round_to_zero, dynamic_shuffle, extract_mask_element, glsl_texture_load,
  glsl_texture_store, glsl_varying, gpu_thread_barrier, 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, make_struct, memoize_expr,
  mod_round_to_zero, mulhi_shr, popcount, prefetch,
  promise_clamped, random, register_destructor, reinterpret,
  require, require_mask, return_second, rewrite_buffer,
  select_mask, shift_left, shift_right, signed_integer_overflow,
  size_of_halide_buffer_t, sorted_avg, strict_float, stringify,
  undef, unsafe_promise_clamped, IntrinsicOpCount
}
 

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. More...
 
bool is_intrinsic () const
 
bool is_intrinsic (IntrinsicOp op) 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. More...
 
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. More...
 
static Expr make (const Buffer<> &image, const std::vector< Expr > &args)
 Convenience constructor for loads from concrete images. More...
 
static Expr make (const Parameter &param, const std::vector< Expr > &args)
 Convenience constructor for loads from images parameters. More...
 

Public Attributes

const typedef char *const ConstString
 
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. More...
 
IRNodeType node_type
 Each IR node subclass has a unique identifier. More...
 

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 464 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 467 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 
count_leading_zeros 
count_trailing_zeros 
declare_box_touched 
debug_to_file 
div_round_to_zero 
dynamic_shuffle 
extract_mask_element 
glsl_texture_load 
glsl_texture_store 
glsl_varying 
gpu_thread_barrier 
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 
make_struct 
memoize_expr 
mod_round_to_zero 
mulhi_shr 
popcount 
prefetch 
promise_clamped 
random 
register_destructor 
reinterpret 
require 
require_mask 
return_second 
rewrite_buffer 
select_mask 
shift_left 
shift_right 
signed_integer_overflow 
size_of_halide_buffer_t 
sorted_avg 
strict_float 
stringify 
undef 
unsafe_promise_clamped 
IntrinsicOpCount 

Definition at line 492 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().

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

References args, Image, image, make(), Halide::Buffer< T >::name(), and Halide::Buffer< T >::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 614 of file IR.h.

References args, Image, make(), Halide::Internal::Parameter::name(), param, and Halide::Internal::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 624 of file IR.h.

References call_type, Image, PureExtern, and PureIntrinsic.

◆ is_intrinsic() [1/2]

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

◆ is_intrinsic() [2/2]

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

Definition at line 635 of file IR.h.

References get_intrinsic_name(), and is_intrinsic().

◆ is_extern()

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

Definition at line 639 of file IR.h.

References call_type, Extern, ExternCPlusPlus, and PureExtern.

Member Data Documentation

◆ ConstString

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

Definition at line 483 of file IR.h.

◆ name

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

Definition at line 465 of file IR.h.

◆ args

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

Definition at line 466 of file IR.h.

Referenced by make().

◆ call_type

CallType Halide::Internal::Call::call_type

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

◆ buffer_get_min

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

Definition at line 561 of file IR.h.

◆ buffer_get_extent

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

Definition at line 562 of file IR.h.

◆ buffer_get_stride

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

Definition at line 563 of file IR.h.

◆ buffer_get_max

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

Definition at line 564 of file IR.h.

◆ buffer_get_host

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

Definition at line 565 of file IR.h.

◆ buffer_get_device

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

Definition at line 566 of file IR.h.

◆ buffer_get_device_interface

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

Definition at line 567 of file IR.h.

◆ buffer_get_shape

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

Definition at line 568 of file IR.h.

◆ buffer_get_host_dirty

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

Definition at line 569 of file IR.h.

◆ buffer_get_device_dirty

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

Definition at line 570 of file IR.h.

◆ buffer_get_type

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

Definition at line 571 of file IR.h.

◆ buffer_set_host_dirty

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

Definition at line 572 of file IR.h.

◆ buffer_set_device_dirty

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

Definition at line 573 of file IR.h.

◆ buffer_is_bounds_query

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

Definition at line 574 of file IR.h.

◆ buffer_init

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

Definition at line 575 of file IR.h.

◆ buffer_init_from_buffer

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

Definition at line 576 of file IR.h.

◆ buffer_crop

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

Definition at line 577 of file IR.h.

◆ buffer_set_bounds

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

Definition at line 578 of file IR.h.

◆ trace

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

Definition at line 579 of file IR.h.

◆ func

FunctionPtr Halide::Internal::Call::func

Definition at line 583 of file IR.h.

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

◆ value_index

int Halide::Internal::Call::value_index

Definition at line 587 of file IR.h.

◆ image

Buffer Halide::Internal::Call::image

Definition at line 591 of file IR.h.

Referenced by make().

◆ param

Parameter Halide::Internal::Call::param

Definition at line 595 of file IR.h.

Referenced by make().

◆ _node_type

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

Definition at line 645 of file IR.h.

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


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