Halide
Halide::Internal::Shuffle Struct Reference

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

#include <IR.h>

Inherits Halide::Internal::ExprNode< Shuffle >.

Public Member Functions

bool is_interleave () const
 Check if this shuffle is an interleaving of the vector arguments. More...
 
bool is_concat () const
 Check if this shuffle is a concatenation of the vector arguments. More...
 
bool is_extract_element () const
 Check if this shuffle is extracting a scalar from the vector arguments. More...
 
bool 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. More...
 
int slice_begin () const
 Check if this shuffle is a contiguous strict subset of the vector arguments, and if so, the offset and stride of the slice. More...
 
int slice_stride () const
 Check if this shuffle is a contiguous strict subset of the vector arguments, and if so, the offset and stride of the slice. More...
 
- 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. More...
 
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. More...
 
static Expr make_concat (const std::vector< Expr > &vectors)
 Convenience constructor for making a shuffle representing a concatenation of the vectors. More...
 
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. More...
 
static Expr make_extract_element (Expr vector, int i)
 Convenience constructor for making a shuffle representing extracting a single element. More...
 

Public Attributes

std::vector< Exprvectors
 
std::vector< int > indices
 Indices indicating which vector element to place into the result. More...
 
- 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. More...
 
IRNodeType node_type
 Each IR node subclass has a unique identifier. More...
 

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 729 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_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.

◆ 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_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.

◆ 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 769 of file IR.h.

References indices.

◆ 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 772 of file IR.h.

References indices.

◆ is_extract_element()

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

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

Member Data Documentation

◆ vectors

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

Definition at line 730 of file IR.h.

◆ 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 argumentss.

Definition at line 735 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 781 of file IR.h.


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