Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

CUSP : A C++ Templated Sparse Matrix Library

License

NotificationsYou must be signed in to change notification settings

cusplibrary/cusplibrary

Repository files navigation

LinuxWindowsCoverage
LinuxWindowsCoverage

For more information, see the project documentation atCUSP Website.

A Simple Example

#include<cuda.h>#include<thrust/version.h>#include<cusp/version.h>#include<cusp/hyb_matrix.h>#include<cusp/io/matrix_market.h>#include<cusp/krylov/cg.h>#include<iostream>intmain(void){int cuda_major =  CUDA_VERSION /1000;int cuda_minor = (CUDA_VERSION %1000) /10;int thrust_major = THRUST_MAJOR_VERSION;int thrust_minor = THRUST_MINOR_VERSION;int cusp_major = CUSP_MAJOR_VERSION;int cusp_minor = CUSP_MINOR_VERSION;    std::cout <<"CUDA   v" << cuda_major   <<"." << cuda_minor   << std::endl;    std::cout <<"Thrust v" << thrust_major <<"." << thrust_minor << std::endl;    std::cout <<"Cusp   v" << cusp_major   <<"." << cusp_minor   << std::endl;// create an empty sparse matrix structure (HYB format)    cusp::hyb_matrix<int,float, cusp::device_memory> A;// load a matrix stored in Matrix-Market formatcusp::io::read_matrix_market_file(A,"./testing/data/laplacian/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 methodcusp::krylov::cg(A, x, b);return0;}

CUSP is a header-only library. To compile this example clone both CUSP andNvidia/cccl:

git@github.com:cusplibrary/cusplibrary.gitcd cusplibrarygit clone git@github.com:NVIDIA/cccl.gitnvcc -Icccl/thrust -Icccl/libcudacxx/include -Icccl/cub -I. example.cu -o example

Stable Releases

CUSP releases are labeled using version identifiers having three fields:

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

Contributors

CUSP is developed as an open-source project byNVIDIA Research.Nathan Bell was the original creator andSteven Dalton is the current primary contributor.

CUSP is available under the Apache v2.0 open sourceLICENSE

Citing

@MISC{Cusp,  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 ="http://cusplibrary.github.io/", note ="Version 0.5.0"}

[8]ページ先頭

©2009-2025 Movatter.jp