[mlir][sparse] updated our sparse dialect doc with some recent changes

The `init` and `tensor` ops are renamed (and one moved to another dialect).

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D127169
This commit is contained in:
Aart Bik 2022-06-06 17:27:27 -07:00
parent d7df3f0a4b
commit 7482cd6869
1 changed files with 12 additions and 12 deletions

View File

@ -180,9 +180,9 @@ def SparseTensor_LexInsertOp : SparseTensor_Op<"lex_insert", []>,
Inserts the given value at given indices into the underlying sparse
storage format of the given tensor with the given indices. This
operation can only be applied when a tensor materializes unintialized
with an `init` operation, the insertions occur in strict lexicographical
index order, and the final tensor is constructed with a `tensor`
operation that has the `hasInserts` attribute set.
with a `bufferization.alloc_tensor` operation, the insertions occur in
strict lexicographical index order, and the final tensor is constructed
with a `load` operation that has the `hasInserts` attribute set.
Note that this operation is "impure" in the sense that its behavior
is solely defined by side-effects and not SSA values. The semantics
@ -309,12 +309,12 @@ def SparseTensor_ReleaseOp : SparseTensor_Op<"release", []>,
string summary = "Releases underlying sparse storage format of given tensor";
string description = [{
Releases the underlying sparse storage format for a tensor that
materialized earlier through a `new` operator, `init` operator, or a
`convert` operator with an annotated tensor type as destination (unless
that convert is folded away since the source and destination types were
identical). This operation should only be called once for any materialized
tensor. Also, after this operation, any subsequent `memref` querying
operation on the tensor returns undefined results.
materialized earlier through a `new` operation, a `convert` operation
with annotated destination tensor type (unless the convert is folded
away), or a `bufferization.alloc_tensor` operation. The release operation
should only be called once for any materialized tensor. After this
operation, any subsequent `memref` querying operation on the tensor
returns undefined results.
Note that this operation is "impure" in the sense that its behavior
is solely defined by side-effects and not SSA values. The semantics
@ -418,7 +418,7 @@ def SparseTensor_BinaryOp : SparseTensor_Op<"binary", [NoSideEffect]>,
%result = sparse_tensor.binary %a, %b : f64, f64 to f64
overlap={
^bb0(%x: f64, %y: f64):
%cmp = arith.cmpi "uge", %column, %row : index
%cmp = arith.cmpi "uge", %col, %row : index
%upperTriangleResult = arith.addf %x, %y : f64
%lowerTriangleResult = arith.subf %x, %y : f64
%ret = arith.select %cmp, %upperTriangleResult, %lowerTriangleResult : f64
@ -427,9 +427,9 @@ def SparseTensor_BinaryOp : SparseTensor_Op<"binary", [NoSideEffect]>,
left=identity
right={
^bb0(%y: f64):
%cmp = arith.cmpi "uge", %column, %row : index
%cmp = arith.cmpi "uge", %col, %row : index
%lowerTriangleResult = arith.negf %y : f64
%ret = arith.select %cmp, %y, %lowerTriangleResult
%ret = arith.select %cmp, %y, %lowerTriangleResult : f64
sparse_tensor.yield %ret : f64
}
linalg.yield %result : f64