JuliaGPU / GPUArrays.jl

Reusable array functionality for Julia's various GPU backends.
MIT License
313 stars 74 forks source link

Abstract type aliases do not match expected types #529

Open maleadt opened 2 months ago

maleadt commented 2 months ago

For example, AbstractGPUVecOrMat:

julia> LinearAlgebra.Adjoint{Float64, Matrix{Float64}} <: AbstractVecOrMat
true

julia> LinearAlgebra.Adjoint{Float64, CuMatrix{Float64}} <: GPUArrays.AbstractGPUVecOrMat
false

... because Adjoint is <: AbstractArray but not <: AbstractGPUArray. This is bad, because it breaks a bunch of generic code, e.g., https://github.com/JuliaLang/julia/pull/53611#issuecomment-2045278635.

I guess this is https://github.com/JuliaLang/julia/issues/51910, however we probably need a different fix in the short term.