-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a CuSparseMatrixCOO type #220
Comments
On a related note, I tried initializing a COO matrix in the format required by the generic function API (https://docs.nvidia.com/cuda/cusparse/index.html#cusparse-generic-spmat-create-coo), but this ended up segfaulting Julia. Any ideas on what might be going wrong here? using CuArrays
CuArrays.allowscalar(false)
nnz = 30000
num_rows = 10000
num_cols = num_rows
rows = rand(1:num_rows, nnz)
cols = rand(1:num_cols, nnz)
nnzvals = zeros(Float32, nnz)
M = CUSPARSE.cusparseCreateCoo(CUSPARSE.cusparseSpMatDescr_t(),
num_rows,
num_cols,
nnz,
cu(rows),
cu(cols),
cu(nnzvals),
CUSPARSE.CUSPARSE_INDEX_64I,
CUSPARSE.cusparseindex('O'),
cudaDataType(Float32))
|
FWIW I also tried once to create a COO matrix like this and similarly was getting segfaults. I don't recall if its exactly what you did above, but I confirm that when I run your code above with CuArrays 2.2.0 / CUDA version 10.1 I get a segfault. Would be great to have a solution to this, since COO is often logically the easiest to construct, and for now I'm having to do that on CPU, convert to CSC, then convert to CuSparseMatrixCSC, which is leaving alot of performance on the table. |
Hello @marius311 and @irhum, I can try to take a crack at this. |
Fyi I have a |
It appears that the generic
cusparseSpMM
method offered by the C++ CUSPARSE API also allows the usage of a COO matrix (https://docs.nvidia.com/cuda/cusparse/index.html#cusparse-generic-function-spmm) and as of today, CUDA.jl doesn't seem to have a wrapper COO type that would allow higher level access in Julia to the API (kind of like how, since CuSparseMatrixCSR is defined to have amul!
method)How would one go around defining a new
CuSparseMatrixCOO
type to implement similar functionality as well?The text was updated successfully, but these errors were encountered: