From 93a5dc286e489f661e60436d88e10b11d26cce7d Mon Sep 17 00:00:00 2001 From: Vedant Puri Date: Mon, 2 Oct 2023 18:28:19 -0400 Subject: [PATCH] Fix defaultalg method ambiguity for SciMLOp + GPUArray should fix this error ```julia Candidates: defaultalg(A::SciMLOperators.AbstractSciMLOperator, b, assump::LinearSolve.OperatorAssumptions) @ LinearSolve ~/.julia/packages/LinearSolve/Rq2MY/src/default.jl:132 defaultalg(A, b::GPUArraysCore.AbstractGPUArray, assump::LinearSolve.OperatorAssumptions) @ LinearSolve ~/.julia/packages/LinearSolve/Rq2MY/src/default.jl:106 Possible fix, define defaultalg(::SciMLOperators.AbstractSciMLOperator, ::GPUArraysCore.AbstractGPUArray, ::LinearSolve.OperatorAssumptions) ``` --- src/default.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/default.jl b/src/default.jl index afa16f183..2f35ac17e 100644 --- a/src/default.jl +++ b/src/default.jl @@ -129,7 +129,7 @@ function defaultalg(A::GPUArraysCore.AbstractGPUArray, b::GPUArraysCore.Abstract end end -function defaultalg(A::SciMLBase.AbstractSciMLOperator, b, +function _defaultalg_scimlops(A::SciMLBase.AbstractSciMLOperator, b, assump::OperatorAssumptions) if has_ldiv!(A) return DefaultLinearSolver(DefaultAlgorithmChoice.DirectLdiv!) @@ -145,6 +145,9 @@ function defaultalg(A::SciMLBase.AbstractSciMLOperator, b, end end +defaultalg(A::SciMLBase.AbstractSciMLOperator, b, assump::OperatorAssumptions) = _defaultalg_scimlops(A, b, assump) +defaultalg(A::SciMLBase.AbstractSciMLOperator, b::GPUArraysCore.AbstractGPUArray, assump::OperatorAssumptions) = _defaultalg_scimlops(A, b, assump) + # Allows A === nothing as a stand-in for dense matrix function defaultalg(A, b, assump::OperatorAssumptions) alg = if assump.issq