Halide 22.0.0 Halide compiler and libraries

Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Halide::Internal::IRMatcher::BinOp< Op, A, B > Struct Template Reference

`#include <IRMatch.h>`

## Classes
struct | pattern_tag

## Public Member Functions
template<uint32_t bound>
HALIDE_ALWAYS_INLINE bool | match (const BaseExprNode &e, MatcherState &state) const noexcept
template<uint32_t bound, typename Op2 , typename A2 , typename B2 >
HALIDE_ALWAYS_INLINE bool | match (const BinOp< Op2, A2, B2 > &op, MatcherState &state) const noexcept
HALIDE_ALWAYS_INLINE void | make_folded_const (halide_scalar_value_t &val, halide_type_t &ty, MatcherState &state) const noexcept
HALIDE_ALWAYS_INLINE Expr | make (MatcherState &state, halide_type_t type_hint) const noexcept

## Public Attributes
A | a
B | b

## Static Public Attributes
static constexpr uint32_t | binds = bindings<A>::mask | bindings<B>::mask
static constexpr IRNodeType | min_node_type = Op::_node_type
static constexpr IRNodeType | max_node_type = Op::_node_type
static constexpr bool | canonical
static constexpr bool | foldable = A::foldable && B::foldable

## Detailed Description

template<typename Op, typename A, typename B>
struct Halide::Internal::IRMatcher::BinOp< Op, A, B >

Definition at line 628 of file IRMatch.h.

## Member Function Documentation

## ◆ match() [1/2]

template<typename Op , typename A , typename B >
template<uint32_t bound>

HALIDE_ALWAYS_INLINE bool Halide::Internal::IRMatcher::BinOp< Op, A, B >::match | ( | const BaseExprNode & | e,
|  | MatcherState & | state
| ) |  | const
| inline noexcept

Definition at line 645 of file IRMatch.h.

References Halide::Internal::IRMatcher::BinOp< Op, A, B >::a, Halide::Internal::IRMatcher::BinOp< Op, A, B >::b, and Halide::Internal::IRMatcher::BinOp< Op, A, B >::match().

Referenced by Halide::Internal::IRMatcher::BinOp< Op, A, B >::match().

## ◆ match() [2/2]

template<typename Op , typename A , typename B >
template<uint32_t bound, typename Op2 , typename A2 , typename B2 >

HALIDE_ALWAYS_INLINE bool Halide::Internal::IRMatcher::BinOp< Op, A, B >::match | ( | const BinOp< Op2, A2, B2 > & | op,
|  | MatcherState & | state
| ) |  | const
| inline noexcept

Definition at line 655 of file IRMatch.h.

References Halide::Internal::IRMatcher::BinOp< Op, A, B >::a, Halide::Internal::IRMatcher::BinOp< Op, A, B >::b, Halide::Internal::IRMatcher::BinOp< Op, A, B >::match(), and Halide::Internal::IRMatcher::unwrap().

## ◆ make_folded_const()

template<typename Op , typename A , typename B >

HALIDE_ALWAYS_INLINE void Halide::Internal::IRMatcher::BinOp< Op, A, B >::make_folded_const | ( | halide_scalar_value_t & | val,
|  | halide_type_t & | ty,
|  | MatcherState & | state
| ) |  | const
| inline noexcept

Definition at line 664 of file IRMatch.h.

References Halide::Internal::IRMatcher::BinOp< Op, A, B >::a, Halide::Internal::IRMatcher::BinOp< Op, A, B >::b, halide_scalar_value_t::f64, halide_type_bfloat, halide_type_float, halide_type_int, halide_type_uint, halide_scalar_value_t::i64, halide_scalar_value_t::u, and halide_scalar_value_t::u64.

## ◆ make()

template<typename Op , typename A , typename B >

HALIDE_ALWAYS_INLINE Expr Halide::Internal::IRMatcher::BinOp< Op, A, B >::make | ( | MatcherState & | state,
|  | halide_type_t | type_hint
| ) |  | const
| inline noexcept

Definition at line 707 of file IRMatch.h.

References Halide::Internal::IRMatcher::BinOp< Op, A, B >::a, Halide::Internal::IRMatcher::BinOp< Op, A, B >::b, and Halide::Expr::type().

## Member Data Documentation

## ◆ a

template<typename Op , typename A , typename B >

A Halide::Internal::IRMatcher::BinOp< Op, A, B >::a

Definition at line 630 of file IRMatch.h.

Referenced by Halide::Internal::IRMatcher::BinOp< Op, A, B >::make(), Halide::Internal::IRMatcher::BinOp< Op, A, B >::make_folded_const(), Halide::Internal::IRMatcher::BinOp< Op, A, B >::match(), and Halide::Internal::IRMatcher::operator<<().

## ◆ b

template<typename Op , typename A , typename B >

B Halide::Internal::IRMatcher::BinOp< Op, A, B >::b

Definition at line 631 of file IRMatch.h.

Referenced by Halide::Internal::IRMatcher::BinOp< Op, A, B >::make(), Halide::Internal::IRMatcher::BinOp< Op, A, B >::make_folded_const(), Halide::Internal::IRMatcher::BinOp< Op, A, B >::match(), and Halide::Internal::IRMatcher::operator<<().

## ◆ binds

template<typename Op , typename A , typename B >

constexpr uint32_t Halide::Internal::IRMatcher::BinOp< Op, A, B >::binds = bindings<A>::mask | bindings<B>::mask
| static constexpr

Definition at line 633 of file IRMatch.h.

## ◆ min_node_type

template<typename Op , typename A , typename B >

constexpr IRNodeType Halide::Internal::IRMatcher::BinOp< Op, A, B >::min_node_type = Op::_node_type
| static constexpr

Definition at line 635 of file IRMatch.h.

## ◆ max_node_type

template<typename Op , typename A , typename B >

constexpr IRNodeType Halide::Internal::IRMatcher::BinOp< Op, A, B >::max_node_type = Op::_node_type
| static constexpr

Definition at line 636 of file IRMatch.h.

## ◆ canonical

template<typename Op , typename A , typename B >

constexpr bool Halide::Internal::IRMatcher::BinOp< Op, A, B >::canonical
| static constexpr

Initial value:
=
A::canonical && B::canonical && (!commutative(Op::_node_type) || (A::max_node_type >= B::min_node_type))
Halide::Internal::IRMatcher::commutative
constexpr bool commutative(IRNodeType t)
Definition: IRMatch.h:615

Definition at line 641 of file IRMatch.h.

## ◆ foldable

template<typename Op , typename A , typename B >

constexpr bool Halide::Internal::IRMatcher::BinOp< Op, A, B >::foldable = A::foldable && B::foldable
| static constexpr

Definition at line 661 of file IRMatch.h.

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

- src/IRMatch.h