tvm
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
tvm::tirx::SwizzleLayoutNode Class Reference

#include <layout.h>

Inheritance diagram for tvm::tirx::SwizzleLayoutNode:
Collaboration diagram for tvm::tirx::SwizzleLayoutNode:

Public Member Functions

bool CompatibleWithShape (const ffi::Array< PrimExpr > &shape) const final
 Check if the layout is compatible with the shape. More...
 
bool VerifyWellFormed () const final
 Verify if the layout is well-formed. More...
 
PrimExpr GetSize (ffi::Optional< ffi::String > axis_name=std::nullopt) const final
 Get the size of the layout. More...
 
PrimExpr GetSpan (ffi::Optional< ffi::String > axis_name=std::nullopt) const final
 Get the span of the layout. More...
 
ffi::Map< ffi::String, PrimExprApply (ffi::Array< PrimExpr > coord) const final
 Apply the input coordinate and get the mapped output. More...
 
ffi::Map< ffi::String, PrimExprApply (PrimExpr coord) const final
 
Layout Canonicalize () const final
 Turn the layout to canonical form. More...
 
Layout Tile (const TileLayout &outer, const ffi::Array< PrimExpr > &outer_shape, const ffi::Array< PrimExpr > &inner_shape) const final
 Tile the layout with an outer layout. More...
 
Layout DirectSum (const TileLayout &left, const ffi::Array< PrimExpr > &left_shape, const ffi::Array< PrimExpr > &right_shape) const final
 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...
 
ffi::Optional< TileLayoutIsTileInner (const Layout &tile_layout, const ffi::Array< PrimExpr > &tiled_shape, const ffi::Array< PrimExpr > &inner_shape) const final
 Check if the layout is the inner layout of a tiled layout. More...
 
ffi::Optional< LayoutIsTileOuter (const Layout &tile_layout, const ffi::Array< PrimExpr > &tiled_shape, const ffi::Array< PrimExpr > &outer_shape) const final
 Check if the layout is the outer layout of a tiled layout. More...
 
ffi::Optional< TileLayoutIsDirectSumRight (const Layout &sum_layout, const ffi::Array< PrimExpr > &interleaved_shape, const ffi::Array< PrimExpr > &right_shape) const final
 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...
 
ffi::Optional< LayoutIsDirectSumLeft (const Layout &sum_layout, const ffi::Array< PrimExpr > &interleaved_shape, const ffi::Array< PrimExpr > &left_shape) const final
 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...
 
ffi::Optional< LayoutSlice (const ffi::Array< PrimExpr > &shape, const Region &region) const final
 Slice the layout with a given shape and region. More...
 
 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("tirx.SwizzleLayout", SwizzleLayoutNode, LayoutNode)
 
- Public Member Functions inherited from tvm::tirx::LayoutNode
ffi::Map< ffi::String, PrimExprApply (const ffi::Array< PrimExpr > &coord, const ffi::Array< PrimExpr > &shape) const
 
 TVM_FFI_DECLARE_OBJECT_INFO ("tirx.Layout", LayoutNode, ffi::Object)
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

int per_element
 
int swizzle_len
 
int atom_len
 
bool swizzle_inner
 

Friends

class SwizzleLayout
 

Additional Inherited Members

- Static Public Attributes inherited from tvm::tirx::LayoutNode
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode
 

Member Function Documentation

◆ Apply() [1/2]

ffi::Map<ffi::String, PrimExpr> tvm::tirx::SwizzleLayoutNode::Apply ( ffi::Array< PrimExpr coord) const
finalvirtual

Apply the input coordinate and get the mapped output.

Implements tvm::tirx::LayoutNode.

◆ Apply() [2/2]

ffi::Map<ffi::String, PrimExpr> tvm::tirx::SwizzleLayoutNode::Apply ( PrimExpr  coord) const
finalvirtual

Implements tvm::tirx::LayoutNode.

◆ Canonicalize()

Layout tvm::tirx::SwizzleLayoutNode::Canonicalize ( ) const
finalvirtual

Turn the layout to canonical form.

Implements tvm::tirx::LayoutNode.

◆ CompatibleWithShape()

bool tvm::tirx::SwizzleLayoutNode::CompatibleWithShape ( const ffi::Array< PrimExpr > &  shape) const
finalvirtual

Check if the layout is compatible with the shape.

Implements tvm::tirx::LayoutNode.

◆ DirectSum()

Layout tvm::tirx::SwizzleLayoutNode::DirectSum ( const TileLayout left,
const ffi::Array< PrimExpr > &  left_shape,
const ffi::Array< PrimExpr > &  right_shape 
) const
finalvirtual

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.

Implements tvm::tirx::LayoutNode.

◆ GetSize()

PrimExpr tvm::tirx::SwizzleLayoutNode::GetSize ( ffi::Optional< ffi::String >  axis_name = std::nullopt) const
finalvirtual

Get the size of the layout.

Implements tvm::tirx::LayoutNode.

◆ GetSpan()

PrimExpr tvm::tirx::SwizzleLayoutNode::GetSpan ( ffi::Optional< ffi::String >  axis_name = std::nullopt) const
finalvirtual

Get the span of the layout.

Implements tvm::tirx::LayoutNode.

◆ IsDirectSumLeft()

ffi::Optional<Layout> tvm::tirx::SwizzleLayoutNode::IsDirectSumLeft ( const Layout sum_layout,
const ffi::Array< PrimExpr > &  interleaved_shape,
const ffi::Array< PrimExpr > &  left_shape 
) const
finalvirtual

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

Implements tvm::tirx::LayoutNode.

◆ IsDirectSumRight()

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

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

Implements tvm::tirx::LayoutNode.

◆ IsTileInner()

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

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

Implements tvm::tirx::LayoutNode.

◆ IsTileOuter()

ffi::Optional<Layout> tvm::tirx::SwizzleLayoutNode::IsTileOuter ( const Layout tile_layout,
const ffi::Array< PrimExpr > &  tiled_shape,
const ffi::Array< PrimExpr > &  outer_shape 
) const
finalvirtual

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

Implements tvm::tirx::LayoutNode.

◆ RegisterReflection()

static void tvm::tirx::SwizzleLayoutNode::RegisterReflection ( )
inlinestatic

◆ Slice()

ffi::Optional<Layout> tvm::tirx::SwizzleLayoutNode::Slice ( const ffi::Array< PrimExpr > &  shape,
const Region region 
) const
finalvirtual

Slice the layout with a given shape and region.

Implements tvm::tirx::LayoutNode.

◆ Tile()

Layout tvm::tirx::SwizzleLayoutNode::Tile ( const TileLayout outer,
const ffi::Array< PrimExpr > &  outer_shape,
const ffi::Array< PrimExpr > &  inner_shape 
) const
finalvirtual

Tile the layout with an outer layout.

Implements tvm::tirx::LayoutNode.

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::tirx::SwizzleLayoutNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "tirx.SwizzleLayout"  ,
SwizzleLayoutNode  ,
LayoutNode   
)

◆ VerifyWellFormed()

bool tvm::tirx::SwizzleLayoutNode::VerifyWellFormed ( ) const
finalvirtual

Verify if the layout is well-formed.

Implements tvm::tirx::LayoutNode.

Friends And Related Function Documentation

◆ SwizzleLayout

friend class SwizzleLayout
friend

Member Data Documentation

◆ atom_len

int tvm::tirx::SwizzleLayoutNode::atom_len

◆ per_element

int tvm::tirx::SwizzleLayoutNode::per_element

◆ swizzle_inner

bool tvm::tirx::SwizzleLayoutNode::swizzle_inner

◆ swizzle_len

int tvm::tirx::SwizzleLayoutNode::swizzle_len

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