MLIR  20.0.0git
Public Member Functions | Public Attributes | List of all members
mlir::sparse_tensor::Element< V > Struct Template Referencefinal

An element of a sparse tensor in coordinate-scheme representation (i.e., a pair of coordinates and value). More...

#include "mlir/ExecutionEngine/SparseTensor/COO.h"

Public Member Functions

 Element (const uint64_t *coords, V val)
 

Public Attributes

const uint64_t * coords
 
value
 

Detailed Description

template<typename V>
struct mlir::sparse_tensor::Element< V >

An element of a sparse tensor in coordinate-scheme representation (i.e., a pair of coordinates and value).

For example, a rank-1 vector element would look like ({i}, a[i]) and a rank-5 tensor element would look like ({i,j,k,l,m}, a[i,j,k,l,m])

The coordinates are represented as a (non-owning) pointer into a shared pool of coordinates, rather than being stored directly in this object. This significantly improves performance because it reduces the per-element memory footprint and centralizes the memory management for coordinates. The only downside is that the coordinates themselves cannot be retrieved without knowing the rank of the tensor to which this element belongs (and that rank is not stored in this object).

Definition at line 40 of file COO.h.

Constructor & Destructor Documentation

◆ Element()

template<typename V >
mlir::sparse_tensor::Element< V >::Element ( const uint64_t *  coords,
val 
)
inline

Definition at line 41 of file COO.h.

Member Data Documentation

◆ coords

template<typename V >
const uint64_t* mlir::sparse_tensor::Element< V >::coords

Definition at line 42 of file COO.h.

Referenced by mlir::sparse_tensor::ElementLT< V >::operator()().

◆ value

template<typename V >
V mlir::sparse_tensor::Element< V >::value

Definition at line 43 of file COO.h.


The documentation for this struct was generated from the following file: