Skip to content

Wrong matrix subtyping in cuSPARSE #3104

@gdalle

Description

@gdalle

Describe the bug

Not all sparse matrices in cuSPARSE subtype AbstractCuSparseMatrix.

To reproduce

The Minimal Working Example (MWE) for this bug:

julia> using cuSPARSE  # v6

julia> subtypes(cuSPARSE.AbstractCuSparseMatrix)
2-element Vector{Any}:
 cuSPARSE.CuSparseMatrixBSR
 cuSPARSE.CuSparseMatrixCOO

julia> cuSPARSE.CuSparseMatrixCSR <: cuSPARSE.AbstractCuSparseMatrix
false
Details
(jl_DVUkc0) pkg> st -m
Status `/private/var/folders/pt/myrxq2gs5hzcp79v5475_dh40000gp/T/jl_DVUkc0/Manifest.toml`
  [79e6a3ab] Adapt v4.5.2
  [a9b6321e] Atomix v1.1.3
  [ab4f0b2a] BFloat16s v0.6.1
  [fa961155] CEnum v0.5.0
  [bd0ed864] CUDACore v6.0.0
⌅ [1af6417a] CUDA_Runtime_Discovery v1.0.0
  [e2ba6199] ExprTools v0.1.10
  [0c68f7d7] GPUArrays v11.5.0
  [46192b85] GPUArraysCore v0.2.0
  [61eb1bfa] GPUCompiler v1.9.1
  [096a3bc2] GPUToolbox v1.1.1
  [076d061b] HashArrayMappedTries v0.2.0
  [692b3bcd] JLLWrappers v1.7.1
  [63c18a36] KernelAbstractions v0.9.41
  [929cbde3] LLVM v9.4.6
  [8b046642] LLVMLoopInfo v1.0.0
  [1914dd2f] MacroTools v0.5.16
  [aea7be01] PrecompileTools v1.3.3
  [21216c6a] Preferences v1.5.2
  [74087812] Random123 v1.7.1
  [e6cf234a] RandomNumbers v1.6.0
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.1
  [7e506255] ScopedValues v1.6.0
  [6c6a2e73] Scratch v1.3.0
  [90137ffa] StaticArrays v1.9.18
  [1e83bf80] StaticArraysCore v1.4.4
  [10745b16] Statistics v1.11.1
  [e689c965] Tracy v0.1.6
  [013be700] UnsafeAtomics v0.3.1
  [b26da814] cuSPARSE v6.0.0
  [d1e2174e] CUDA_Compiler_jll v0.4.2+0
  [4ee394cb] CUDA_Driver_jll v13.2.0+0
  [76a88914] CUDA_Runtime_jll v0.21.0+0
  [dad2f222] LLVMExtra_jll v0.0.38+0
  [ad6e5548] LibTracyClient_jll v0.13.1+0
  [0dad84c5] ArgTools v1.1.2
  [56f22d72] Artifacts v1.11.0
  [2a0f44e3] Base64 v1.11.0
  [ade2ca70] Dates v1.11.0
  [f43a241f] Downloads v1.7.0
  [7b1f6079] FileWatching v1.11.0
  [b77e0a4c] InteractiveUtils v1.11.0
  [ac6e5ff7] JuliaSyntaxHighlighting v1.12.0
  [4af54fe1] LazyArtifacts v1.11.0
  [b27032c2] LibCURL v0.6.4
  [76f85450] LibGit2 v1.11.0
  [8f399da3] Libdl v1.11.0
  [37e2e46d] LinearAlgebra v1.12.0
  [56ddb016] Logging v1.11.0
  [d6f4376e] Markdown v1.11.0
  [ca575930] NetworkOptions v1.3.0
  [44cfe95a] Pkg v1.12.1
  [de0858da] Printf v1.11.0
  [9a3f8284] Random v1.11.0
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization v1.11.0
  [2f01184e] SparseArrays v1.12.0
  [f489334b] StyledStrings v1.11.0
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [cf7118a7] UUIDs v1.11.0
  [4ec0a83e] Unicode v1.11.0
  [e66e0078] CompilerSupportLibraries_jll v1.3.0+1
  [deac9b47] LibCURL_jll v8.15.0+0
  [e37daf67] LibGit2_jll v1.9.0+0
  [29816b5a] LibSSH2_jll v1.11.3+1
  [14a3606d] MozillaCACerts_jll v2025.11.4
  [4536629a] OpenBLAS_jll v0.3.29+0
  [458c3c95] OpenSSL_jll v3.5.4+0
  [bea87d4a] SuiteSparse_jll v7.8.3+2
  [83775a58] Zlib_jll v1.3.1+2
  [8e850b90] libblastrampoline_jll v5.15.0+0
  [8e850ede] nghttp2_jll v1.64.0+1
  [3f19e933] p7zip_jll v17.7.0+0

Expected behavior

I expected CuSparseMatrixCSR and CuSparseMatrixCSC to also subtype AbstractCuSparseMatrix

Version info

Details on Julia:

julia> versioninfo()
Julia Version 1.12.6
Commit 15346901f00 (2026-04-09 19:20 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 11 × Apple M3 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, apple-m3)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 5 virtual cores)

Details on CUDA:

julia> CUDA.versioninfo()
ERROR: CUDA driver not found

(I'm on MacOS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions