Halide 22.0.0 Halide compiler and libraries

Classes | Namespaces | Functions | Variables
IROperator.h File Reference

Defines various operator overloads and utility functions that make it more pleasant to work with Halide expressions. More...

`#include <cmath>`
`#include <map>`
`#include <optional>`
`#include "ConstantInterval.h"`
`#include "Expr.h"`
`#include "Scope.h"`
`#include "Target.h"`
`#include "Tuple.h"`

Go to the source code of this file.

## Classes
struct | Halide::Internal::BufferBuilder
| A builder to help create Exprs representing halide_buffer_t structs (e.g. More...
struct | Halide::Internal::is_printable_arg< T >
struct | Halide::Internal::all_are_printable_args< Args >

## Namespaces
namespace | Halide
| This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
namespace | Halide::Internal

## Functions
bool | Halide::Internal::is_const (const Expr &e)
| Is the expression either an IntImm, a FloatImm, a StringImm, or a Cast of the same, or a Ramp or Broadcast of the same. More...
bool | Halide::Internal::is_const (const Expr &e, int64_t v)
| Is the expression an IntImm, FloatImm of a particular value, or a Cast, or Broadcast of the same. More...
std::optional< int64_t > | Halide::Internal::as_const_int (const Expr &e)
| If an expression is an IntImm or a Broadcast of an IntImm, return a its value. More...
std::optional< uint64_t > | Halide::Internal::as_const_uint (const Expr &e)
| If an expression is a UIntImm or a Broadcast of a UIntImm, return its value. More...
std::optional< double > | Halide::Internal::as_const_float (const Expr &e)
| If an expression is a FloatImm or a Broadcast of a FloatImm, return its value. More...
std::optional< int > | Halide::Internal::is_const_power_of_two_integer (const Expr &e)
| Is the expression a constant integer power of two. More...
std::optional< int > | Halide::Internal::is_const_power_of_two_integer (uint64_t)
std::optional< int > | Halide::Internal::is_const_power_of_two_integer (int64_t)
bool | Halide::Internal::is_positive_const (const Expr &e)
| Is the expression a const (as defined by is_const), and also strictly greater than zero (in all lanes, if a vector expression) More...
bool | Halide::Internal::is_negative_const (const Expr &e)
| Is the expression a const (as defined by is_const), and also strictly less than zero (in all lanes, if a vector expression) More...
bool | Halide::Internal::is_undef (const Expr &e)
| Is the expression an undef. More...
bool | Halide::Internal::is_const_zero (const Expr &e)
| Is the expression a const (as defined by is_const), and also equal to zero (in all lanes, if a vector expression) More...
bool | Halide::Internal::is_const_one (const Expr &e)
| Is the expression a const (as defined by is_const), and also equal to one (in all lanes, if a vector expression) More...
bool | Halide::Internal::is_no_op (const Stmt &s)
| Is the statement a no-op (which we represent as either an undefined Stmt, or as an Evaluate node of a constant) More...
bool | Halide::Internal::is_pure (const Expr &e)
| Does the expression 1) Take on the same value no matter where it appears in a Stmt, and 2) Evaluating it has no side-effects. More...
Expr | Halide::Internal::make_const (Type t, int64_t val)
| Construct an immediate of the given type from any numeric C++ type. More...
Expr | Halide::Internal::make_const (Type t, uint64_t val)
Expr | Halide::Internal::make_const (Type t, double val)
Expr | Halide::Internal::make_const (Type t, int32_t val)
Expr | Halide::Internal::make_const (Type t, uint32_t val)
Expr | Halide::Internal::make_const (Type t, int16_t val)
Expr | Halide::Internal::make_const (Type t, uint16_t val)
Expr | Halide::Internal::make_const (Type t, int8_t val)
Expr | Halide::Internal::make_const (Type t, uint8_t val)
Expr | Halide::Internal::make_const (Type t, bool val)
Expr | Halide::Internal::make_const (Type t, float val)
Expr | Halide::Internal::make_const (Type t, float16_t val)
Expr | Halide::Internal::make_signed_integer_overflow (Type type)
| Construct a unique signed_integer_overflow Expr. More...
bool | Halide::Internal::is_signed_integer_overflow (const Expr &expr)
| Check if an expression is a signed_integer_overflow. More...
void | Halide::Internal::check_representable (Type t, int64_t val)
| Check if a constant value can be correctly represented as the given type. More...
Expr | Halide::Internal::make_bool (bool val, int lanes=1)
| Construct a boolean constant from a C++ boolean value. More...
Expr | Halide::Internal::make_zero (Type t)
| Construct the representation of zero in the given type. More...
Expr | Halide::Internal::make_one (Type t)
| Construct the representation of one in the given type. More...
Expr | Halide::Internal::make_two (Type t)
| Construct the representation of two in the given type. More...
Expr | Halide::Internal::const_true (int lanes=1)
| Construct the constant boolean true. More...
Expr | Halide::Internal::const_false (int lanes=1)
| Construct the constant boolean false. More...
Expr | Halide::Internal::lossless_cast (Type t, Expr e, const Scope< ConstantInterval > &scope=Scope< ConstantInterval >::empty_scope(), std::map< Expr, ConstantInterval, ExprCompare > *cache=nullptr)
| Attempt to cast an expression to a smaller type while provably not losing information. More...
Expr | Halide::Internal::lossless_negate (const Expr &x)
| Attempt to negate x without introducing new IR and without overflow. More...
void | Halide::Internal::match_types (Expr &a, Expr &b)
| Coerce the two expressions to have the same type, using C-style casting rules. More...
void | Halide::Internal::match_types_bitwise (Expr &a, Expr &b, const char *op_name)
| Asserts that both expressions are integer types and are either both signed or both unsigned. More...
Expr | Halide::Internal::halide_log (const Expr &a)
| Halide's vectorizable transcendentals. More...
Expr | Halide::Internal::halide_exp (const Expr &a)
Expr | Halide::Internal::halide_erf (const Expr &a)
Expr | Halide::Internal::raise_to_integer_power (Expr a, int64_t b)
| Raise an expression to an integer power by repeatedly multiplying it by itself. More...
void | Halide::Internal::split_into_ands (const Expr &cond, std::vector< Expr > &result)
| Split a boolean condition into vector of ANDs. More...
Expr | Halide::Internal::strided_ramp_base (const Expr &e, int stride=1)
| If e is a ramp expression with stride, default 1, return the base, otherwise undefined. More...
template<typename T >
T | Halide::Internal::mod_imp (T a, T b)
| Implementations of division and mod that are specific to Halide. More...
template<typename T >
T | Halide::Internal::div_imp (T a, T b)
template<>
float | Halide::Internal::mod_imp< float > (float a, float b)
template<>
double | Halide::Internal::mod_imp< double > (double a, double b)
template<>
float | Halide::Internal::div_imp< float > (float a, float b)
template<>
double | Halide::Internal::div_imp< double > (double a, double b)
Expr | Halide::Internal::remove_likelies (const Expr &e)
| Return an Expr that is identical to the input Expr, but with all calls to likely() and likely_if_innermost() removed. More...
Stmt | Halide::Internal::remove_likelies (const Stmt &s)
| Return a Stmt that is identical to the input Stmt, but with all calls to likely() and likely_if_innermost() removed. More...
Expr | Halide::Internal::remove_promises (const Expr &e)
| Return an Expr that is identical to the input Expr, but with all calls to promise_clamped() and unsafe_promise_clamped() removed. More...
Stmt | Halide::Internal::remove_promises (const Stmt &s)
| Return a Stmt that is identical to the input Stmt, but with all calls to promise_clamped() and unsafe_promise_clamped() removed. More...
Expr | Halide::Internal::unwrap_tags (const Expr &e)
| If the expression is a tag helper call, remove it and return the tagged expression. More...
HALIDE_NO_USER_CODE_INLINE void | Halide::Internal::collect_print_args (std::vector< Expr > &args)
template<typename... Args>
HALIDE_NO_USER_CODE_INLINE void | Halide::Internal::collect_print_args (std::vector< Expr > &args, const char *arg, Args &&...more_args)
template<typename... Args>
HALIDE_NO_USER_CODE_INLINE void | Halide::Internal::collect_print_args (std::vector< Expr > &args, Expr arg, Args &&...more_args)
Expr | Halide::Internal::requirement_failed_error (Expr condition, const std::vector< Expr > &args)
Expr | Halide::Internal::memoize_tag_helper (Expr result, const std::vector< Expr > &cache_key_values)
void | Halide::Internal::reset_random_counters ()
| Reset the counters used for random-number seeds in random_float/int/uint. More...
template<typename T >
Expr | Halide::cast (Expr a)
| Cast an expression to the halide type corresponding to the C++ type T. More...
Expr | Halide::cast (Type t, Expr a)
| Cast an expression to a new type. More...
Expr | Halide::operator+ (Expr a, Expr b)
| Return the sum of two expressions, doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator+ (Expr a, int b)
| Add an expression and a constant integer. More...
Expr | Halide::operator+ (int a, Expr b)
| Add a constant integer and an expression. More...
Expr & | Halide::operator+= (Expr &a, Expr b)
| Modify the first expression to be the sum of two expressions, without changing its type. More...
Expr | Halide::operator- (Expr a, Expr b)
| Return the difference of two expressions, doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator- (Expr a, int b)
| Subtracts a constant integer from an expression. More...
Expr | Halide::operator- (int a, Expr b)
| Subtracts an expression from a constant integer. More...
Expr | Halide::operator- (Expr a)
| Return the negative of the argument. More...
Expr & | Halide::operator-= (Expr &a, Expr b)
| Modify the first expression to be the difference of two expressions, without changing its type. More...
Expr | Halide::operator* (Expr a, Expr b)
| Return the product of two expressions, doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator* (Expr a, int b)
| Multiply an expression and a constant integer. More...
Expr | Halide::operator* (int a, Expr b)
| Multiply a constant integer and an expression. More...
Expr & | Halide::operator*= (Expr &a, Expr b)
| Modify the first expression to be the product of two expressions, without changing its type. More...
Expr | Halide::operator/ (Expr a, Expr b)
| Return the ratio of two expressions, doing any necessary type coercion using Internal::match_types. More...
Expr & | Halide::operator/= (Expr &a, Expr b)
| Modify the first expression to be the ratio of two expressions, without changing its type. More...
Expr | Halide::operator/ (Expr a, int b)
| Divides an expression by a constant integer. More...
Expr | Halide::operator/ (int a, Expr b)
| Divides a constant integer by an expression. More...
Expr | Halide::operator% (Expr a, Expr b)
| Return the first argument reduced modulo the second, doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator% (Expr a, int b)
| Mods an expression by a constant integer. More...
Expr | Halide::operator% (int a, Expr b)
| Mods a constant integer by an expression. More...
Expr | Halide::operator> (Expr a, Expr b)
| Return a boolean expression that tests whether the first argument is greater than the second, after doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator> (Expr a, int b)
| Return a boolean expression that tests whether an expression is greater than a constant integer. More...
Expr | Halide::operator> (int a, Expr b)
| Return a boolean expression that tests whether a constant integer is greater than an expression. More...
Expr | Halide::operator< (Expr a, Expr b)
| Return a boolean expression that tests whether the first argument is less than the second, after doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator< (Expr a, int b)
| Return a boolean expression that tests whether an expression is less than a constant integer. More...
Expr | Halide::operator< (int a, Expr b)
| Return a boolean expression that tests whether a constant integer is less than an expression. More...
Expr | Halide::operator<= (Expr a, Expr b)
| Return a boolean expression that tests whether the first argument is less than or equal to the second, after doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator<= (Expr a, int b)
| Return a boolean expression that tests whether an expression is less than or equal to a constant integer. More...
Expr | Halide::operator<= (int a, Expr b)
| Return a boolean expression that tests whether a constant integer is less than or equal to an expression. More...
Expr | Halide::operator>= (Expr a, Expr b)
| Return a boolean expression that tests whether the first argument is greater than or equal to the second, after doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator>= (const Expr &a, int b)
| Return a boolean expression that tests whether an expression is greater than or equal to a constant integer. More...
Expr | Halide::operator>= (int a, const Expr &b)
| Return a boolean expression that tests whether a constant integer is greater than or equal to an expression. More...
Expr | Halide::operator== (Expr a, Expr b)
| Return a boolean expression that tests whether the first argument is equal to the second, after doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator== (Expr a, int b)
| Return a boolean expression that tests whether an expression is equal to a constant integer. More...
Expr | Halide::operator== (int a, Expr b)
| Return a boolean expression that tests whether a constant integer is equal to an expression. More...
Expr | Halide::operator!= (Expr a, Expr b)
| Return a boolean expression that tests whether the first argument is not equal to the second, after doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::operator!= (Expr a, int b)
| Return a boolean expression that tests whether an expression is not equal to a constant integer. More...
Expr | Halide::operator!= (int a, Expr b)
| Return a boolean expression that tests whether a constant integer is not equal to an expression. More...
Expr | Halide::operator&& (Expr a, Expr b)
| Returns the logical and of the two arguments. More...
Expr | Halide::operator&& (Expr a, bool b)
| Logical and of an Expr and a bool. More...
Expr | Halide::operator&& (bool a, Expr b)
Expr | Halide::operator|| (Expr a, Expr b)
| Returns the logical or of the two arguments. More...
Expr | Halide::operator|| (Expr a, bool b)
| Logical or of an Expr and a bool. More...
Expr | Halide::operator|| (bool a, Expr b)
Expr | Halide::operator! (Expr a)
| Returns the logical not the argument. More...
Expr | Halide::max (Expr a, Expr b)
| Returns an expression representing the greater of the two arguments, after doing any necessary type coercion using Internal::match_types. More...
Expr | Halide::max (Expr a, int b)
| Returns an expression representing the greater of an expression and a constant integer. More...
Expr | Halide::max (int a, Expr b)
| Returns an expression representing the greater of a constant integer and an expression. More...
Expr | Halide::max (float a, Expr b)
Expr | Halide::max (Expr a, float b)
template<typename A , typename B , typename C , typename... Rest, std::enable_if_t< Internal::all_are_convertible< Expr, Rest... >::value > * = nullptr>
Expr | Halide::max (A &&a, B &&b, C &&c, Rest &&...rest)
| Returns an expression representing the greater of an expressions vector, after doing any necessary type coersion using Internal::match_types. More...
Expr | Halide::min (Expr a, Expr b)
Expr | Halide::min (Expr a, int b)
| Returns an expression representing the lesser of an expression and a constant integer. More...
Expr | Halide::min (int a, Expr b)
| Returns an expression representing the lesser of a constant integer and an expression. More...
Expr | Halide::min (float a, Expr b)
Expr | Halide::min (Expr a, float b)
template<typename A , typename B , typename C , typename... Rest, std::enable_if_t< Internal::all_are_convertible< Expr, Rest... >::value > * = nullptr>
Expr | Halide::min (A &&a, B &&b, C &&c, Rest &&...rest)
| Returns an expression representing the lesser of an expressions vector, after doing any necessary type coersion using Internal::match_types. More...
Expr | Halide::operator+ (Expr a, float b)
| Operators on floats treats those floats as Exprs. More...
Expr | Halide::operator+ (float a, Expr b)
Expr | Halide::operator- (Expr a, float b)
Expr | Halide::operator- (float a, Expr b)
Expr | Halide::operator* (Expr a, float b)
Expr | Halide::operator* (float a, Expr b)
Expr | Halide::operator/ (Expr a, float b)
Expr | Halide::operator/ (float a, Expr b)
Expr | Halide::operator% (Expr a, float b)
Expr | Halide::operator% (float a, Expr b)
Expr | Halide::operator> (Expr a, float b)
Expr | Halide::operator> (float a, Expr b)
Expr | Halide::operator< (Expr a, float b)
Expr | Halide::operator< (float a, Expr b)
Expr | Halide::operator>= (Expr a, float b)
Expr | Halide::operator>= (float a, Expr b)
Expr | Halide::operator<= (Expr a, float b)
Expr | Halide::operator<= (float a, Expr b)
Expr | Halide::operator== (Expr a, float b)
Expr | Halide::operator== (float a, Expr b)
Expr | Halide::operator!= (Expr a, float b)
Expr | Halide::operator!= (float a, Expr b)
Expr | Halide::clamp (Expr a, const Expr &min_val, const Expr &max_val)
| Clamps an expression to lie within the given bounds. More...
Expr | Halide::abs (Expr a)
| Returns the absolute value of a signed integer or floating-point expression. More...
Expr | Halide::absd (Expr a, Expr b)
| Return the absolute difference between two values. More...
Expr | Halide::select (Expr condition, Expr true_value, Expr false_value)
| Returns an expression similar to the ternary operator in C, except that it always evaluates all arguments. More...
template<typename... Args, std::enable_if_t< Internal::all_are_convertible< Expr, Args... >::value > * = nullptr>
Expr | Halide::select (Expr c0, Expr v0, Expr c1, Expr v1, Args &&...args)
| A multi-way variant of select similar to a switch statement in C, which can accept multiple conditions and values in pairs. More...
Tuple | Halide::select (const Tuple &condition, const Tuple &true_value, const Tuple &false_value)
| Equivalent of ternary select(), but taking/returning tuples. More...
Tuple | Halide::select (const Expr &condition, const Tuple &true_value, const Tuple &false_value)
template<typename... Args>
Tuple | Halide::select (const Tuple &c0, const Tuple &v0, const Tuple &c1, const Tuple &v1, Args &&...args)
| Equivalent of multiway select(), but taking/returning tuples. More...
template<typename... Args>
Tuple | Halide::select (const Expr &c0, const Tuple &v0, const Expr &c1, const Tuple &v1, Args &&...args)
Expr | Halide::select (const Expr &condition, const FuncRef &true_value, const FuncRef &false_value)
| select applied to FuncRefs (e.g. More...
template<typename... Args>
Expr | Halide::select (const Expr &c0, const FuncRef &v0, const Expr &c1, const FuncRef &v1, Args &&...args)
Expr | Halide::mux (const Expr &id, const std::initializer_list< Expr > &values)
| Oftentimes we want to pack a list of expressions with the same type into a channel dimension, e.g., img(x, y, c) = select(c == 0, 100, // Red c == 1, 50, // Green 25); // Blue This is tedious when the list is long. More...
Expr | Halide::mux (const Expr &id, const std::vector< Expr > &values)
Expr | Halide::mux (const Expr &id, const Tuple &values)
Expr | Halide::mux (const Expr &id, const std::initializer_list< FuncRef > &values)
Tuple | Halide::mux (const Expr &id, const std::initializer_list< Tuple > &values)
Tuple | Halide::mux (const Expr &id, const std::vector< Tuple > &values)
Expr | Halide::sin (Expr x)
| Return the sine of a floating-point expression. More...
Expr | Halide::asin (Expr x)
| Return the arcsine of a floating-point expression. More...
Expr | Halide::cos (Expr x)
| Return the cosine of a floating-point expression. More...
Expr | Halide::acos (Expr x)
| Return the arccosine of a floating-point expression. More...
Expr | Halide::tan (Expr x)
| Return the tangent of a floating-point expression. More...
Expr | Halide::atan (Expr x)
| Return the arctangent of a floating-point expression. More...
Expr | Halide::atan2 (Expr y, Expr x)
| Return the angle of a floating-point gradient. More...
Expr | Halide::sinh (Expr x)
| Return the hyperbolic sine of a floating-point expression. More...
Expr | Halide::asinh (Expr x)
| Return the hyperbolic arcsinhe of a floating-point expression. More...
Expr | Halide::cosh (Expr x)
| Return the hyperbolic cosine of a floating-point expression. More...
Expr | Halide::acosh (Expr x)
| Return the hyperbolic arccosine of a floating-point expression. More...
Expr | Halide::tanh (Expr x)
| Return the hyperbolic tangent of a floating-point expression. More...
Expr | Halide::atanh (Expr x)
| Return the hyperbolic arctangent of a floating-point expression. More...
Expr | Halide::sqrt (Expr x)
| Return the square root of a floating-point expression. More...
Expr | Halide::hypot (const Expr &x, const Expr &y)
| Return the square root of the sum of the squares of two floating-point expressions. More...
Expr | Halide::exp (Expr x)
| Return the exponential of a floating-point expression. More...
Expr | Halide::log (Expr x)
| Return the logarithm of a floating-point expression. More...
Expr | Halide::pow (Expr x, Expr y)
| Return one floating point expression raised to the power of another. More...
Expr | Halide::erf (const Expr &x)
| Evaluate the error function erf. More...
Expr | Halide::fast_sin (const Expr &x)
| Fast vectorizable approximation to some trigonometric functions for Float(32). More...
Expr | Halide::fast_cos (const Expr &x)
Expr | Halide::fast_log (const Expr &x)
| Fast approximate cleanly vectorizable log for Float(32). More...
Expr | Halide::fast_exp (const Expr &x)
| Fast approximate cleanly vectorizable exp for Float(32). More...
Expr | Halide::fast_pow (Expr x, Expr y)
| Fast approximate cleanly vectorizable pow for Float(32). More...
Expr | Halide::fast_inverse (Expr x)
| Fast approximate inverse for Float(32). More...
Expr | Halide::fast_inverse_sqrt (Expr x)
| Fast approximate inverse square root for Float(32). More...
Expr | Halide::floor (Expr x)
| Return the greatest whole number less than or equal to a floating-point expression. More...
Expr | Halide::ceil (Expr x)
| Return the least whole number greater than or equal to a floating-point expression. More...
Expr | Halide::round (Expr x)
| Return the whole number closest to a floating-point expression. More...
Expr | Halide::trunc (Expr x)
| Return the integer part of a floating-point expression. More...
Expr | Halide::is_nan (Expr x)
| Returns true if the argument is a Not a Number (NaN). More...
Expr | Halide::is_inf (Expr x)
| Returns true if the argument is Inf or -Inf. More...
Expr | Halide::is_finite (Expr x)
| Returns true if the argument is a finite value (ie, neither NaN nor Inf). More...
Expr | Halide::fract (const Expr &x)
| Return the fractional part of a floating-point expression. More...
Expr | Halide::reinterpret (Type t, Expr e)
| Reinterpret the bits of one value as another type. More...
template<typename T >
Expr | Halide::reinterpret (Expr e)
Expr | Halide::operator& (Expr x, Expr y)
| Return the bitwise and of two expressions (which need not have the same type). More...
Expr | Halide::operator& (Expr x, int y)
| Return the bitwise and of an expression and an integer. More...
Expr | Halide::operator& (int x, Expr y)
Expr | Halide::operator| (Expr x, Expr y)
| Return the bitwise or of two expressions (which need not have the same type). More...
Expr | Halide::operator| (Expr x, int y)
| Return the bitwise or of an expression and an integer. More...
Expr | Halide::operator| (int x, Expr y)
Expr | Halide::operator^ (Expr x, Expr y)
| Return the bitwise xor of two expressions (which need not have the same type). More...
Expr | Halide::operator^ (Expr x, int y)
| Return the bitwise xor of an expression and an integer. More...
Expr | Halide::operator^ (int x, Expr y)
Expr | Halide::operator~ (Expr x)
| Return the bitwise not of an expression. More...
Expr | Halide::operator<< (Expr x, Expr y)
| Shift the bits of an integer value left. More...
Expr | Halide::operator<< (Expr x, int y)
Expr | Halide::operator>> (Expr x, Expr y)
| Shift the bits of an integer value right. More...
Expr | Halide::operator>> (Expr x, int y)
Expr | Halide::lerp (Expr zero_val, Expr one_val, Expr weight)
| Linear interpolate between the two values according to a weight. More...
Expr | Halide::popcount (Expr x)
| Count the number of set bits in an expression. More...
Expr | Halide::count_leading_zeros (Expr x)
| Count the number of leading zero bits in an expression. More...
Expr | Halide::count_trailing_zeros (Expr x)
| Count the number of trailing zero bits in an expression. More...
Expr | Halide::div_round_to_zero (Expr x, Expr y)
| Divide two integers, rounding towards zero. More...
Expr | Halide::mod_round_to_zero (Expr x, Expr y)
| Compute the remainder of dividing two integers, when division is rounding toward zero. More...
Expr | Halide::random_float (Expr seed=Expr())
| Return a random variable representing a uniformly distributed float in the half-open interval [0.0f, 1.0f). More...
Expr | Halide::random_uint (Expr seed=Expr())
| Return a random variable representing a uniformly distributed unsigned 32-bit integer. More...
Expr | Halide::random_int (Expr seed=Expr())
| Return a random variable representing a uniformly distributed 32-bit integer. More...
Expr | Halide::print (const std::vector< Expr > &values)
| Create an Expr that prints out its value whenever it is evaluated. More...
template<typename... Args>
HALIDE_NO_USER_CODE_INLINE Expr | Halide::print (Expr a, Args &&...args)
Expr | Halide::print_when (Expr condition, const std::vector< Expr > &values)
| Create an Expr that prints whenever it is evaluated, provided that the condition is true. More...
template<typename... Args>
HALIDE_NO_USER_CODE_INLINE Expr | Halide::print_when (Expr condition, Expr a, Args &&...args)
Expr | Halide::require (Expr condition, const std::vector< Expr > &values)
| Create an Expr that that guarantees a precondition. More...
template<typename... Args>
HALIDE_NO_USER_CODE_INLINE Expr | Halide::require (Expr condition, Expr value, Args &&...args)
Expr | Halide::undef (Type t)
| Return an undef value of the given type. More...
template<typename T >
Expr | Halide::undef ()
Expr | Halide::Internal::unreachable (Type t=Int(32))
| Return an expression that should never be evaluated. More...
template<typename T >
Expr | Halide::Internal::unreachable ()
template<typename... Args>
HALIDE_NO_USER_CODE_INLINE Expr | Halide::memoize_tag (Expr result, Args &&...args)
| Control the values used in the memoization cache key for memoize. More...
Expr | Halide::likely (Expr e)
| Expressions tagged with this intrinsic are considered to be part of the steady state of some loop with a nasty beginning and end (e.g. More...
Expr | Halide::likely_if_innermost (Expr e)
| Equivalent to likely, but only triggers a loop partitioning if found in an innermost loop. More...
template<typename T >
Expr | Halide::saturating_cast (Expr e)
| Cast an expression to the halide type corresponding to the C++ type T. More...
Expr | Halide::saturating_cast (Type t, Expr e)
| Cast an expression to a new type, clamping to the minimum and maximum values of the result type. More...
Expr | Halide::strict_float (const Expr &e)
| Makes a best effort attempt to preserve IEEE floating-point semantics in evaluating an expression. More...
Expr | Halide::unsafe_promise_clamped (const Expr &value, const Expr &min, const Expr &max)
| Create an Expr that that promises another Expr is clamped but do not generate code to check the assertion or modify the value. More...
Expr | Halide::Internal::promise_clamped (const Expr &value, const Expr &min, const Expr &max)
| FOR INTERNAL USE ONLY. More...
Expr | Halide::scatter (const std::vector< Expr > &args)
| Scatter and gather are used for update definition which must store multiple values to distinct locations at the same time. More...
Expr | Halide::gather (const std::vector< Expr > &args)
template<typename... Args>
Expr | Halide::scatter (const Expr &e, Args &&...args)
template<typename... Args>
Expr | Halide::gather (const Expr &e, Args &&...args)
Expr | Halide::extract_bits (Type t, const Expr &e, const Expr &lsb)
| Extract a contiguous subsequence of the bits of 'e', starting at the bit index given by 'lsb', where zero is the least-significant bit, returning a value of type 't'. More...
template<typename T >
Expr | Halide::extract_bits (const Expr &e, const Expr &lsb)
Expr | Halide::concat_bits (const std::vector< Expr > &e)
| Given a number of Exprs of the same type, concatenate their bits producing a single Expr of the same type code of the input but with more bits. More...
Expr | Halide::widen_right_add (Expr a, Expr b)
| Below is a collection of intrinsics for fixed-point programming. More...
Expr | Halide::widen_right_mul (Expr a, Expr b)
| Compute a * widen(b). More...
Expr | Halide::widen_right_sub (Expr a, Expr b)
| Compute a - widen(b). More...
Expr | Halide::widening_add (Expr a, Expr b)
| Compute widen(a) + widen(b). More...
Expr | Halide::widening_mul (Expr a, Expr b)
| Compute widen(a) * widen(b). More...
Expr | Halide::widening_sub (Expr a, Expr b)
| Compute widen(a) - widen(b). More...
Expr | Halide::widening_shift_left (Expr a, Expr b)
| Compute widen(a) << b. More...
Expr | Halide::widening_shift_left (Expr a, int b)
Expr | Halide::widening_shift_right (Expr a, Expr b)
| Compute widen(a) >> b. More...
Expr | Halide::widening_shift_right (Expr a, int b)
Expr | Halide::rounding_shift_left (Expr a, Expr b)
| Compute saturating_narrow(widening_add(a, (1 >> min(b, 0)) / 2) << b). More...
Expr | Halide::rounding_shift_left (Expr a, int b)
Expr | Halide::rounding_shift_right (Expr a, Expr b)
| Compute saturating_narrow(widening_add(a, (1 << max(b, 0)) / 2) >> b). More...
Expr | Halide::rounding_shift_right (Expr a, int b)
Expr | Halide::saturating_add (Expr a, Expr b)
| Compute saturating_narrow(widen(a) + widen(b)) More...
Expr | Halide::saturating_sub (Expr a, Expr b)
| Compute saturating_narrow(widen(a) - widen(b)) More...
Expr | Halide::halving_add (Expr a, Expr b)
| Compute narrow((widen(a) + widen(b)) / 2) More...
Expr | Halide::rounding_halving_add (Expr a, Expr b)
| Compute narrow((widen(a) + widen(b) + 1) / 2) More...
Expr | Halide::halving_sub (Expr a, Expr b)
| Compute narrow((widen(a) - widen(b)) / 2) More...
Expr | Halide::mul_shift_right (Expr a, Expr b, Expr q)
| Compute saturating_narrow(shift_right(widening_mul(a, b), q)) More...
Expr | Halide::mul_shift_right (Expr a, Expr b, int q)
Expr | Halide::rounding_mul_shift_right (Expr a, Expr b, Expr q)
| Compute saturating_narrow(rounding_shift_right(widening_mul(a, b), q)) More...
Expr | Halide::rounding_mul_shift_right (Expr a, Expr b, int q)
Expr | Halide::target_arch_is (Target::Arch arch)
| Return a boolean Expr for the corresponding field of the Target being used during lowering; they can be useful in writing library code without having to plumb a Target through call sites, so that you can do things like. More...
Expr | Halide::target_os_is (Target::OS os)
Expr | Halide::target_has_feature (Target::Feature feat)
Expr | Halide::target_bits ()
| Return the bit width of the Target used during lowering; this can be useful in writing library code without having to plumb a Target through call sites, so that you can do things like. More...
Expr | Halide::target_natural_vector_size (Type t)
| Return the natural vector width for the given Type for the Target being used during lowering; this can be useful in writing library code without having to plumb a Target through call sites, so that you can do things like. More...
template<typename data_t >
Expr | Halide::target_natural_vector_size ()

## Variables
template<typename... Args>
constexpr bool | Halide::Internal::all_are_printable_args_v = all_are_printable_args<Args...>::value

## Detailed Description

Defines various operator overloads and utility functions that make it more pleasant to work with Halide expressions.

Definition in file IROperator.h.