Skip to content

Commit aad6b3d

Browse files
committed
Don't use wrappertype
1 parent 7b1b7a9 commit aad6b3d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/cusolver/linalg.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# implementation of LinearAlgebra interfaces
22

33
using LinearAlgebra
4-
using LinearAlgebra: BlasComplex, BlasFloat, BlasReal, checksquare, wrappertype
4+
using LinearAlgebra: BlasComplex, BlasFloat, BlasReal, checksquare
55
using ..CUBLAS: CublasFloat
66

77
function copy_cublasfloat(As...)
@@ -143,9 +143,13 @@ end
143143
# matrix functions
144144
for func in (:(Base.exp), :(Base.cos), :(Base.sin), :(Base.tan), :(Base.cosh), :(Base.sinh), :(Base.tanh), :(Base.atan), :(Base.asinh), :(Base.atanh), :(Base.cbrt))
145145
@eval begin
146-
function ($func)(A::Union{Symmetric{T, <:StridedCuMatrix}, Hermitian{T, <:StridedCuMatrix}}) where {T<:BlasReal}
146+
function ($func)(A::Symmetric{T, <:StridedCuMatrix}) where {T<:BlasReal}
147147
F = eigen(A)
148-
return wrappertype(A)((F.vectors * Diagonal(($func).(F.values))) * F.vectors')
148+
return Symmetric((F.vectors * Diagonal(($func).(F.values))) * F.vectors')
149+
end
150+
function ($func)(A::Hermitian{T, <:StridedCuMatrix}) where {T<:BlasReal}
151+
F = eigen(A)
152+
return Hermitian((F.vectors * Diagonal(($func).(F.values))) * F.vectors')
149153
end
150154
function ($func)(A::Hermitian{<:Complex, <:StridedCuMatrix})
151155
F = eigen(A)

0 commit comments

Comments
 (0)