tvm
Public Member Functions | Static Public Attributes | List of all members
tvm::tirx::LayoutNode Class Referenceabstract

#include <layout.h>

Inheritance diagram for tvm::tirx::LayoutNode:
Collaboration diagram for tvm::tirx::LayoutNode:

Public Member Functions

virtual bool CompatibleWithShape (const ffi::Array< PrimExpr > &shape) const =0
 Compatible with shape. More...
 
virtual bool VerifyWellFormed () const =0
 Verify if the layout is well-formed. More...
 
virtual PrimExpr GetSize (ffi::Optional< ffi::String > axis_name=std::nullopt) const =0
 Get the size of the layout (of some axis) More...
 
virtual PrimExpr GetSpan (ffi::Optional< ffi::String > axis_name=std::nullopt) const =0
 Get the span of the layout (of some axis) More...
 
virtual ffi::Map< ffi::String, PrimExprApply (ffi::Array< PrimExpr > coord) const =0
 Apply layout on the input coordinate and get the mapped output. More...
 
virtual ffi::Map< ffi::String, PrimExprApply (PrimExpr coord) const =0
 
ffi::Map< ffi::String, PrimExprApply (const ffi::Array< PrimExpr > &coord, const ffi::Array< PrimExpr > &shape) const
 
virtual Layout Canonicalize () const =0
 Turn the layout to canonical form. More...
 
virtual Layout Tile (const TileLayout &outer, const ffi::Array< PrimExpr > &outer_shape, const ffi::Array< PrimExpr > &inner_shape) const =0
 Tile the current layout with a given layout. More...
 
virtual ffi::Optional< LayoutSlice (const ffi::Array< PrimExpr > &shape, const Region &region) const =0
 Slice the layout with a given shape and region. More...
 
virtual Layout DirectSum (const TileLayout &left, const ffi::Array< PrimExpr > &left_shape, const ffi::Array< PrimExpr > &right_shape) const =0
 Direct-sum on the tiling domain (unscaled composition) Given left layout A (grouped by left_shape) and this layout B (grouped by right_shape), construct the interleaved-domain direct sum A + B without span scaling. More...
 
virtual ffi::Optional< TileLayoutIsTileInner (const Layout &tile_layout, const ffi::Array< PrimExpr > &tiled_shape, const ffi::Array< PrimExpr > &inner_shape) const =0
 Check if the layout is the inner layout of a tiled layout. More...
 
virtual ffi::Optional< LayoutIsTileOuter (const Layout &tile_layout, const ffi::Array< PrimExpr > &tiled_shape, const ffi::Array< PrimExpr > &outer_shape) const =0
 Check if the layout is the outer layout of a tiled layout. More...
 
virtual ffi::Optional< TileLayoutIsDirectSumRight (const Layout &sum_layout, const ffi::Array< PrimExpr > &interleaved_shape, const ffi::Array< PrimExpr > &right_shape) const =0
 Check if this layout is the right addend B in a direct-sum A + B over the interleaved domain S_A \otimes S_B. If so, return the left layout A. More...
 
virtual ffi::Optional< LayoutIsDirectSumLeft (const Layout &sum_layout, const ffi::Array< PrimExpr > &interleaved_shape, const ffi::Array< PrimExpr > &left_shape) const =0
 Check if this layout is the left addend A in a direct-sum A + B over the interleaved domain S_A \otimes S_B. If so, return the right layout B. More...
 
 TVM_FFI_DECLARE_OBJECT_INFO ("tirx.Layout", LayoutNode, ffi::Object)
 

Static Public Attributes

static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode
 

Member Function Documentation

◆ Apply() [1/3]

ffi::Map<ffi::String, PrimExpr> tvm::tirx::LayoutNode::Apply ( const ffi::Array< PrimExpr > &  coord,
const ffi::Array< PrimExpr > &  shape 
) const

◆ Apply() [2/3]

virtual ffi::Map<ffi::String, PrimExpr> tvm::tirx::LayoutNode::Apply ( ffi::Array< PrimExpr coord) const
pure virtual

Apply layout on the input coordinate and get the mapped output.

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ Apply() [3/3]

virtual ffi::Map<ffi::String, PrimExpr> tvm::tirx::LayoutNode::Apply ( PrimExpr  coord) const
pure virtual

◆ Canonicalize()

virtual Layout tvm::tirx::LayoutNode::Canonicalize ( ) const
pure virtual

Turn the layout to canonical form.

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ CompatibleWithShape()

virtual bool tvm::tirx::LayoutNode::CompatibleWithShape ( const ffi::Array< PrimExpr > &  shape) const
pure virtual

◆ DirectSum()

virtual Layout tvm::tirx::LayoutNode::DirectSum ( const TileLayout left,
const ffi::Array< PrimExpr > &  left_shape,
const ffi::Array< PrimExpr > &  right_shape 
) const
pure virtual

Direct-sum on the tiling domain (unscaled composition) Given left layout A (grouped by left_shape) and this layout B (grouped by right_shape), construct the interleaved-domain direct sum A + B without span scaling.

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ GetSize()

virtual PrimExpr tvm::tirx::LayoutNode::GetSize ( ffi::Optional< ffi::String >  axis_name = std::nullopt) const
pure virtual

Get the size of the layout (of some axis)

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ GetSpan()

virtual PrimExpr tvm::tirx::LayoutNode::GetSpan ( ffi::Optional< ffi::String >  axis_name = std::nullopt) const
pure virtual

Get the span of the layout (of some axis)

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ IsDirectSumLeft()

virtual ffi::Optional<Layout> tvm::tirx::LayoutNode::IsDirectSumLeft ( const Layout sum_layout,
const ffi::Array< PrimExpr > &  interleaved_shape,
const ffi::Array< PrimExpr > &  left_shape 
) const
pure virtual

Check if this layout is the left addend A in a direct-sum A + B over the interleaved domain S_A \otimes S_B. If so, return the right layout B.

Parameters
sum_layoutThe resulting direct-sum layout
interleaved_shapeThe interleaved domain S_A \otimes S_B, i.e., [A0, B0, A1, B1, ...]
left_shapeThe shape that groups this (left) layout

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ IsDirectSumRight()

virtual ffi::Optional<TileLayout> tvm::tirx::LayoutNode::IsDirectSumRight ( const Layout sum_layout,
const ffi::Array< PrimExpr > &  interleaved_shape,
const ffi::Array< PrimExpr > &  right_shape 
) const
pure virtual

Check if this layout is the right addend B in a direct-sum A + B over the interleaved domain S_A \otimes S_B. If so, return the left layout A.

Parameters
sum_layoutThe resulting direct-sum layout
interleaved_shapeThe interleaved domain S_A \otimes S_B, i.e., [A0, B0, A1, B1, ...]
right_shapeThe shape that groups this (right) layout

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ IsTileInner()

virtual ffi::Optional<TileLayout> tvm::tirx::LayoutNode::IsTileInner ( const Layout tile_layout,
const ffi::Array< PrimExpr > &  tiled_shape,
const ffi::Array< PrimExpr > &  inner_shape 
) const
pure virtual

Check if the layout is the inner layout of a tiled layout.

Parameters
tile_layoutThe tiled layout to check
tiled_shapeThe shape of the tiled layout
inner_shapeThe shape of the inner layout
Returns
The outer layout if this layout is the inner layout of tile_layout, std::nullopt otherwise

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ IsTileOuter()

virtual ffi::Optional<Layout> tvm::tirx::LayoutNode::IsTileOuter ( const Layout tile_layout,
const ffi::Array< PrimExpr > &  tiled_shape,
const ffi::Array< PrimExpr > &  outer_shape 
) const
pure virtual

Check if the layout is the outer layout of a tiled layout.

Parameters
tile_layoutThe tiled layout to check
tiled_shapeThe shape of the tiled layout
outer_shapeThe shape of the outer layout
Returns
The inner layout if this layout is the outer layout of tile_layout, std::nullopt otherwise

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ Slice()

virtual ffi::Optional<Layout> tvm::tirx::LayoutNode::Slice ( const ffi::Array< PrimExpr > &  shape,
const Region region 
) const
pure virtual

Slice the layout with a given shape and region.

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ Tile()

virtual Layout tvm::tirx::LayoutNode::Tile ( const TileLayout outer,
const ffi::Array< PrimExpr > &  outer_shape,
const ffi::Array< PrimExpr > &  inner_shape 
) const
pure virtual

Tile the current layout with a given layout.

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

◆ TVM_FFI_DECLARE_OBJECT_INFO()

tvm::tirx::LayoutNode::TVM_FFI_DECLARE_OBJECT_INFO ( "tirx.Layout"  ,
LayoutNode  ,
ffi::Object   
)

◆ VerifyWellFormed()

virtual bool tvm::tirx::LayoutNode::VerifyWellFormed ( ) const
pure virtual

Verify if the layout is well-formed.

Implemented in tvm::tirx::ComposeLayoutNode, tvm::tirx::SwizzleLayoutNode, and tvm::tirx::TileLayoutNode.

Member Data Documentation

◆ _type_s_eq_hash_kind

constexpr TVMFFISEqHashKind tvm::tirx::LayoutNode::_type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode
staticconstexpr

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