CuSparseMatrxCSC{<:Complex}*CuMatrix{<:Real} triggers allowscalar error
bug
**Describe the bug**
Multiplication of complex CuSparseMatrixCSC and real dense CuMatrix (and vice-versa) fail with `ERROR: LoadError: Scalar indexing is disallowed.`. One would expect the multiplication to proceed, and a resulting complex dense CuMatrix to come out.
**To reproduce**
The Minimal Working Example (MWE) for this bug:
```julia
using CUDA
using CUDA.cuSPARSE
using LinearAlgebra
using SparseArrays
A = CuSparseMatrixCSC(sprand(Float64, 100, 100, 0.01))
B = CUDA.randn(Float64, 100, 100)
C = A * B # works
A = CuSparseMatrixCSC(sprand(ComplexF64, 100, 100, 0.01))
B = CUDA.randn(Float64, 100, 100)
C = A * B # does not work
```
Note: the issue occurs with AMDGPU too. I will link the relevant issue once open. Edit: https://github.com/JuliaGPU/AMDGPU.jl/issues/904
**CUDA.versioninfo():**
```
CUDA toolchain:
- runtime 13.1, artifact installation
- driver 590.48.1 for 13.2
- compiler 13.2
CUDA libraries:
- cuBLAS: 13.2.1
- cuSPARSE: 12.7.3
- cuSOLVER: 12.0.9
- cuFFT: 12.1.0
- cuRAND: 10.4.1
- CUPTI: 2025.4.1 (API 13.1.1)
- NVML: 13.0.0+590.48.1
Julia packages:
- CUDACore: 6.0.0
- GPUArrays: 11.5.3
- GPUCompiler: 1.9.1
- KernelAbstractions: 0.9.41
- CUDA_Driver_jll: 13.2.1+0
- CUDA_Compiler_jll: 0.4.3+0
- CUDA_Runtime_jll: 0.21.0+1
Toolchain:
- Julia: 1.12.6
- LLVM: 18.1.7
Preferences:
- CUDA_Runtime_jll.version: 13.1
4 devices:
0: NVIDIA GH200 120GB (sm_90, 94.347 GiB / 95.577 GiB available)
1: NVIDIA GH200 120GB (sm_90, 94.995 GiB / 95.577 GiB available)
2: NVIDIA GH200 120GB (sm_90, 94.995 GiB / 95.577 GiB available)
3: NVIDIA GH200 120GB (sm_90, 94.993 GiB / 95.577 GiB available)
```
0 条评论