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

A fragment of Halide syntax. More...

#include <Expr.h>

Inheritance diagram for Halide::Expr:
Halide::Internal::IRHandle Halide::Internal::IntrusivePtr< const IRNode >

Public Member Functions

HALIDE_ALWAYS_INLINE Expr ()=default
 Make an undefined expression.
 
HALIDE_ALWAYS_INLINE Expr (const Internal::BaseExprNode *n)
 Make an expression from a concrete expression node pointer (e.g.
 
 Expr (int8_t x)
 Make an expression representing numeric constants of various types.
 
 Expr (int16_t x)
 
 Expr (int32_t x)
 
 Expr (int64_t x)
 
 Expr (uint8_t x)
 
 Expr (uint16_t x)
 
 Expr (uint32_t x)
 
 Expr (uint64_t x)
 
 Expr (float16_t x)
 
 Expr (bfloat16_t x)
 
 Expr (float x)
 
 Expr (double x)
 
 Expr (const std::string &s)
 Make an expression representing a const string (i.e.
 
HALIDE_ALWAYS_INLINE const Internal::BaseExprNodeget () const
 Override get() to return a BaseExprNode * instead of an IRNode *.
 
HALIDE_ALWAYS_INLINE Type type () const
 Get the type of this expression node.
 
- Public Member Functions inherited from Halide::Internal::IRHandle
HALIDE_ALWAYS_INLINE IRHandle ()=default
 
HALIDE_ALWAYS_INLINE IRHandle (const IRNode *p)
 
void accept (IRVisitor *v) const
 Dispatch to the correct visitor method for this node.
 
template<typename T >
const T * as () const
 Downcast this ir node to its actual type (e.g.
 
IRNodeType node_type () const
 
- Public Member Functions inherited from Halide::Internal::IntrusivePtr< const IRNode >
const IRNodeget () const
 Access the raw pointer in a variety of ways.
 
const IRNodeoperator* () const
 
const IRNodeoperator-> () const
 
 ~IntrusivePtr ()
 
HALIDE_ALWAYS_INLINE IntrusivePtr ()=default
 
HALIDE_ALWAYS_INLINE IntrusivePtr (const IRNode *p)
 
HALIDE_ALWAYS_INLINE IntrusivePtr (const IntrusivePtr< const IRNode > &other) noexcept
 
HALIDE_ALWAYS_INLINE IntrusivePtr (IntrusivePtr< const IRNode > &&other) noexcept
 
IntrusivePtr< const IRNode > & operator= (const IntrusivePtr< const IRNode > &other)
 
IntrusivePtr< const IRNode > & operator= (IntrusivePtr< const IRNode > &&other) noexcept
 
HALIDE_ALWAYS_INLINE bool defined () const
 
HALIDE_ALWAYS_INLINE bool same_as (const IntrusivePtr &other) const
 
HALIDE_ALWAYS_INLINE bool operator< (const IntrusivePtr< const IRNode > &other) const
 
HALIDE_ALWAYS_INLINE bool is_sole_reference () const
 

Additional Inherited Members

- Protected Attributes inherited from Halide::Internal::IntrusivePtr< const IRNode >
const IRNodeptr
 

Detailed Description

A fragment of Halide syntax.

It's implemented as reference-counted handle to a concrete expression node, but it's immutable, so you can treat it as a value type.

Examples
tutorial/lesson_01_basics.cpp, tutorial/lesson_02_input_image.cpp, tutorial/lesson_04_debugging_2.cpp, tutorial/lesson_07_multi_stage_pipelines.cpp, tutorial/lesson_09_update_definitions.cpp, tutorial/lesson_13_tuples.cpp, and tutorial/lesson_14_types.cpp.

Definition at line 258 of file Expr.h.

Constructor & Destructor Documentation

◆ Expr() [1/15]

HALIDE_ALWAYS_INLINE Halide::Expr::Expr ( )
default

Make an undefined expression.

◆ Expr() [2/15]

HALIDE_ALWAYS_INLINE Halide::Expr::Expr ( const Internal::BaseExprNode * n)
inline

Make an expression from a concrete expression node pointer (e.g.

Add)

Definition at line 265 of file Expr.h.

◆ Expr() [3/15]

Halide::Expr::Expr ( int8_t x)
inlineexplicit

Make an expression representing numeric constants of various types.

Definition at line 271 of file Expr.h.

References Halide::Internal.

◆ Expr() [4/15]

Halide::Expr::Expr ( int16_t x)
inlineexplicit

Definition at line 274 of file Expr.h.

References Halide::Internal.

◆ Expr() [5/15]

Halide::Expr::Expr ( int32_t x)
inline

Definition at line 277 of file Expr.h.

References Halide::Internal.

◆ Expr() [6/15]

Halide::Expr::Expr ( int64_t x)
inlineexplicit

Definition at line 280 of file Expr.h.

References Halide::Internal.

◆ Expr() [7/15]

Halide::Expr::Expr ( uint8_t x)
inlineexplicit

Definition at line 283 of file Expr.h.

References Halide::Internal.

◆ Expr() [8/15]

Halide::Expr::Expr ( uint16_t x)
inlineexplicit

Definition at line 286 of file Expr.h.

References Halide::Internal.

◆ Expr() [9/15]

Halide::Expr::Expr ( uint32_t x)
inlineexplicit

Definition at line 289 of file Expr.h.

References Halide::Internal.

◆ Expr() [10/15]

Halide::Expr::Expr ( uint64_t x)
inlineexplicit

Definition at line 292 of file Expr.h.

References Halide::Internal.

◆ Expr() [11/15]

Halide::Expr::Expr ( float16_t x)
inline

Definition at line 295 of file Expr.h.

References Halide::Internal.

◆ Expr() [12/15]

Halide::Expr::Expr ( bfloat16_t x)
inline

Definition at line 298 of file Expr.h.

References Halide::Internal.

◆ Expr() [13/15]

Halide::Expr::Expr ( float x)
inline

Definition at line 306 of file Expr.h.

References Halide::Internal.

◆ Expr() [14/15]

Halide::Expr::Expr ( double x)
inlineexplicit

Definition at line 309 of file Expr.h.

References Halide::Internal.

◆ Expr() [15/15]

Halide::Expr::Expr ( const std::string & s)
inline

Make an expression representing a const string (i.e.

a StringImm)

Definition at line 315 of file Expr.h.

References Halide::Internal.

Member Function Documentation

◆ get()

◆ type()

HALIDE_ALWAYS_INLINE Type Halide::Expr::type ( ) const
inline

Get the type of this expression node.

Examples
tutorial/lesson_14_types.cpp.

Definition at line 327 of file Expr.h.

References get(), and Halide::Internal::BaseExprNode::type.

Referenced by Halide::ConciseCasts::bf16(), Halide::Internal::equal(), Halide::evaluate(), Halide::evaluate_may_gpu(), Halide::ConciseCasts::f16(), Halide::ConciseCasts::f32(), Halide::ConciseCasts::f64(), Halide::ConciseCasts::i16(), Halide::ConciseCasts::i16_sat(), Halide::ConciseCasts::i32(), Halide::ConciseCasts::i32_sat(), Halide::ConciseCasts::i64(), Halide::ConciseCasts::i64_sat(), Halide::ConciseCasts::i8(), Halide::ConciseCasts::i8_sat(), Halide::Internal::HexagonAlignmentAnalyzer::is_aligned(), Halide::Internal::HexagonAlignmentAnalyzer::is_aligned_impl(), Halide::Internal::Cast::is_reinterpret(), Halide::Internal::IRMatcher::BinOp< Op, A, B >::make(), Halide::Internal::IRMatcher::CmpOp< Op, A, B >::make(), Halide::Internal::IRMatcher::NegateOp< A >::make(), Halide::Internal::IRMatcher::RampOp< A, B, C >::make(), Halide::Internal::IRMatcher::WidenOp< A >::make(), Halide::Internal::IRMatcher::CanProve< A, Prover >::make_folded_const(), Halide::Internal::IRMatcher::WidenOp< A >::match(), Halide::Internal::GeneratorInput_DynamicScalar< T >::type(), Halide::Internal::GeneratorInput_Scalar< T >::type(), Halide::ConciseCasts::u16(), Halide::ConciseCasts::u16_sat(), Halide::ConciseCasts::u32(), Halide::ConciseCasts::u32_sat(), Halide::ConciseCasts::u64(), Halide::ConciseCasts::u64_sat(), Halide::ConciseCasts::u8(), and Halide::ConciseCasts::u8_sat().


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