Struct melior::dialect::ods::sparse_tensor::ToCoordinatesBufferOperation
source · pub struct ToCoordinatesBufferOperation<'c> { /* private fields */ }
Expand description
A coordinates_buffer
operation. Extracts the linear coordinates array from a tensor.
Returns the linear coordinates array for a sparse tensor with
a trailing COO region with at least two levels. It is an error
if the tensor doesn’t contain such a COO region. This is similar
to the bufferization.to_memref
operation in the sense that it
provides a bridge between a tensor world view and a bufferized
world view. Unlike the bufferization.to_memref
operation,
however, this operation actually lowers into code that extracts
the linear coordinates array from the sparse storage scheme that
stores the coordinates for the COO region as an array of structures.
For example, a 2D COO sparse tensor with two non-zero elements at
coordinates (1, 3) and (4, 6) are stored in a linear buffer as
(1, 4, 3, 6) instead of two buffer as (1, 4) and (3, 6).
Writing into the result of this operation is undefined behavior.
Example:
%1 = sparse_tensor.coordinates_buffer %0
: tensor<64x64xf64, #COO> to memref<?xindex>
Implementations§
source§impl<'c> ToCoordinatesBufferOperation<'c>
impl<'c> ToCoordinatesBufferOperation<'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>
) -> ToCoordinatesBufferOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ToCoordinatesBufferOperationBuilder<'c, Unset, Unset>
Creates a builder.