@@ -1443,10 +1443,13 @@ def ExtractIterSpaceOp : SparseTensor_Op<"extract_iteration_space",
1443
1443
1444
1444
let results = (outs AnySparseIterSpace:$resultSpace);
1445
1445
1446
- let summary = "Extract an iteration space from a sparse tensor between certain levels";
1446
+ let summary = "Extracts an iteration space from a sparse tensor between certain levels";
1447
1447
let description = [{
1448
1448
Extracts a `!sparse_tensor.iter_space` from a sparse tensor between
1449
- certian (consecutive) levels.
1449
+ certain (consecutive) levels. For sparse levels, it is usually done by
1450
+ loading a postion range from the underlying sparse tensor storage.
1451
+ E.g., for a compressed level, the iteration space is extracted by
1452
+ [pos[i], pos[i+1]) supposing the the parent iterator points at `i`.
1450
1453
1451
1454
`tensor`: the input sparse tensor that defines the iteration space.
1452
1455
`parentIter`: the iterator for the previous level, at which the iteration space
@@ -1455,6 +1458,12 @@ def ExtractIterSpaceOp : SparseTensor_Op<"extract_iteration_space",
1455
1458
the returned iteration space covers. `hiLvl - loLvl` defines the dimension of the
1456
1459
iteration space.
1457
1460
1461
+ The type of returned the value is automatically inferred to
1462
+ `!sparse_tensor.iter_space<#INPUT_ENCODING, lvls = $loLvl to $hiLvl>`.
1463
+ The returned iteration space can then be iterated over by
1464
+ `sparse_tensor.iterate` operations to visit every stored element
1465
+ (usually nonzeros) in the input sparse tensor.
1466
+
1458
1467
Example:
1459
1468
```mlir
1460
1469
// Extracts a 1-D iteration space from a COO tensor at level 1.
0 commit comments