MLIR
20.0.0git
|
A memory-resident sparse tensor in coordinate-scheme representation (a collection of Element
s).
More...
#include "mlir/ExecutionEngine/SparseTensor/COO.h"
Public Member Functions | |
SparseTensorCOO (const std::vector< uint64_t > &dimSizes, uint64_t capacity=0) | |
Constructs a new coordinate-scheme sparse tensor with the given sizes and an optional initial storage capacity. More... | |
SparseTensorCOO (uint64_t dimRank, const uint64_t *dimSizes, uint64_t capacity=0) | |
Constructs a new coordinate-scheme sparse tensor with the given sizes and an optional initial storage capacity. More... | |
uint64_t | getRank () const |
Gets the dimension-rank of the tensor. More... | |
const std::vector< uint64_t > & | getDimSizes () const |
Gets the dimension-sizes array. More... | |
const std::vector< Element< V > > & | getElements () const |
Gets the elements array. More... | |
ElementLT< V > | getElementLT () const |
Returns the operator< closure object for the COO's element type. More... | |
void | add (const std::vector< uint64_t > &dimCoords, V val) |
Adds an element to the tensor. More... | |
void | sort () |
Sorts elements lexicographically by coordinates. More... | |
A memory-resident sparse tensor in coordinate-scheme representation (a collection of Element
s).
This data structure is used as an intermediate representation, e.g., for reading sparse tensors from external formats into memory.
|
inlineexplicit |
|
inlineexplicit |
|
inline |
Adds an element to the tensor.
Definition at line 102 of file COO.h.
References mlir::sparse_tensor::SparseTensorCOO< V >::getElementLT(), and mlir::sparse_tensor::SparseTensorCOO< V >::getRank().
|
inline |
|
inline |
Returns the operator<
closure object for the COO's element type.
Definition at line 99 of file COO.h.
References mlir::sparse_tensor::SparseTensorCOO< V >::getRank().
Referenced by mlir::sparse_tensor::SparseTensorCOO< V >::add(), and mlir::sparse_tensor::SparseTensorCOO< V >::sort().
|
inline |
Gets the elements array.
Definition at line 96 of file COO.h.
Referenced by mlir::sparse_tensor::SparseTensorStorage< P, C, V >::SparseTensorStorage().
|
inline |
Gets the dimension-rank of the tensor.
Definition at line 90 of file COO.h.
Referenced by mlir::sparse_tensor::SparseTensorCOO< V >::add(), mlir::sparse_tensor::SparseTensorCOO< V >::getElementLT(), and mlir::sparse_tensor::SparseTensorStorage< P, C, V >::SparseTensorStorage().
|
inline |
Sorts elements lexicographically by coordinates.
If a coordinate is mapped to multiple values, then the relative order of those values is unspecified.
Definition at line 133 of file COO.h.
References mlir::sparse_tensor::SparseTensorCOO< V >::getElementLT().
Referenced by mlir::sparse_tensor::SparseTensorStorage< P, C, V >::SparseTensorStorage().