TT-MLIR
Classes | Public Member Functions | List of all members
mlir::tt::DeviceLayoutInterface Class Reference
Inheritance diagram for mlir::tt::DeviceLayoutInterface:

Classes

struct  Trait
 

Public Member Functions

llvm::ArrayRef< int64_t > getGridShape (MemRefType memrefType) const
 Get the grid shape part of the memref shape (aka the first half) More...
 
llvm::ArrayRef< int64_t > getShardShape (MemRefType memrefType) const
 Get the shard shape part of the memref shape (aka the second half) More...
 
int64_t getShardNumElements (MemRefType memrefType) const
 Get the number of elements for the shard shape part of the memref shape (aka the second half) More...
 
 operator::mlir::MemRefLayoutAttrInterface () const
 
::mlir::AffineMap getAffineMap () const
 Get the MemRef layout as an AffineMap, the method must not return NULL. More...
 
bool isIdentity () const
 Return true if this attribute represents the identity layout. More...
 
::llvm::LogicalResult verifyLayout (::llvm::ArrayRef< int64_t > shape, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) const
 Check if the current layout is applicable to the provided shape. More...
 
::llvm::LogicalResult getStridesAndOffset (::llvm::ArrayRef< int64_t > shape, ::llvm::SmallVectorImpl< int64_t > &strides, int64_t &offset) const
 

Member Function Documentation

◆ getAffineMap()

mlir::AffineMap mlir::tt::DeviceLayoutInterface::getAffineMap ( ) const

Get the MemRef layout as an AffineMap, the method must not return NULL.

◆ getGridShape()

llvm::ArrayRef< int64_t > mlir::tt::DeviceLayoutInterface::getGridShape ( MemRefType  memrefType) const

Get the grid shape part of the memref shape (aka the first half)

◆ getShardNumElements()

int64_t mlir::tt::DeviceLayoutInterface::getShardNumElements ( MemRefType  memrefType) const

Get the number of elements for the shard shape part of the memref shape (aka the second half)

◆ getShardShape()

llvm::ArrayRef< int64_t > mlir::tt::DeviceLayoutInterface::getShardShape ( MemRefType  memrefType) const

Get the shard shape part of the memref shape (aka the second half)

◆ getStridesAndOffset()

llvm::LogicalResult mlir::tt::DeviceLayoutInterface::getStridesAndOffset ( ::llvm::ArrayRef< int64_t >  shape,
::llvm::SmallVectorImpl< int64_t > &  strides,
int64_t &  offset 
) const

Return the strides (using ShapedType::kDynamic for the dynamic case) that this layout corresponds to into strides and offset if such exist and can be determined from a combination of the layout and the given shape. If these strides cannot be inferred, return failure(). The values of strides and offset are undefined on failure.

◆ isIdentity()

bool mlir::tt::DeviceLayoutInterface::isIdentity ( ) const

Return true if this attribute represents the identity layout.

◆ operator::mlir::MemRefLayoutAttrInterface()

mlir::tt::DeviceLayoutInterface::operator::mlir::MemRefLayoutAttrInterface ( ) const
inline

◆ verifyLayout()

llvm::LogicalResult mlir::tt::DeviceLayoutInterface::verifyLayout ( ::llvm::ArrayRef< int64_t >  shape,
::llvm::function_ref<::mlir::InFlightDiagnostic()>  emitError 
) const

Check if the current layout is applicable to the provided shape.


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