cuda - Conversion from Matlab CSC to CSR format -
i using mex bridge perform operations on sparse matrices matlab. need convert input matrix csr (compressed row storage) format, since matlab stores sparse matrices in csc (compressed column storage).
i able value array , column_indices array. however, struggling row_pointer array csr format.is there c library can in conversion csc csr ?
further, while writing cuda kernel, efficient use csr format sparse operations or should use following arrays :- row indices, column indices , values?
which on give me more control on data, minimizing number for-loops in custom kernel?
compressed row storage similar compressed column storage, transposed. simplest thing use matlab transpose matrix before pass mex file. then, use functions
ap = mxgetjc(spa); ai = mxgetir(spa); ax = mxgetpr(spa);  to internal pointers , treat them row storage. ap row pointer, ai column indices of non-zero entries, ax non-zero values. note symmetric matrices not have @ all! csc , csr same.
which format use heavily depends on want matrix later. example, have @ matrix formats sparse matrix vector multiplication. 1 of classic papers, research has moved since can around further.
Comments
Post a Comment