Halide
Halide::Internal::AssociativePattern Struct Reference

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

#include <AssociativeOpsTable.h>

Public Member Functions

 AssociativePattern ()
 
 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< Exprops
 Contain the binary operators for each dimension of the associative op. More...
 
std::vector< Expridentities
 Contain the identities for each dimension of the associative op. More...
 
bool is_commutative
 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:

{x0 * y0 - x1 * y1, x1 * y0 + x0 * y1},
{one, zero},
true
);

Definition at line 32 of file AssociativeOpsTable.h.

Constructor & Destructor Documentation

◆ AssociativePattern() [1/4]

Halide::Internal::AssociativePattern::AssociativePattern ( )
inline

Definition at line 40 of file AssociativeOpsTable.h.

◆ AssociativePattern() [2/4]

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

Definition at line 43 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 46 of file AssociativeOpsTable.h.

◆ AssociativePattern() [4/4]

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

Definition at line 49 of file AssociativeOpsTable.h.

Member Function Documentation

◆ operator==()

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

Definition at line 53 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 64 of file AssociativeOpsTable.h.

◆ size()

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

Definition at line 67 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 70 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 34 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 36 of file AssociativeOpsTable.h.

Referenced by operator==().

◆ is_commutative

bool Halide::Internal::AssociativePattern::is_commutative

Indicate if the associative op is also commutative.

Definition at line 38 of file AssociativeOpsTable.h.

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


The documentation for this struct was generated from the following file:
Halide::Internal::AssociativePattern::AssociativePattern
AssociativePattern()
Definition: AssociativeOpsTable.h:40