Storage format

Storage format#

hipSPARSELt uses a structured sparsity storage format, which is represented by an :math:` times n` matrix, where:

  • m = number of rows (integer)

  • n = number of columns (integer)

  • sparsity = 50%, ratio of nnz elements in every 2:1 (int) or 4:2 (others) element along the row (4:2 means every 4 continuous elements will only have 2 nnz elements)

  • compressed matrix = matrix of nnz elements containing data

  • metadata = matrix of nnz elements containing the element indices in every 4:2 or 2:1 array along the row (contents or structure of metadata is dependent on the chosen solution by backend implementation)

Consider the following 4×4 matrix and the structured sparsity structures using m=4,n=4:

A=(1.02.00.00.00.00.03.04.00.06.07.00.00.06.00.08.0)

where

CompressedA=(1.02.03.04.06.07.06.08.0)metadata=(01231213)