Skip to content

Commit

Permalink
Merge pull request #26 from JuliaGPU/vc/fix_inlining
Browse files Browse the repository at this point in the history
remove unused type parameters that cause inlining issues
  • Loading branch information
maleadt authored Jun 23, 2020
2 parents b185437 + a890a50 commit 7a159f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ const WrappedArray{T,N,Src,Dst} = @eval Union{$([W for (W,ctor) in Adapt._wrappe
# https://github.com/JuliaLang/julia/pull/31563

# accessors for extracting information about the wrapper type
Base.ndims(W::Type{<:WrappedArray{T,N,Src,Dst}}) where {T,N,Src,Dst} = @isdefined(N) ? N : specialized_ndims(W)
Base.eltype(::Type{<:WrappedArray{T,N,Src,Dst}}) where {T,N,Src,Dst} = T # every wrapper has a T typevar
Base.parent(W::Type{<:WrappedArray{T,N,Src,Dst}}) where {T,N,Src,Dst} = @isdefined(Dst) ? Dst.name.wrapper : Src.name.wrapper
Base.ndims(W::Type{<:WrappedArray{<:Any,N}}) where {N} = @isdefined(N) ? N : specialized_ndims(W)
Base.eltype(::Type{<:WrappedArray{T}}) where {T} = T # every wrapper has a T typevar
Base.parent(::Type{<:WrappedArray{<:Any,<:Any,Src,Dst}}) where {Src,Dst} = @isdefined(Dst) ? Dst.name.wrapper : Src.name.wrapper

# some wrappers don't have a N typevar because it is constant, but we can't extract that from <:WrappedArray
specialized_ndims(::Type{<:LinearAlgebra.Adjoint}) = 2
Expand Down

0 comments on commit 7a159f6

Please sign in to comment.