I work on converting a large Matlab code to C++ and CUDA. I have problems converting some sparse matrix operations like:

```
1. full_Matrix * sparse_Matrix
2. sparse_Matrix * full_Matrix
3. sparse_Matrix * sparse_Matrix (SOLVED WITH CUSP)
4. full_Matrix .* sparse_Matrix (elementwise multiplication)
5. sparse_Matrix * full_Matrix (elementwise multiplication)
6. sparse_Matrix .* sparse_Matrix (elementwise multiplication)
```

I was able to solve 2 using CUSPARSE and 3 using CUSP, however I wasn't able to use CUSP (or CUSPARSE) for elementwise matrix multiplication or for problem 1.

I'm interested if there is a CUDA library that implements all the above operations (preferably an open source one).

Thanks

This link may help you.

Sparse Matrix Multiplication on CUDA

Similar Questions

Hello I know there are a lot of questions on sparse matrix multiplication, but many of the answers say to just use libraries. I want to do it without using library functions. So far I've done the easy

I have a scipy sparse matrix, where I need to add multiple rows (in blocks), say 1:30, then 45:50, etc. What is the most efficient way to do this?

I'm looking for any standard C program that uses OpenMP APIs for a sparse matrix-vector or matrix-matrix multiplications. Can anyone let me know if there are any such programs.

I have a sparse matrix W, when I use linalg.pinv(W), it throws some errors: Traceback (most recent call last): File /Users/ad9075/PycharmProjects/bednmf/test.py, line 14, in testNmfRun self.factor =

I'm using numpy and scipy. I have a large sparse matrix and I want to find the largest eigenvalue of the sparse matrix. How can I do that?

If you have a sparse matrix X: >> print type(X) <class 'scipy.sparse.csr.csr_matrix'> ...How can you sum the squares of each element in each row, and save them into a list? For example: &

Basically, I am just trying to do a simple matrix multiplication, specifically, extract each column of it and normalize it by dividing it with its length. #csc sparse matrix self.__WeightMatrix__ = s

How can you add a 1-column matrix to a sparse matrix, or add a sparse matix to a column matrix (either way)? It shouldn't replace the data, just join it into one data type. The sparse matrix: >>

EDITED to correspond with current state after linked question. I am currently trying to reimplement basic Matrix multiplication in CUDA, and while my code works fine for Square matrices, and Rectangul

I have the following code in Python using Numpy: p = np.diag(1.0 / np.array(x)) How can I transform it to get the sparse matrix p2 with the same values as p without creating p first?

As I am a SCHEME beginner, I am having a tough time figuring out how to work with matrices. I am unsure on how to do the following: A) Given a matrix, return the dimensions of said matrix EX:// '(2 3

I am trying to do some k-means clustering on a very large matrix. The matrix is approximately 500000 rows x 4000 cols yet very sparse (only a couple of 1 values per row). The whole thing does not f

I need a command to check for zero sparse matrix, isempty(..) does not work. Is there some sparse version of isempty(..)? >> mlf2=sparse([],[],[],2^31+1,1) mlf2 = All zero sparse: 2147483649-by-

I want to implement some matrixâ€“vector math. There are vector types like: float2, int2, but I cannot find any built-in type matrix in CUDA. Is there a library that suitable for such operations?

Is it possible to report number of operations to evaluate for example matrix/matrix (dense or sparse) in MATLAB or octave.

I want to initialise a sparse matrix (for use with scipy minimum_spanning_tree if that matters) from a list of matrix coordinates and values. That is, I have: coords - Nx2 array of coordinates to be s

I don`t know how to solve this problem in Fundamentals of data structure in C ed.2nd ch2.5 On a computer with w bits per word, how much storage is needed to represent a sparse matrix, A, with t nonzer

I am having problem with 3 loops in Python. The purpose of this code is to calculate sparse matrix according to number of (x) unknown values of DATA. Here, x number is 13 , which means unrepeated valu

I wanted CSR files preferably from matrix market for my OpenCL library, I searched a lot for CSR generators in C but didn't get any. I find matrix market formats comfortable since they have defined th

I have two large square sparse matrices, A & B, and need to compute the following: A * B^-1 in the most efficient way. I have a feeling that the answer involves using scipy.sparse, but can't for t

I need to pass a scipy.sparse CSR matrix to a cython function. How do I specify the type, as one would for a numpy array?

I'm trying to cluster some data with python and scipy but the following code does not work for reason I do not understand: from scipy.sparse import * matrix = dok_matrix((en,en), int) for pub in pubs:

say I want to multiply two matrices together, 50 by 50. I have 2 ways to arrange threads and blocks. a) one thread to calculate each element of the result matrix. So I have a loop in thread multiplies

I am trying to find the indices of nonzero entries by row in a sparse matrix: scipy.sparse.csc_matrix. So far, I am looping over each row in the matrix, and using numpy.nonzero() to each row to get t

I have two dimensional matrix. My matrix is sparse. I am facing performance problem. Can any body please answer that what api or class i can use in java to handle sparse matrix to improve my program p

Does anyone know how to perform svd operation on a sparse matrix in python? It seems that there is no such functionality provided in scipy.sparse.linalg.

This Sparse Matrix and its 3-Tuple representation is not getting into my head... Either its bit tricky or my resources from where I am studying are really not that good... here is the URI Sparse Matri

I'm looking for an a command or trick to convert two arrays to a sparse matrix. The two arrays contain x-values and y-values, which gives a coordinate in the cartesian coordinate system. I want to gro

I have a sparse matrix A, generated as an output of glmnet function. When I print the matrix A, it shows all the entries and at the top it reads - 1897 x 100 sparse Matrix of class dgCMatrix [[ su

I need to do matrix operations (mainly multiply and inverse) of a sparse matrix SparseMat in OpenCV. I noticed that you can only iterate and insert values to SparseMat. Is there an external code I can

I want to pass a sparse matrix to a shared library from MATLAB, do some operation there (written in C), and then return it. I can pass a dense matrix and use, pretty easy. But, I have no idea how to p

I need to implement operations with matrices and size of matrix has to be variable. The only solution I came up with is to use linked list: [pointer to this row, pointer to another row] -> [element

I am implementing a sparse matrix based on the Stack class, and I'm getting the following error: Sparse.java:6: Sparse is not abstract and does not override abstract method pop() in Stack public clas

I got some sparse matrix like this >>>import numpy as np >>>from scipy.sparse import * >>>A = csr_matrix((np.identity(3))) >>>print A (0, 0) 1.0 (1, 1) 1.0 (2, 2) 1

I am planning to evaluate spark for machine learning algorithm implementations. Usually the algorithms I implement are expressed as matrix operations. I've 2 questions regarding that- Should algorith

I am working on something that has highlighted the fact I don't have a firm grasp of how blocks and grids work in cuda. I have a 1000x10 matrix that I would like to traverse and fill in each element w

I'm writing a SpMxV (sparse matrix vector multiplication) program where I store the sparse matrix in a CRS format and then carry out the operations. Here's a short introduction on the format. I know h

I want to test some of the newer sparse linear solvers and I want to know if there is a fast way of filling in the matrix. The format I'm interested is CSR (http://goo.gl/hLXYd). Let's say the matrix,

I need to create spare matrices with variable elements. Unfortunately, sparse matrix index operations are very slow. Is there any way to speed up the process? Maybe there are some tricks that I don't

I need to store a sparse matrix on disk. It is like a database table with millions of rows and thousands of columns, where many or most columns are null. It needs to be queryable, like a SQL SELECT wi

I have a large scipy sparse matrix, which is taking up >90% of my total system memory. I would like to save it to disk, as it takes hours to build the matrix... I tried cPickle, but that leads to a

I am looking for some sparse linear algebra OpenCL kernels such as blas vector/vector operations and matrix / vector operations but with sparse data structures. Ideally that library would feature most

I am trying to run the full SVD of a large (120k x 600k) and sparse (0,1% of non-null values) matrix M. Due to memory limitation all my previous attempts failed (with SVDLIBC, Octave, and R) and I am

How can I create a sparse matrix from a list of dimension names? Suppose you have this matrix edgelist in a data frame: from to weight 1 4 a 1 2 5 b 2 3 6 c 3 It can be created like this: from <-

The idea of my simple program that I've been trying to write is to take input from the user to see how large of a matrix to multiply. I am looking to take the input x by x, I am not currently looking

I need to create a matrix with values from a numpy array. The values should be distributed over the matrix lines according to an array of indices. Like this: >>> values array([ 0.73620381, 0.

I need to calculate the following matrix math: D * A Where D is dense, and A is sparse, in CSC format. cuSPARSE allows multiplying sparse * dense, where sparse matrix is in CSR format. Following a rel

The following code runs too slowly even though everything seems to be vectorized. from numpy import * from scipy.sparse import * n = 100000; i = xrange(n); j = xrange(n); data = ones(n); A=csr_matrix

I would like to know the best way to check if a scipy sparse matrix, if CSC or CSR. Right now I'm using. rows, cols = X.shape() indptr = X.indptr() if len(indptr) == cols + 1: print csc else: print

I have a large sparse graph that I am representing as an adjacency matrix (100k by 100k or bigger), stored as an array of edges. An example with a (non-sparse) 4 by 4 matrix: 0 7 4 0 example_array = [