Loading...
Searching...
No Matches
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.
std::vector< Expr > | identities
| Contain the identities for each dimension of the associative op.
bool | is_commutative = false
| Indicate if the associative op is also commutative.

## 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

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

## AssociativePattern() [2/4]

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

inline

Definition at line 40 of file AssociativeOpsTable.h.

References identities, ops, and size().

## 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.

References identities, is_commutative, and ops.

## AssociativePattern() [4/4]

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

inline

Definition at line 46 of file AssociativeOpsTable.h.

References is_commutative, and ops.

## Member Function Documentation

## operator==()

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

inline

Definition at line 50 of file AssociativeOpsTable.h.

References AssociativePattern(), 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.

References AssociativePattern().

## size()

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

inline

Definition at line 64 of file AssociativeOpsTable.h.

References ops.

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

## 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 AssociativePattern(), AssociativePattern(), AssociativePattern(), 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 AssociativePattern(), AssociativePattern(), and 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 AssociativePattern(), AssociativePattern(), commutative(), and operator==().

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

- src/AssociativeOpsTable.h