MLIR  16.0.0git
Enumerations | Functions
SparseTensor.h File Reference
#include "mlir-c/AffineMap.h"
#include "mlir-c/IR.h"
#include "mlir/Dialect/SparseTensor/Transforms/Passes.capi.h.inc"
+ Include dependency graph for SparseTensor.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  MlirSparseTensorDimLevelType {
  MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE, MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED, MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU, MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NO,
  MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU_NO, MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON, MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU, MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NO,
  MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU_NO
}
 Dimension level types (and properties) that define sparse tensors. More...
 

Functions

 MLIR_DECLARE_CAPI_DIALECT_REGISTRATION (SparseTensor, sparse_tensor)
 
MLIR_CAPI_EXPORTED bool mlirAttributeIsASparseTensorEncodingAttr (MlirAttribute attr)
 Checks whether the given attribute is a sparse_tensor.encoding attribute. More...
 
MLIR_CAPI_EXPORTED MlirAttribute mlirSparseTensorEncodingAttrGet (MlirContext ctx, intptr_t numDimLevelTypes, enum MlirSparseTensorDimLevelType const *dimLevelTypes, MlirAffineMap dimOrdering, int pointerBitWidth, int indexBitWidth)
 Creates a sparse_tensor.encoding attribute with the given parameters. More...
 
MLIR_CAPI_EXPORTED intptr_t mlirSparseTensorEncodingGetNumDimLevelTypes (MlirAttribute attr)
 Returns the number of dim level types in a sparse_tensor.encoding attribute. More...
 
MLIR_CAPI_EXPORTED enum MlirSparseTensorDimLevelType mlirSparseTensorEncodingAttrGetDimLevelType (MlirAttribute attr, intptr_t pos)
 Returns a specified dim level type in a sparse_tensor.encoding attribute. More...
 
MLIR_CAPI_EXPORTED MlirAffineMap mlirSparseTensorEncodingAttrGetDimOrdering (MlirAttribute attr)
 Returns the dimension ordering in a sparse_tensor.encoding attribute. More...
 
MLIR_CAPI_EXPORTED int mlirSparseTensorEncodingAttrGetPointerBitWidth (MlirAttribute attr)
 Returns the pointer bit width in a sparse_tensor.encoding attribute. More...
 
MLIR_CAPI_EXPORTED int mlirSparseTensorEncodingAttrGetIndexBitWidth (MlirAttribute attr)
 Returns the index bit width in a sparse_tensor.encoding attribute. More...
 

Enumeration Type Documentation

◆ MlirSparseTensorDimLevelType

Dimension level types (and properties) that define sparse tensors.

See the documentation in SparseTensorAttrDefs.td for their meaning.

These correspond to SparseTensorEncodingAttr::DimLevelType in the C++ API. If updating, keep them in sync and update the static_assert in the impl file.

Enumerator
MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE 
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED 
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU 
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NO 
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU_NO 
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON 
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU 
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NO 
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU_NO 

Definition at line 28 of file SparseTensor.h.

Function Documentation

◆ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION()

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION ( SparseTensor  ,
sparse_tensor   
)

◆ mlirAttributeIsASparseTensorEncodingAttr()

MLIR_CAPI_EXPORTED bool mlirAttributeIsASparseTensorEncodingAttr ( MlirAttribute  attr)

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

Definition at line 52 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirSparseTensorEncodingAttrGet ( MlirContext  ctx,
intptr_t  numDimLevelTypes,
enum MlirSparseTensorDimLevelType const *  dimLevelTypes,
MlirAffineMap  dimOrdering,
int  pointerBitWidth,
int  indexBitWidth 
)

Creates a sparse_tensor.encoding attribute with the given parameters.

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetDimLevelType()

MLIR_CAPI_EXPORTED enum MlirSparseTensorDimLevelType mlirSparseTensorEncodingAttrGetDimLevelType ( MlirAttribute  attr,
intptr_t  pos 
)

Returns a specified dim level type in a sparse_tensor.encoding attribute.

Definition at line 79 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetDimOrdering()

MLIR_CAPI_EXPORTED MlirAffineMap mlirSparseTensorEncodingAttrGetDimOrdering ( MlirAttribute  attr)

Returns the dimension ordering in a sparse_tensor.encoding attribute.

Definition at line 70 of file SparseTensor.cpp.

References unwrap(), and wrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetIndexBitWidth()

MLIR_CAPI_EXPORTED int mlirSparseTensorEncodingAttrGetIndexBitWidth ( MlirAttribute  attr)

Returns the index bit width in a sparse_tensor.encoding attribute.

Definition at line 88 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingAttrGetPointerBitWidth()

MLIR_CAPI_EXPORTED int mlirSparseTensorEncodingAttrGetPointerBitWidth ( MlirAttribute  attr)

Returns the pointer bit width in a sparse_tensor.encoding attribute.

Definition at line 84 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().

◆ mlirSparseTensorEncodingGetNumDimLevelTypes()

MLIR_CAPI_EXPORTED intptr_t mlirSparseTensorEncodingGetNumDimLevelTypes ( MlirAttribute  attr)

Returns the number of dim level types in a sparse_tensor.encoding attribute.

Definition at line 74 of file SparseTensor.cpp.

References unwrap().

Referenced by populateDialectSparseTensorSubmodule().