SIPR: A New Framework for Generating Efficient Code for Sparse Matrix Computations
Developing computational codes that compute with sparse matrices is a difficult and error-prone process. Automatic generation of sparse code from the corresponding dense version would simplify the programmer's task, provided that a compiler-generated code is fast enough to be used instead of a hand-written code. We propose a new Sparse Intermediate Program Representation (SIPR) that separates the issue of maintaining complicated data structures from the actual matrix computations to be performed. Cost analysis of SIPR allows for the prediction of the program efficiency, and provides a solid basis for choosing efficient sparse implementations among many possible ones. The SIPR framework allows the use of techniques that are frequently used in the handwritten codes but previously were not considered for compiler-generated codes due to their complexity. We have developed tools that allow the automatic generation of efficient C++ implementations from SIPR, and describe experimental results on the performance of those implementations.