Managed reference to SLayoutNode.
More...
#include <data_layout.h>
|
| | SLayout (const ffi::Array< tirx::IterVar > &axes) |
| |
| | SLayout (const tvm::ffi::String &name) |
| | construct from a string
|
| |
| | SLayout (const char *name) |
| | construct from a string
|
| |
| | SLayout (const std::string &name, PrimType index_ty=PrimType::Int(32)) |
| | construct from a string.
|
| |
| SLayoutNode * | operator-> () |
| | access the internal node container
|
| |
| SLayout | 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).
|
| |
| SLayout | Split (const SLayoutAxis &axis, size_t target_pos, int32_t factor) const |
| | Split axis by size and put the sub-axis to position target_pos.
|
| |
| size_t | ndim () const |
| |
| size_t | ndim_primal () const |
| |
| SLayout | ExpandPrimal (const SLayout &dst_layout) |
| | Returns a new layout where the dims have been expanded to match the primal dimensions.
|
| |
| 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.
|
| |
| int32_t | IndexOf (const SLayoutAxis &axis) const |
| | return the index of the input axis. If it is not found in the layout or the layout is undefined, return -1.
|
| |
| 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.
|
| |
| int32_t | FactorOf (const SLayoutAxis &axis) const |
| | Get the factor size of the subordinate axis.
|
| |
| bool | Contains (const SLayoutAxis &axis) const |
| | Whether the layout contains an axis.
|
| |
| const SLayoutAxis & | operator[] (int32_t i) const |
| |
| IterVar | PackedAxisAt (int32_t i) const |
| |
| std::string | name () const |
| |
| bool | Equals (const SLayout &rhs) const |
| | Whether the two layouts are equal.
|
| |
| | TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (SLayout, ffi::ObjectRef, SLayoutNode) |
| |
Managed reference to SLayoutNode.
- See also
- SLayoutNode
◆ SLayout() [1/4]
◆ SLayout() [2/4]
| tvm::tirx::SLayout::SLayout |
( |
const tvm::ffi::String & |
name | ) |
|
|
inline |
◆ SLayout() [3/4]
| tvm::tirx::SLayout::SLayout |
( |
const char * |
name | ) |
|
|
inline |
◆ SLayout() [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. |
| index_ty | The type of generated axes vars in the returned layout. It is required to be integer type. |
◆ Contains()
Whether the layout contains an axis.
- Parameters
-
- Returns
- Whether the layout contains the axis.
◆ Equals()
Whether the two layouts are equal.
- Parameters
-
- Returns
- whether the two layouts are equal.
◆ ExpandPrimal()
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 SLayout.
◆ FactorOf()
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]
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::SLayout::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]
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::SLayout::name |
( |
| ) |
const |
|
inline |
- Returns
- the string description of the layout
◆ ndim()
| size_t tvm::tirx::SLayout::ndim |
( |
| ) |
const |
|
inline |
- Returns
- number of dimensions
◆ ndim_primal()
| size_t tvm::tirx::SLayout::ndim_primal |
( |
| ) |
const |
|
inline |
- Returns
- number of super dimensions
◆ operator->()
access the internal node container
- Returns
- the pointer to the internal node container
◆ operator[]()
◆ PackedAxisAt()
◆ PackIterVar()
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()
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 SLayout object.
◆ SubLayout()
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 SLayout object.
◆ TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE()
| tvm::tirx::SLayout::TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE |
( |
SLayout |
, |
|
|
ffi::ObjectRef |
, |
|
|
SLayoutNode |
|
|
) |
| |
◆ Undef()
Return an undefined layout.
- Returns
- a (global) undefined layout.
◆ UnpackIterVar()
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<<
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: