[mlir][sparse] add example to attribute doc

Also makes style consistent with the "surrounding"
text that appears on one webpage in MLIR doc

Reviewed By: grosul1

Differential Revision: https://reviews.llvm.org/D107418
This commit is contained in:
Aart Bik 2021-08-03 18:26:28 -07:00
parent 9ab590e3eb
commit 3fc9294873
1 changed files with 21 additions and 5 deletions

View File

@ -23,12 +23,28 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
let mnemonic = "encoding";
let description = [{
An attribute to encode "TACO"-style information (see tensor-compiler.org)
on sparsity properties of tensors. The encoding is eventually used by a
`sparse compiler` pass to generate sparse code fully automatically
for all tensor expressions that involve tensors with a sparse encoding.
Compiler passes that run before this sparse compiler pass need to be
An attribute to encode TACO-style information on sparsity properties
of tensors. The encoding is eventually used by a **sparse compiler**
pass to generate sparse code fully automatically for all tensor
expressions that involve tensors with a sparse encoding. Compiler
passes that run before this sparse compiler pass need to be
aware of the semantics of tensor types with such an encoding.
Example:
```mlir
#DCSC = #sparse_tensor.encoding<{
dimLevelType = [ "compressed", "compressed" ],
dimOrdering = affine_map<(i,j) -> (j,i)>,
pointerBitWidth = 32,
indexBitWidth = 8
}>
... tensor<8x8xf64, #DCSR> ...
```
}];
// Data in sparse tensor encoding.