Skip to content

Commit 62cdcbf

Browse files
fix GPU tests
1 parent d315d13 commit 62cdcbf

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/factorization.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,20 @@ function init_cacheval(
213213
ArrayInterface.lu_instance(convert(AbstractMatrix, A))
214214
end
215215

216-
function init_cacheval(alg::Union{LUFactorization, GenericLUFactorization},
216+
function init_cacheval(alg::LUFactorization,
217217
A::Union{<:Adjoint, <:Transpose}, b, u, Pl, Pr, maxiters::Int, abstol, reltol,
218218
verbose::Bool, assumptions::OperatorAssumptions)
219219
error_no_cudss_lu(A)
220-
if alg isa LUFactorization
221-
return lu(A; check = false)
222-
else
223-
A isa GPUArraysCore.AnyGPUArray && return nothing
224-
ipiv = Vector{LinearAlgebra.BlasInt}(undef, 0)
225-
return LinearAlgebra.generic_lufact!(copy(A), alg.pivot; check = false)
226-
end
220+
return lu(A; check = false)
221+
end
222+
223+
function init_cacheval(alg::GenericLUFactorization,
224+
A::Union{<:Adjoint, <:Transpose}, b, u, Pl, Pr, maxiters::Int, abstol, reltol,
225+
verbose::Bool, assumptions::OperatorAssumptions)
226+
error_no_cudss_lu(A)
227+
A isa GPUArraysCore.AnyGPUArray && return nothing
228+
ipiv = Vector{LinearAlgebra.BlasInt}(undef, 0)
229+
return LinearAlgebra.generic_lufact!(copy(A), alg.pivot; check = false), ipiv
227230
end
228231

229232
const PREALLOCATED_LU = ArrayInterface.lu_instance(rand(1, 1))

0 commit comments

Comments
 (0)