Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Halide::Internal::Shuffle Struct Reference

Construct a new vector by taking elements from another sequence of vectors. More...

`#include <IR.h>`

Inheritance diagram for Halide::Internal::Shuffle:

## Public Member Functions
bool | is_interleave () const
| Check if this shuffle is an interleaving of the vector arguments.
bool | is_broadcast () const
| Check if this shuffle can be represented as a repeating pattern that repeats the same shuffle of the single input vector some number of times.
int | broadcast_factor () const
bool | is_concat () const
| Check if this shuffle is a concatenation of the vector arguments.
bool | is_extract_element () const
| Check if this shuffle is extracting a scalar from the vector arguments.
std::vector< std::pair< int, int > > | vector_and_lane_indices () const
| Returns the sequence of vector and lane indices that represent each entry to be used for the shuffled vector.
Public Member Functions inherited from Halide::Internal::ExprNode< Shuffle >
void | accept (IRVisitor *v) const override
| We use the visitor pattern to traverse IR nodes throughout the compiler, so we have a virtual accept method which accepts visitors.
Expr | mutate_expr (IRMutator *v) const override
| ExprNode ()
| ~ExprNode () override=default
Public Member Functions inherited from Halide::Internal::BaseExprNode
| BaseExprNode (IRNodeType t)
Public Member Functions inherited from Halide::Internal::IRNode
| IRNode (IRNodeType t)
virtual | ~IRNode ()=default

## Static Public Member Functions
static Expr | make (const std::vector< Expr > &vectors, const std::vector< int > &indices)
static Expr | make_interleave (const std::vector< Expr > &vectors)
| Convenience constructor for making a shuffle representing an interleaving of vectors of the same length.
static Expr | make_concat (const std::vector< Expr > &vectors)
| Convenience constructor for making a shuffle representing a concatenation of the vectors.
static Expr | make_broadcast (Expr vector, int factor)
| Convenience constructor for making a shuffle representing a broadcast of a vector.
static Expr | make_slice (Expr vector, int begin, int stride, int size)
| Convenience constructor for making a shuffle representing a contiguous subset of a vector.
static Expr | make_extract_element (Expr vector, int i)
| Convenience constructor for making a shuffle representing extracting a single element.

## Public Attributes
std::vector< Expr > | vectors
std::vector< int > | indices
| Indices indicating which vector element to place into the result.
Public Attributes inherited from Halide::Internal::BaseExprNode
Type | type
Public Attributes inherited from Halide::Internal::IRNode
RefCount | ref_count
| These classes are all managed with intrusive reference counting, so we also track a reference count.
IRNodeType | node_type
| Each IR node subclass has a unique identifier.

## Static Public Attributes
static const IRNodeType | _node_type = IRNodeType::Shuffle

## Detailed Description

Construct a new vector by taking elements from another sequence of vectors.

Definition at line 884 of file IR.h.

## Member Function Documentation

## ◆ make()

static Expr Halide::Internal::Shuffle::make | ( | const std::vector< Expr > & | vectors,
|  | const std::vector< int > & | indices
| ) |  |
| static

## ◆ make_interleave()

static Expr Halide::Internal::Shuffle::make_interleave | ( | const std::vector< Expr > & | vectors | ) |
| static

Convenience constructor for making a shuffle representing an interleaving of vectors of the same length.

## ◆ make_concat()

static Expr Halide::Internal::Shuffle::make_concat | ( | const std::vector< Expr > & | vectors | ) |
| static

Convenience constructor for making a shuffle representing a concatenation of the vectors.

## ◆ make_broadcast()

static Expr Halide::Internal::Shuffle::make_broadcast | ( | Expr | vector,
|  | int | factor
| ) |  |
| static

Convenience constructor for making a shuffle representing a broadcast of a vector.

## ◆ make_slice()

static Expr Halide::Internal::Shuffle::make_slice | ( | Expr | vector,
|  | int | begin,
|  | int | stride,
|  | int | size
| ) |  |
| static

Convenience constructor for making a shuffle representing a contiguous subset of a vector.

Referenced by Halide::Internal::IRMatcher::SliceOp< Vec, Base, Stride, Lanes >::make().

## ◆ make_extract_element()

static Expr Halide::Internal::Shuffle::make_extract_element | ( | Expr | vector,
|  | int | i
| ) |  |
| static

Convenience constructor for making a shuffle representing extracting a single element.

## ◆ is_interleave()

bool Halide::Internal::Shuffle::is_interleave | ( |  | ) | const

Check if this shuffle is an interleaving of the vector arguments.

## ◆ is_broadcast()

bool Halide::Internal::Shuffle::is_broadcast | ( |  | ) | const

Check if this shuffle can be represented as a repeating pattern that repeats the same shuffle of the single input vector some number of times.

For example: 0, 3, 1, 1, 0, 3, 1, 1, ....., 0, 3, 1, 1

## ◆ broadcast_factor()

int Halide::Internal::Shuffle::broadcast_factor | ( |  | ) | const

## ◆ is_concat()

bool Halide::Internal::Shuffle::is_concat | ( |  | ) | const

Check if this shuffle is a concatenation of the vector arguments.

## ◆ is_slice()

bool Halide::Internal::Shuffle::is_slice | ( |  | ) | const

Check if this shuffle is a contiguous strict subset of the vector arguments, and if so, the offset and stride of the slice.

Referenced by Halide::Internal::IRMatcher::SliceOp< Vec, Base, Stride, Lanes >::match().

## ◆ slice_begin()

int Halide::Internal::Shuffle::slice_begin | ( |  | ) | const
| inline

Check if this shuffle is a contiguous strict subset of the vector arguments, and if so, the offset and stride of the slice.

Definition at line 935 of file IR.h.

References indices.

Referenced by Halide::Internal::IRMatcher::SliceOp< Vec, Base, Stride, Lanes >::match().

## ◆ slice_stride()

int Halide::Internal::Shuffle::slice_stride | ( |  | ) | const
| inline

Check if this shuffle is a contiguous strict subset of the vector arguments, and if so, the offset and stride of the slice.

Definition at line 938 of file IR.h.

References indices.

Referenced by Halide::Internal::IRMatcher::SliceOp< Vec, Base, Stride, Lanes >::match().

## ◆ is_extract_element()

bool Halide::Internal::Shuffle::is_extract_element | ( |  | ) | const

Check if this shuffle is extracting a scalar from the vector arguments.

## ◆ vector_and_lane_indices()

std::vector< std::pair< int, int > > Halide::Internal::Shuffle::vector_and_lane_indices | ( |  | ) | const

Returns the sequence of vector and lane indices that represent each entry to be used for the shuffled vector.

## Member Data Documentation

## ◆ vectors

std::vector<Expr> Halide::Internal::Shuffle::vectors

Definition at line 885 of file IR.h.

Referenced by Halide::Internal::IRMatcher::SliceOp< Vec, Base, Stride, Lanes >::match().

## ◆ indices

std::vector<int> Halide::Internal::Shuffle::indices

Indices indicating which vector element to place into the result.

The elements are numbered by their position in the concatenation of the vector arguments.

Definition at line 890 of file IR.h.

Referenced by slice_begin(), and slice_stride().

## ◆ _node_type

const IRNodeType Halide::Internal::Shuffle::_node_type = IRNodeType::Shuffle
| static

Definition at line 951 of file IR.h.

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

- src/IR.h