MLIR 22.0.0git
SparseTensor.cpp File Reference

Go to the source code of this file.

Functions

 MLIR_DEFINE_CAPI_DIALECT_REGISTRATION (SparseTensor, sparse_tensor, mlir::sparse_tensor::SparseTensorDialect) static_assert(static_cast< int >(MLIR_SPARSE_TENSOR_LEVEL_DENSE)
 MlirSparseTensorLevelFormat (C-API) and LevelFormat(C++) mismatch")
bool mlirAttributeIsASparseTensorEncodingAttr (MlirAttribute attr)
 Checks whether the given attribute is a sparse_tensor.encoding attribute.
MlirAttribute mlirSparseTensorEncodingAttrGet (MlirContext ctx, intptr_t lvlRank, MlirSparseTensorLevelType const *lvlTypes, MlirAffineMap dimToLvl, MlirAffineMap lvlToDim, int posWidth, int crdWidth, MlirAttribute explicitVal, MlirAttribute implicitVal)
 Creates a sparse_tensor.encoding attribute with the given parameters.
MlirAffineMap mlirSparseTensorEncodingAttrGetDimToLvl (MlirAttribute attr)
 Returns the dimension-to-level mapping of the sparse_tensor.encoding attribute.
MlirAffineMap mlirSparseTensorEncodingAttrGetLvlToDim (MlirAttribute attr)
 Returns the level-to-dimension mapping of the sparse_tensor.encoding attribute.
intptr_t mlirSparseTensorEncodingGetLvlRank (MlirAttribute attr)
 Returns the level-rank of the sparse_tensor.encoding attribute.
MlirSparseTensorLevelType mlirSparseTensorEncodingAttrGetLvlType (MlirAttribute attr, intptr_t lvl)
 Returns a specified level-type of the sparse_tensor.encoding attribute.
enum MlirSparseTensorLevelFormat mlirSparseTensorEncodingAttrGetLvlFmt (MlirAttribute attr, intptr_t lvl)
 Returns a specified level-format of the sparse_tensor.encoding attribute.
int mlirSparseTensorEncodingAttrGetPosWidth (MlirAttribute attr)
 Returns the position bitwidth of the sparse_tensor.encoding attribute.
int mlirSparseTensorEncodingAttrGetCrdWidth (MlirAttribute attr)
 Returns the coordinate bitwidth of the sparse_tensor.encoding attribute.
MlirAttribute mlirSparseTensorEncodingAttrGetExplicitVal (MlirAttribute attr)
 Returns the explicit value of the sparse_tensor.encoding attribute.
MlirAttribute mlirSparseTensorEncodingAttrGetImplicitVal (MlirAttribute attr)
 Returns the implicit value of the sparse_tensor.encoding attribute.
MlirSparseTensorLevelType mlirSparseTensorEncodingAttrBuildLvlType (enum MlirSparseTensorLevelFormat lvlFmt, const enum MlirSparseTensorLevelPropertyNondefault *properties, unsigned size, unsigned n, unsigned m)
unsigned mlirSparseTensorEncodingAttrGetStructuredN (MlirSparseTensorLevelType lvlType)
unsigned mlirSparseTensorEncodingAttrGetStructuredM (MlirSparseTensorLevelType lvlType)

Function Documentation

◆ MLIR_DEFINE_CAPI_DIALECT_REGISTRATION()

◆ mlirAttributeIsASparseTensorEncodingAttr()

bool mlirAttributeIsASparseTensorEncodingAttr ( MlirAttribute attr)

Checks whether the given attribute is a sparse_tensor.encoding attribute.

Definition at line 45 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrBuildLvlType()

MlirSparseTensorLevelType mlirSparseTensorEncodingAttrBuildLvlType ( enum MlirSparseTensorLevelFormat lvlFmt,
const enum MlirSparseTensorLevelPropertyNondefault * properties,
unsigned size,
unsigned n,
unsigned m )

◆ mlirSparseTensorEncodingAttrGet()

MlirAttribute mlirSparseTensorEncodingAttrGet ( MlirContext ctx,
intptr_t lvlRank,
MlirSparseTensorLevelType const * lvlTypes,
MlirAffineMap dimToLvl,
MlirAffineMap lvlToDim,
int posWidth,
int crdWidth,
MlirAttribute explicitVal,
MlirAttribute implicitVal )

Creates a sparse_tensor.encoding attribute with the given parameters.

Definition at line 49 of file SparseTensor.cpp.

References unwrap(), and wrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetCrdWidth()

int mlirSparseTensorEncodingAttrGetCrdWidth ( MlirAttribute attr)

Returns the coordinate bitwidth of the sparse_tensor.encoding attribute.

Definition at line 94 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetDimToLvl()

MlirAffineMap mlirSparseTensorEncodingAttrGetDimToLvl ( MlirAttribute attr)

Returns the dimension-to-level mapping of the sparse_tensor.encoding attribute.

Definition at line 65 of file SparseTensor.cpp.

References unwrap(), and wrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetExplicitVal()

MlirAttribute mlirSparseTensorEncodingAttrGetExplicitVal ( MlirAttribute attr)

Returns the explicit value of the sparse_tensor.encoding attribute.

Definition at line 98 of file SparseTensor.cpp.

References unwrap(), and wrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetImplicitVal()

MlirAttribute mlirSparseTensorEncodingAttrGetImplicitVal ( MlirAttribute attr)

Returns the implicit value of the sparse_tensor.encoding attribute.

Definition at line 102 of file SparseTensor.cpp.

References unwrap(), and wrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetLvlFmt()

enum MlirSparseTensorLevelFormat mlirSparseTensorEncodingAttrGetLvlFmt ( MlirAttribute attr,
intptr_t lvl )

Returns a specified level-format of the sparse_tensor.encoding attribute.

Definition at line 84 of file SparseTensor.cpp.

References mlir::sparse_tensor::LevelType::getLvlFmt(), and mlirSparseTensorEncodingAttrGetLvlType().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetLvlToDim()

MlirAffineMap mlirSparseTensorEncodingAttrGetLvlToDim ( MlirAttribute attr)

Returns the level-to-dimension mapping of the sparse_tensor.encoding attribute.

Definition at line 69 of file SparseTensor.cpp.

References unwrap(), and wrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetLvlType()

MlirSparseTensorLevelType mlirSparseTensorEncodingAttrGetLvlType ( MlirAttribute attr,
intptr_t lvl )

Returns a specified level-type of the sparse_tensor.encoding attribute.

Definition at line 78 of file SparseTensor.cpp.

References unwrap().

Referenced by mlirSparseTensorEncodingAttrGetLvlFmt(), and populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetPosWidth()

int mlirSparseTensorEncodingAttrGetPosWidth ( MlirAttribute attr)

Returns the position bitwidth of the sparse_tensor.encoding attribute.

Definition at line 90 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetStructuredM()

unsigned mlirSparseTensorEncodingAttrGetStructuredM ( MlirSparseTensorLevelType lvlType)

Definition at line 126 of file SparseTensor.cpp.

References mlir::sparse_tensor::getM().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetStructuredN()

unsigned mlirSparseTensorEncodingAttrGetStructuredN ( MlirSparseTensorLevelType lvlType)

Definition at line 121 of file SparseTensor.cpp.

References mlir::sparse_tensor::getN().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingGetLvlRank()

intptr_t mlirSparseTensorEncodingGetLvlRank ( MlirAttribute attr)

Returns the level-rank of the sparse_tensor.encoding attribute.

Definition at line 73 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ MlirSparseTensorLevelFormat()