Managed reference to LayoutNode.
More...
#include <data_layout.h>
|
| | Layout (const ffi::Array< tirx::IterVar > &axes) |
| |
| | Layout (const tvm::ffi::String &name) |
| | construct from a string More...
|
| |
| | Layout (const char *name) |
| | construct from a string More...
|
| |
| | Layout (const std::string &name, DataType dtype=DataType::Int(32)) |
| | construct from a string. More...
|
| |
| LayoutNode * | operator-> () |
| | access the internal node container More...
|
| |
| Layout | SubLayout (size_t pos, size_t len) const |
| | Returns a sub-layout which is the portion of the object that starts at dimension pos and spans len dimensions (or until the end of the layout, whichever comes first). More...
|
| |
| Layout | Split (const LayoutAxis &axis, size_t target_pos, int32_t factor) const |
| | Split axis by size and put the sub-axis to position target_pos. More...
|
| |
| size_t | ndim () const |
| |
| size_t | ndim_primal () const |
| |
| Layout | ExpandPrimal (const Layout &dst_layout) |
| | Returns a new layout where the dims have been expanded to match the primal dimensions. More...
|
| |
| int32_t | IndexOf (const std::string &axis) const |
| | return the index of the input axis. If it is not found in the layout or the layout is undefined, return -1. More...
|
| |
| int32_t | IndexOf (const LayoutAxis &axis) const |
| | return the index of the input axis. If it is not found in the layout or the layout is undefined, return -1. More...
|
| |
| int32_t | IndexOf (const tirx::IterVar &iter) const |
| | return the index of the input axis. If it is not found in the layout or the layout is undefined, return -1. More...
|
| |
| int32_t | FactorOf (const LayoutAxis &axis) const |
| | Get the factor size of the subordinate axis. More...
|
| |
| bool | Contains (const LayoutAxis &axis) const |
| | Whether the layout contains an axis. More...
|
| |
| const LayoutAxis & | operator[] (int32_t i) const |
| |
| IterVar | PackedAxisAt (int32_t i) const |
| |
| std::string | name () const |
| |
| bool | Equals (const Layout &rhs) const |
| | Whether the two layouts are equal. More...
|
| |
| | TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (Layout, ObjectRef, LayoutNode) |
| |
Managed reference to LayoutNode.
- See also
- LayoutNode
◆ Layout() [1/4]
| tvm::tirx::Layout::Layout |
( |
const ffi::Array< tirx::IterVar > & |
axes | ) |
|
|
explicit |
◆ Layout() [2/4]
| tvm::tirx::Layout::Layout |
( |
const tvm::ffi::String & |
name | ) |
|
|
inline |
◆ Layout() [3/4]
| tvm::tirx::Layout::Layout |
( |
const char * |
name | ) |
|
|
inline |
◆ Layout() [4/4]
construct from a string.
- Parameters
-
| name | input in layout convention: upper case indicates a dimension and the corresponding lower case with factor size indicates the split dimension. return undefined layout if "__undef__" is passed. |
| dtype | The dtype of generated axes vars in the returned layout. It is required to be integer type. |
◆ Contains()
| bool tvm::tirx::Layout::Contains |
( |
const LayoutAxis & |
axis | ) |
const |
|
inline |
Whether the layout contains an axis.
- Parameters
-
- Returns
- Whether the layout contains the axis.
◆ Equals()
| bool tvm::tirx::Layout::Equals |
( |
const Layout & |
rhs | ) |
const |
|
inline |
Whether the two layouts are equal.
- Parameters
-
- Returns
- whether the two layouts are equal.
◆ ExpandPrimal()
| Layout tvm::tirx::Layout::ExpandPrimal |
( |
const Layout & |
dst_layout | ) |
|
|
inline |
Returns a new layout where the dims have been expanded to match the primal dimensions.
- Parameters
-
| dst_layout | The dst layout to which current layout has to be expanded. |
- Returns
- The expanded Layout.
◆ FactorOf()
| int32_t tvm::tirx::Layout::FactorOf |
( |
const LayoutAxis & |
axis | ) |
const |
Get the factor size of the subordinate axis.
- Parameters
-
| axis | the input primal-axis or subordinate-axis. |
- Returns
- the size of the subordinate-axis of
axis (if axis is a primal-axis), or the size of axis itself (if axis is a subordinate-axis). Return -1 if axis is not in the layout the layout is undefined.
◆ IndexOf() [1/3]
| int32_t tvm::tirx::Layout::IndexOf |
( |
const LayoutAxis & |
axis | ) |
const |
|
inline |
return the index of the input axis. If it is not found in the layout or the layout is undefined, return -1.
- Parameters
-
| axis | the input layout axis. |
- Returns
- the index or -1 if not found.
◆ IndexOf() [2/3]
| int32_t tvm::tirx::Layout::IndexOf |
( |
const std::string & |
axis | ) |
const |
|
inline |
return the index of the input axis. If it is not found in the layout or the layout is undefined, return -1.
- Parameters
-
| axis | The input axis either a layout axis, or a packed axis |
- Returns
- the index or -1 if not found.
◆ IndexOf() [3/3]
| int32_t tvm::tirx::Layout::IndexOf |
( |
const tirx::IterVar & |
iter | ) |
const |
|
inline |
return the index of the input axis. If it is not found in the layout or the layout is undefined, return -1.
- Parameters
-
- Returns
- the index or -1 if not found.
◆ name()
| std::string tvm::tirx::Layout::name |
( |
| ) |
const |
|
inline |
- Returns
- the string description of the layout
◆ ndim()
| size_t tvm::tirx::Layout::ndim |
( |
| ) |
const |
|
inline |
- Returns
- number of dimensions
◆ ndim_primal()
| size_t tvm::tirx::Layout::ndim_primal |
( |
| ) |
const |
|
inline |
- Returns
- number of super dimensions
◆ operator->()
access the internal node container
- Returns
- the pointer to the internal node container
◆ operator[]()
| const LayoutAxis& tvm::tirx::Layout::operator[] |
( |
int32_t |
i | ) |
const |
|
inline |
◆ PackedAxisAt()
| IterVar tvm::tirx::Layout::PackedAxisAt |
( |
int32_t |
i | ) |
const |
|
inline |
◆ PackIterVar()
| static IterVar tvm::tirx::Layout::PackIterVar |
( |
ffi::Array< IterVar > |
iters | ) |
|
|
static |
Packs the Given Array of IterVars into a Single IterVar. Each IterVar in the Array should represent either a single primal axis or one or more subordinate axis.
- Parameters
-
| iters | Array of iter vars to be packed |
- Returns
- A packed iter var
◆ Split()
| Layout tvm::tirx::Layout::Split |
( |
const LayoutAxis & |
axis, |
|
|
size_t |
target_pos, |
|
|
int32_t |
factor |
|
) |
| const |
Split axis by size and put the sub-axis to position target_pos.
- Parameters
-
| axis | The source axis to be split. It must be a primal-axis; |
| target_pos | The target position of the newly split subordinate-axis. |
| factor | size of the sub-dimension. |
- Returns
- A newly constructed Layout object.
◆ SubLayout()
| Layout tvm::tirx::Layout::SubLayout |
( |
size_t |
pos, |
|
|
size_t |
len |
|
) |
| const |
Returns a sub-layout which is the portion of the object that starts at dimension pos and spans len dimensions (or until the end of the layout, whichever comes first).
- Parameters
-
| pos | The start position. |
| len | The length of the sub-layout. if 0, return layout of scalar |
- Returns
- A newly constructed Layout object.
◆ TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE()
| tvm::tirx::Layout::TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE |
( |
Layout |
, |
|
|
ObjectRef |
, |
|
|
LayoutNode |
|
|
) |
| |
◆ Undef()
| static const Layout& tvm::tirx::Layout::Undef |
( |
| ) |
|
|
inlinestatic |
Return an undefined layout.
- Returns
- a (global) undefined layout.
◆ UnpackIterVar()
| static ffi::Array<IterVar> tvm::tirx::Layout::UnpackIterVar |
( |
IterVar |
packed_iter | ) |
|
|
static |
Unpacks a Packed IterVar into its constituents.
- Parameters
-
| packed_iter | A Packed IterVar containing a single primal axis or one or more subordinate axis |
- Returns
- Constituent IterVars
◆ operator<<
| std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const Layout & |
l |
|
) |
| |
|
friend |
allow output string of layout to ostream
- Parameters
-
| os | the output stream |
| l | the layout |
- Returns
- the ostream
The documentation for this class was generated from the following file: