Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir-c/Dialect/SparseTensor.h
Show All 20 Lines | |||||
/// Dimension level types (and properties) that define sparse tensors. | /// Dimension level types (and properties) that define sparse tensors. | ||||
/// See the documentation in SparseTensorAttrDefs.td for their meaning. | /// See the documentation in SparseTensorAttrDefs.td for their meaning. | ||||
/// | /// | ||||
/// These correspond to SparseTensorEncodingAttr::DimLevelType in the C++ API. | /// These correspond to SparseTensorEncodingAttr::DimLevelType in the C++ API. | ||||
/// If updating, keep them in sync and update the static_assert in the impl | /// If updating, keep them in sync and update the static_assert in the impl | ||||
/// file. | /// file. | ||||
enum MlirSparseTensorDimLevelType { | enum MlirSparseTensorDimLevelType { | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE, | MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE = 4, // 0b001_00 | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED, | MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED = 8, // 0b010_00 | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU, | MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU = 9, // 0b010_01 | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NO, | MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NO = 10, // 0b010_10 | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU_NO, | MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED_NU_NO = 11, // 0b010_11 | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON, | MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON = 16, // 0b100_00 | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU, | MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU = 17, // 0b100_01 | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NO, | MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NO = 18, // 0b100_10 | ||||
MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU_NO, | MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON_NU_NO = 19, // 0b100_11 | ||||
}; | }; | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// SparseTensorEncodingAttr | // SparseTensorEncodingAttr | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
/// Checks whether the given attribute is a sparse_tensor.encoding attribute. | /// Checks whether the given attribute is a sparse_tensor.encoding attribute. | ||||
MLIR_CAPI_EXPORTED bool | MLIR_CAPI_EXPORTED bool | ||||
Show All 35 Lines |