Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding", | ||||
let extraClassDeclaration = [{ | let extraClassDeclaration = [{ | ||||
// Dimension level types. By default, each type has the unique and | // Dimension level types. By default, each type has the unique and | ||||
// ordered properties. Alternatives properties are indicated by | // ordered properties. Alternatives properties are indicated by | ||||
// Nu (not-unique) and No (not-ordered). | // Nu (not-unique) and No (not-ordered). | ||||
// | // | ||||
// TODO: separate type and property in encoding | // TODO: separate type and property in encoding | ||||
// | // | ||||
enum class DimLevelType { | enum class DimLevelType : uint8_t { | ||||
Dense, | Dense = 4, // 0b001_00 | ||||
Compressed, CompressedNu, CompressedNo, CompressedNuNo, | Compressed = 8, // 0b010_00 | ||||
Singleton, SingletonNu, SingletonNo, SingletonNuNo, | CompressedNu = 9, // 0b010_01 | ||||
CompressedNo = 10, // 0b010_10 | |||||
CompressedNuNo = 11, // 0b010_11 | |||||
Singleton = 16, // 0b100_00 | |||||
SingletonNu = 17, // 0b100_01 | |||||
SingletonNo = 18, // 0b100_10 | |||||
SingletonNuNo = 19, // 0b100_11 | |||||
}; | }; | ||||
}]; | }]; | ||||
} | } | ||||
def IsSparseTensorPred | def IsSparseTensorPred | ||||
: CPred<"!!::mlir::sparse_tensor::getSparseTensorEncoding($_self)">; | : CPred<"!!::mlir::sparse_tensor::getSparseTensorEncoding($_self)">; | ||||
// The following four follow the same idiom as `TensorOf`, `AnyTensor`, | // The following four follow the same idiom as `TensorOf`, `AnyTensor`, | ||||
Show All 13 Lines |