Struct melior::dialect::ods::sparse_tensor::SortCooOperation
source · pub struct SortCooOperation<'c> { /* private fields */ }
Expand description
A sort_coo
operation. Sorts the arrays in xs and ys lexicographically on the integral values found in the xs list.
Sparse_tensor.sort_coo is similar to sparse_tensor.sort, except that all the
xs
values and some ys
values are put in the linear buffer xy
. The
optional index attribute nx
provides the number of xs
values in xy
.
When nx
is not explicitly specified, its value is 1. The optional index
attribute ny
provides the number of ys
values in xy
. When ny
is not
explicitly specified, its value is 0. This instruction supports a more
efficient way to store the COO definition in sparse tensor type.
The buffer xy should have a dimension not less than n * (nx + ny) while the
buffers in ys
should have a dimension not less than n
. The behavior of
the operator is undefined if this condition is not met.
Example:
sparse_tensor.sort_coo insertion_sort_stable %n, %x { nx = 2 : index}
: memref<?xindex>
sparse_tensor.sort hybrid_quick_sort %n, %xy jointly %y1
{ nx = 2 : index, ny = 2 : index}
: memref<?xi64> jointly memref<?xf32>
Implementations§
source§impl<'c> SortCooOperation<'c>
impl<'c> SortCooOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> SortCooOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> SortCooOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.