#include "mlir-c/Dialect/SparseTensor.h"
#include "mlir-c/IR.h"
#include "mlir/CAPI/AffineMap.h"
#include "mlir/CAPI/Registration.h"
#include "mlir/Dialect/SparseTensor/IR/SparseTensor.h"
#include "mlir/Support/LLVM.h"
usingnamespacellvm;
usingnamespacemlir::sparse_tensor;
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(SparseTensor, sparse_tensor,
mlir::sparse_tensor::SparseTensorDialect)
static_assert …;
static_assert …;
bool mlirAttributeIsASparseTensorEncodingAttr(MlirAttribute attr) { … }
MlirAttribute mlirSparseTensorEncodingAttrGet(
MlirContext ctx, intptr_t lvlRank,
MlirSparseTensorLevelType const *lvlTypes, MlirAffineMap dimToLvl,
MlirAffineMap lvlToDim, int posWidth, int crdWidth,
MlirAttribute explicitVal, MlirAttribute implicitVal) { … }
MlirAffineMap mlirSparseTensorEncodingAttrGetDimToLvl(MlirAttribute attr) { … }
MlirAffineMap mlirSparseTensorEncodingAttrGetLvlToDim(MlirAttribute attr) { … }
intptr_t mlirSparseTensorEncodingGetLvlRank(MlirAttribute attr) { … }
MlirSparseTensorLevelType
mlirSparseTensorEncodingAttrGetLvlType(MlirAttribute attr, intptr_t lvl) { … }
enum MlirSparseTensorLevelFormat
mlirSparseTensorEncodingAttrGetLvlFmt(MlirAttribute attr, intptr_t lvl) { … }
int mlirSparseTensorEncodingAttrGetPosWidth(MlirAttribute attr) { … }
int mlirSparseTensorEncodingAttrGetCrdWidth(MlirAttribute attr) { … }
MlirAttribute mlirSparseTensorEncodingAttrGetExplicitVal(MlirAttribute attr) { … }
MlirAttribute mlirSparseTensorEncodingAttrGetImplicitVal(MlirAttribute attr) { … }
MlirSparseTensorLevelType mlirSparseTensorEncodingAttrBuildLvlType(
enum MlirSparseTensorLevelFormat lvlFmt,
const enum MlirSparseTensorLevelPropertyNondefault *properties,
unsigned size, unsigned n, unsigned m) { … }
unsigned
mlirSparseTensorEncodingAttrGetStructuredN(MlirSparseTensorLevelType lvlType) { … }
unsigned
mlirSparseTensorEncodingAttrGetStructuredM(MlirSparseTensorLevelType lvlType) { … }