Can I use CuSpareMatrixCSC with Complex entries for ODE solving?

(Apologies if this is confusing - this is my first post, and first time I haven’t been able to find my answer already on the forum!)

I have been trying to rewrite some old CPU code that used Sparse Matrices with ComplexF64 entries. My silly solution for this has been to take all of my sparse arrays and recast them via

A_d = CuSparseMatrixCSC(A)

giving me a typeof(A_d) = CuSparseMatrixCSC{ComplexF64, Int32}.

When I try to solve my ODE using the DifferentialEquations package, I obtain the following error:

MethodError: no method matching CuSparseMatrixCSC{ComplexF64, Int32}(::SparseMatrixCSC{ComplexF64, Int64})
The type `CuSparseMatrixCSC{ComplexF64, Int32}` exists, but no method is defined for this combination of argument types when trying to construct it.

Is there a way for me to use sparse Cuda arrays with complex entries just by recasting them to the right type? Or will this require something much more involved. Happy to share whatever code excerpts that may be useful!

The constructors we have do not take an index type, because CUSPARSE only supports Int32 indices: CUDA.jl/lib/cusparse/array.jl at 7d23bbf50bd8792f2ba81248c3e1f21079a39bff · JuliaGPU/CUDA.jl · GitHub. So calling the constructor should work fine if you drop the Int32. This could probably be improved; PRs welcome.

Also note that you can simply create sparse CPU arrays by calling cu on sparse CPU arrays.