# SparseArrays vs CUSPARSE

**URL:** <https://discourse.julialang.org/t/sparsearrays-vs-cusparse/135320>\
**Category:** General Usage\
**Tags:** cuda, sparse\
**Created:** [January 29, 2026, 10:55am UTC](https://discourse.julialang.org/t/sparsearrays-vs-cusparse/135320 "2026-01-29T10:55:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcalxrc08](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rcalxrc08/32/14973_2.png) [@rcalxrc08](https://discourse.julialang.org/u/rcalxrc08)\
**Post date:** [January 29, 2026, 10:55am UTC](https://discourse.julialang.org/t/sparsearrays-vs-cusparse/135320/1 "2026-01-29T10:55:13Z")

</div>

I have no idea if this is intentional or not, at the moment there is an inconstency in the julia and or CUDA stack when dense and sparse vectors are interacting:

```julia
using SparseArrays, CUDA
N=10
x_cpu=randn(N);
x_sparse=sparse(x_cpu);
x_gpu=cu(x_cpu);
x_sparse_gpu=cu(x_sparse);
res_cpu=@. x_sparse * x_cpu;
res_gpu=@. x_sparse_gpu * x_gpu;
@show issparse(res_cpu) #true
@show issparse(res_gpu) #false

```

I have a custom array library and honestly I have no idea what to return in case of sparse arrays (CPU or GPU doesn’t matter), I would like to know to what to give precedence, hence:

- Dense op Sparse = Sparse

or

- Dense op Sparse = Dense

The original issue is [here](https://github.com/rcalxrc08/AlternateVectors.jl/issues/6).
