@@ -101,21 +101,32 @@ end
101
101
102
102
Base. copy (D:: Diagonal{T, <:AbstractGPUArray{T, N}} ) where {T, N} = Diagonal (copy (D. diag))
103
103
104
- # prevent scalar indexing
105
- function LinearAlgebra. cholesky! (D:: Diagonal{T, <:AbstractGPUArray{T, N}} ,
106
- :: Val{false} = Val (false ); check:: Bool = true
107
- ) where {T, N}
108
- info = 0
109
- if mapreduce (x -> isreal (x) && isposdef (x), & , D. diag)
110
- D. diag .= sqrt .(D. diag)
111
- else
112
- info = findfirst (x -> ! isreal (x) || ! isposdef (x), collect (D. diag))
113
- check && throw (PosDefException (info))
104
+ if VERSION <= v " 1.8-"
105
+ function LinearAlgebra. cholesky! (D:: Diagonal{<:Any, <:AbstractGPUArray} ,
106
+ :: Val{false} = Val (false ); check:: Bool = true )
107
+ info = 0
108
+ if mapreduce (x -> isreal (x) && isposdef (x), & , D. diag)
109
+ D. diag .= sqrt .(D. diag)
110
+ else
111
+ info = findfirst (x -> ! isreal (x) || ! isposdef (x), collect (D. diag))
112
+ check && throw (PosDefException (info))
113
+ end
114
+ Cholesky (D, ' U' , convert (LinearAlgebra. BlasInt, info))
115
+ end
116
+ else
117
+ function LinearAlgebra. cholesky! (D:: Diagonal{<:Any, <:AbstractGPUArray} ,
118
+ :: NoPivot = NoPivot (); check:: Bool = true )
119
+ info = 0
120
+ if mapreduce (x -> isreal (x) && isposdef (x), & , D. diag)
121
+ D. diag .= sqrt .(D. diag)
122
+ else
123
+ info = findfirst (x -> ! isreal (x) || ! isposdef (x), collect (D. diag))
124
+ check && throw (PosDefException (info))
125
+ end
126
+ Cholesky (D, ' U' , convert (LinearAlgebra. BlasInt, info))
114
127
end
115
- Cholesky (D, ' U' , convert (LinearAlgebra. BlasInt, info))
116
128
end
117
129
118
-
119
130
# # matrix multiplication
120
131
121
132
function generic_matmatmul! (C:: AbstractArray{R} , A:: AbstractArray{T} , B:: AbstractArray{S} , a:: Number , b:: Number ) where {T,S,R}
0 commit comments