We are pleased to announce the release of Cusp v0.1, an open-source library for sparse linear algebra and graph computations on CUDA. Cusp provides a flexible, high-level interface for manipulating sparse matrices and solving sparse linear systems. Refer to the QuickStart guide to get started with Cusp today!
Cusp v0.1 provides the following features:
-
Sparse Matrix Support
- COO, CSR, DIA, ELL, and HYB matrix formats
Simplified conversion between all formats
Simplified host<->device transfers
Algorithms
- Efficient sparse matrix-vector multiplication
Matrix transposition
Sparse Solvers
-
Conjugate Gradient method (CG)
BiConjugate Gradient stabilized method (BiCGstab)
Support for user-defined matrix formats and matrix-free methods
Diagonal preconditioner
Dense Matrix Support
And many examples!
As the following example shows, Cusp makes it easy to solve sparse linear systems with CUDA.
[codebox]
#include <cusp/hyb_matrix.h>
#include <cusp/io/matrix_market.h>
#include <cusp/krylov/cg.h>
int main(void)
{
// create an empty sparse matrix structure (HYB format)
cusp::hyb_matrix<int, float, cusp::device_memory> A;
// load a matrix stored in MatrixMarket format
cusp::io::read_matrix_market_file(A, "5pt_10x10.mtx");
// allocate storage for solution ( x ) and right hand side ( b )
cusp::array1d<float, cusp::device_memory> x(A.num_rows, 0);
cusp::array1d<float, cusp::device_memory> b(A.num_rows, 1);
// solve the linear system A * x = b with the Conjugate Gradient method
cusp::krylov::cg( A, x, b ) ;
return 0;
}
[/codebox]