Skip to content

Commit 2f0c6df

Browse files
committed
cbrt working
1 parent 2e337d6 commit 2f0c6df

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/cusolver/linalg.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ for func in (:(Base.exp), :(Base.cos), :(Base.sin), :(Base.tan), :(Base.cosh), :
154154
function ($func)(A::Hermitian{<:Complex, <:StridedCuMatrix})
155155
F = eigen(A)
156156
retmat = (F.vectors * Diagonal(($func).(F.values))) * F.vectors'
157-
d_ixs = diagind(retmat, IndexStyle(retmat))
157+
@static if VERSION >= v"1.11"
158+
d_ixs = diagind(retmat, IndexStyle(retmat))
159+
else
160+
d_ixs = diagind(retmat)
161+
end
158162
@. retmat[d_ixs] = real(retmat[d_ixs])
159163
return Hermitian(retmat)
160164
end

test/libraries/cusolver/dense.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,9 +953,11 @@ end
953953
@testset for func in (exp, cos, sin, tan, cosh, sinh, tanh, atan, asinh)
954954
@test Array(func(d_Ah)) func(Ah)
955955
end
956-
@static if VERSION >= v"1.11.0" # not supported on 1.10
957-
@testset for func in (cbrt,) # have to dispatch explicitly
958-
@test Array(parent(func(Hermitian(d_Ah)))) func(Hermitian(Ah))
956+
@static if VERSION >= v"1.11.0" # not supported on 1.10 or for Complex
957+
if elty <: Real
958+
@testset for func in (cbrt,) # have to dispatch explicitly
959+
@test Array(parent(func(Hermitian(d_Ah)))) func(Ah)
960+
end
959961
end
960962
end
961963
end

0 commit comments

Comments
 (0)