Halide 22.0.0 Halide compiler and libraries

Public Member Functions | Public Attributes | List of all members
Halide::Internal::AssociativePattern Struct Reference

Represent an associative op with its identity. More...

`#include <AssociativeOpsTable.h>`

## Public Member Functions
| AssociativePattern ()=default
| AssociativePattern (size_t size)
| AssociativePattern (const std::vector< Expr > &ops, const std::vector< Expr > &ids, bool is_commutative)
| AssociativePattern (Expr op, Expr id, bool is_commutative)
bool | operator== (const AssociativePattern &other) const
bool | operator!= (const AssociativePattern &other) const
size_t | size () const
bool | commutative () const

## Public Attributes
std::vector< Expr > | ops
| Contain the binary operators for each dimension of the associative op. More...
std::vector< Expr > | identities
| Contain the identities for each dimension of the associative op. More...
bool | is_commutative = false
| Indicate if the associative op is also commutative. More...

## Detailed Description

Represent an associative op with its identity.

The op may be multi-dimensional, e.g. complex multiplication. 'is_commutative' is set to true if the op is also commutative in addition to being associative.

For example, complex multiplication is represented as:

AssociativePattern pattern(
{x0 * y0 - x1 * y1, x1 * y0 + x0 * y1},
{one, zero},
true
);
Halide::Internal::AssociativePattern::AssociativePattern
AssociativePattern()=default

Definition at line 31 of file AssociativeOpsTable.h.

## Constructor & Destructor Documentation

## ◆ AssociativePattern() [1/4]

Halide::Internal::AssociativePattern::AssociativePattern | ( |  | ) |
| default

## ◆ AssociativePattern() [2/4]

Halide::Internal::AssociativePattern::AssociativePattern | ( | size_t | size | ) |
| inline

Definition at line 40 of file AssociativeOpsTable.h.

## ◆ AssociativePattern() [3/4]

Halide::Internal::AssociativePattern::AssociativePattern | ( | const std::vector< Expr > & | ops,
|  | const std::vector< Expr > & | ids,
|  | bool | is_commutative
| ) |  |
| inline

Definition at line 43 of file AssociativeOpsTable.h.

## ◆ AssociativePattern() [4/4]

Halide::Internal::AssociativePattern::AssociativePattern | ( | Expr | op,
|  | Expr | id,
|  | bool | is_commutative
| ) |  |
| inline

Definition at line 46 of file AssociativeOpsTable.h.

## Member Function Documentation

## ◆ operator==()

bool Halide::Internal::AssociativePattern::operator== | ( | const AssociativePattern & | other | ) | const
| inline

Definition at line 50 of file AssociativeOpsTable.h.

References Halide::Internal::equal(), identities, is_commutative, ops, and size().

## ◆ operator!=()

bool Halide::Internal::AssociativePattern::operator!= | ( | const AssociativePattern & | other | ) | const
| inline

Definition at line 61 of file AssociativeOpsTable.h.

## ◆ size()

size_t Halide::Internal::AssociativePattern::size | ( |  | ) | const
| inline

Definition at line 64 of file AssociativeOpsTable.h.

References ops.

Referenced by operator==(), and Halide::Internal::AssociativeOp::size().

## ◆ commutative()

bool Halide::Internal::AssociativePattern::commutative | ( |  | ) | const
| inline

Definition at line 67 of file AssociativeOpsTable.h.

References is_commutative.

## Member Data Documentation

## ◆ ops

std::vector<Expr> Halide::Internal::AssociativePattern::ops

Contain the binary operators for each dimension of the associative op.

Definition at line 33 of file AssociativeOpsTable.h.

Referenced by operator==(), and size().

## ◆ identities

std::vector<Expr> Halide::Internal::AssociativePattern::identities

Contain the identities for each dimension of the associative op.

Definition at line 35 of file AssociativeOpsTable.h.

Referenced by operator==().

## ◆ is_commutative

bool Halide::Internal::AssociativePattern::is_commutative = false

Indicate if the associative op is also commutative.

Definition at line 37 of file AssociativeOpsTable.h.

Referenced by commutative(), Halide::Internal::AssociativeOp::commutative(), and operator==().

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

- src/AssociativeOpsTable.h