CUSP : A C++ Templated Sparse Matrix Library
Clone or download
sdalton1 Merge pull request #87 from sdalton1/develop
Added initial support for cuda9. Resolves #80, #83, #85, #86.
Latest commit dc77579 Mar 14, 2018

CUSP : A C++ Templated Sparse Matrix Library

Current release : v0.5.1 (April 28, 2015)

Linux Windows Coverage
Linux Windows Coverage

View the project at CUSP Website and the cusp-users discussion forum for information and questions.

A Simple Example

#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;

Stable Releases

CUSP releases are labeled using version identifiers having three fields:

Date Version Date Version
03/13/2015 CUSP v0.5.0
08/30/2013 CUSP v0.4.0
03/08/2012 CUSP v0.3.1
02/04/2012 CUSP v0.3.0
05/30/2011 CUSP v0.2.0
04/28/2015 CUSP v0.5.1 07/10/2010 CUSP v0.1.0


CUSP is developed as an open-source project by NVIDIA Research. Nathan Bell was the original creator and Steven Dalton is the current primary contributor.


  author = "Steven Dalton and Nathan Bell and Luke Olson and Michael Garland",
  title = "Cusp: Generic Parallel Algorithms for Sparse Matrix and Graph Computations",
  year = "2014",
  url = "",
  note = "Version 0.5.0"

Open Source License

CUSP is available under the Apache open-source license:

Copyright 2008-2014 NVIDIA Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.