Sparse matrix-vector multiplication in CUDA

We want to highlight that cuSPARSE (since some time now) makes routines for the multiplication between sparse matrices or between a sparse matrix and a dense vector available. For the csr format, the relevant routine for the multiplication between a sparse matrix and a dense vector is cusparse<t>csrmv. On our GitHub website, a fully worked example showing its use is shown.
More

Calculating the projection of a vector on a set with CUDA

Many times it is necessary to calculate the projection of a vector v on a set of vectors S. By "projection", we mean calculating the element of S whose Euclidean distance is the least from v. This can be done with CUDA Thrust by the following approach: Assume that the vector v is [0 1 12 18 20 3 10 8 5 15] Suppose to arrange the elements of S in a matrix as [ 1 11 12 17 12 10 18 20 15 20 ] [ 6 8 18 13 18 20 3 18 19 6 ] [ 19 8 6 10 8 16 14 11 12 1 ] [ 12 9 12 17 10 16 1 4 4 16 ] [ 1 3 12 12 15 6...
More