主权项 |
1. A method of improving the processing of sparse matrices by a computer system having a limited memory bandwidth, a processor capable of compressing and decompressing data, and a computer readable storage medium that can be used in connection with the processor, the method comprising:
applying, using the processor, a compression algorithm to compress row index data and column index data of a sparse matrix, the compression algorithm including
generating command codes and argument bytes for the matrix,inserting a first command code between rows of the matrix,for each low of the matrix, processing groups of up to four adjacent non-zero elements by encoding a position difference between adjacent groups as argument bytes, using a second command code for an argument greater than one byte corresponding to a size of the groups, andpacking the command codes and argument bytes into words including three command codes per word; storing the compressed row and column index data of the sparse matrix; and accessing, using the processor, the sparse matrix using a merged decompression/matrix-vector multiplication algorithm on the compressed index data and a vector. |