Managed reference to LayoutNode.
More...
#include <data_layout.h>
Managed reference to LayoutNode.
- See also
- LayoutNode
◆ Layout() [1/4]
tvm::tir::Layout::Layout |
( |
const Array< tir::IterVar > & |
axes | ) |
|
|
explicit |
◆ Layout() [2/4]
tvm::tir::Layout::Layout |
( |
const tvm::String & |
name | ) |
|
|
inline |
◆ Layout() [3/4]
tvm::tir::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::tir::Layout::Contains |
( |
const LayoutAxis & |
axis | ) |
const |
|
inline |
Whether the layout contains an axis.
- Parameters
-
- Returns
- Whether the layout contains the axis.
◆ Equals()
bool tvm::tir::Layout::Equals |
( |
const Layout & |
rhs | ) |
const |
|
inline |
Whether the two layouts are equal.
- Parameters
-
- Returns
- whether the two layouts are equal.
◆ ExpandPrimal()
Layout tvm::tir::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::tir::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()
int32_t tvm::tir::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
-
- Returns
- the index or -1 if not found.
◆ name()
std::string tvm::tir::Layout::name |
( |
| ) |
const |
|
inline |
- Returns
- the string description of the layout
◆ ndim()
size_t tvm::tir::Layout::ndim |
( |
| ) |
const |
|
inline |
- Returns
- number of dimensions
◆ ndim_primal()
size_t tvm::tir::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::tir::Layout::operator[] |
( |
int32_t |
i | ) |
const |
|
inline |
◆ Split()
Layout tvm::tir::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::tir::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_DEFINE_OBJECT_REF_METHODS()
tvm::tir::Layout::TVM_DEFINE_OBJECT_REF_METHODS |
( |
Layout |
, |
|
|
ObjectRef |
, |
|
|
LayoutNode |
|
|
) |
| |
◆ Undef()
static const Layout& tvm::tir::Layout::Undef |
( |
| ) |
|
|
inlinestatic |
Return an undefined layout.
- Returns
- a (global) undefined layout.
◆ 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: