Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
1998da9
add SciMLLogging
jClugstor Aug 14, 2025
016af9c
add verbosity types
jClugstor Aug 14, 2025
6caed80
replace verbose::Bool with verbose::LinearVerbosity
jClugstor Aug 14, 2025
1a79bfc
export symbols, include verbosity.jl
jClugstor Aug 14, 2025
ae26192
add verbosity documentation
jClugstor Aug 14, 2025
251e46d
add verbosity to IterativeSolversExt
jClugstor Aug 14, 2025
15e0dfd
add verbosity to KrylovKitExt
jClugstor Aug 14, 2025
f8f8001
add verbose to PardisoExt
jClugstor Aug 14, 2025
bdf19bc
add verbose to HYPREExt
jClugstor Aug 14, 2025
7a550df
add verbose for iterative solvers
jClugstor Aug 14, 2025
154a74f
bring in LinearVerbosity
jClugstor Aug 14, 2025
75c2da0
imports
jClugstor Aug 14, 2025
1e24a57
fix default
jClugstor Aug 14, 2025
7530da9
add tests
jClugstor Aug 14, 2025
911d4c2
make verbose = Bool also valid for backwards compat
jClugstor Aug 14, 2025
22eacf5
allow bool verbose
jClugstor Aug 14, 2025
b903707
fix _init_cacheval
jClugstor Aug 14, 2025
d56e0f1
fix verbose for HYPRE
jClugstor Aug 14, 2025
1ffd734
add compat for SciMLLogging
jClugstor Aug 14, 2025
76d7525
get rid of stale import
jClugstor Aug 14, 2025
76dd068
Update runtests.jl
ChrisRackauckas Aug 18, 2025
a800eb3
change bool to LinearVerbosity
jClugstor Aug 18, 2025
ceabc6c
add messages for fallbacks
jClugstor Aug 18, 2025
90e34d6
make constructor for logging disabled better
jClugstor Aug 22, 2025
118eb30
fix up verbosity for extensions
jClugstor Aug 22, 2025
4c27886
from Bool to LinearVerbosity
jClugstor Aug 22, 2025
bcca2f3
import LinearVerbosity for extensions
jClugstor Aug 22, 2025
352fbd0
fix the imports for CliqueTrees
jClugstor Aug 22, 2025
485e470
fix krylov verbosity
jClugstor Aug 22, 2025
1f5ee5c
update verbosity
jClugstor Sep 21, 2025
32a2956
add more tests for verbosity
jClugstor Sep 21, 2025
ff0da99
make default constructor not do runtime dispatch
jClugstor Sep 21, 2025
68640b6
bump version compat
jClugstor Sep 21, 2025
48c120c
remove incorrect exports
jClugstor Sep 21, 2025
23398ef
fix aqua test
jClugstor Sep 21, 2025
e9fbbc0
fix verbosity kwarg handling
jClugstor Sep 21, 2025
23b3e21
add BLAS verbosity
jClugstor Sep 23, 2025
27b9d27
fix imports for new SciMLLogging version
jClugstor Sep 25, 2025
b429e95
bump SciMLLogging version
jClugstor Sep 25, 2025
ad703da
bring in SciMLLogging imports
jClugstor Sep 25, 2025
8820101
fix up the tests
jClugstor Sep 25, 2025
ed67618
fix imports
jClugstor Sep 25, 2025
aa8cdce
fix more of the imports
jClugstor Sep 25, 2025
5582a7a
explicitely import cond
jClugstor Sep 25, 2025
b90470a
fix stale imports
jClugstor Sep 26, 2025
d8cd3f8
fix custom level stale import
jClugstor Sep 26, 2025
3e38ff6
fix up references to old levels
jClugstor Sep 26, 2025
4e71fda
add blas logging for apple, mkl, openblas
jClugstor Sep 26, 2025
1a06b34
update MessageLevel naming
jClugstor Sep 28, 2025
32444db
make LinearVerbosity concrete, remove setproperty!
jClugstor Sep 28, 2025
ee00c6b
remove test for setproperty!
jClugstor Sep 28, 2025
08f91b7
update to not use bool type parameter
jClugstor Sep 30, 2025
5b74871
bump SciMLLogging version
jClugstor Oct 14, 2025
61c40de
fix imports, test naming
jClugstor Oct 14, 2025
932725e
fix up sparsearraysext
jClugstor Oct 14, 2025
3085323
fix up verbosity presets
jClugstor Oct 14, 2025
dbf28e6
fixes for LinearVerbosity
jClugstor Oct 14, 2025
be8a4c3
fix verbosity tests
jClugstor Oct 14, 2025
0aaaa93
LU fallback should be detailed and above
jClugstor Oct 16, 2025
98a956f
add convergence_failure toggle
jClugstor Oct 18, 2025
b754d3c
fix imports for @SciMLMessage
jClugstor Oct 18, 2025
517e18f
add docstring for LinearVerbosity, spruce up docs page
jClugstor Oct 18, 2025
60fd151
add solver_failure and max_iters as options
jClugstor Oct 19, 2025
cea6024
fix maxiters message
jClugstor Oct 19, 2025
16a2fee
add max_iters message for SimpleGMRES
jClugstor Oct 19, 2025
c1ae892
simple gmres doesn't need it
jClugstor Oct 19, 2025
75910d7
fix verbosity tests
jClugstor Oct 20, 2025
5036f74
fix formatting issues
jClugstor Oct 20, 2025
7d5ce68
warn on Bool
jClugstor Oct 20, 2025
6d12b46
remove bad getproperty
jClugstor Oct 21, 2025
b6b4554
bump SciMLLogging
jClugstor Oct 21, 2025
173c06a
remove verbose = true from tests
jClugstor Oct 21, 2025
5a831df
remove tests for removed feature
jClugstor Oct 21, 2025
9daaeb9
add back verbose kwarg for basic test func
jClugstor Oct 21, 2025
b0f610f
fix another log test
jClugstor Oct 21, 2025
69dea93
move mkl blas stuff out of closure
jClugstor Oct 27, 2025
e832be5
make verbose in to Union{LinearVerbosity, Bool}
jClugstor Oct 28, 2025
83f19e8
fix init_cacheval issues
jClugstor Oct 29, 2025
fd9039f
fix pardiso init_cacheval verbosity
jClugstor Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Preferences = "21216c6a-2e73-6563-6e65-726566657250"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1"
SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Expand Down Expand Up @@ -128,6 +129,7 @@ Reexport = "1.2.2"
SafeTestsets = "0.1"
SciMLBase = "2.70"
SciMLOperators = "1.7.1"
SciMLLogging = "1.3.1"
Setfield = "1.1.1"
SparseArrays = "1.10"
Sparspak = "0.3.9"
Expand Down
66 changes: 66 additions & 0 deletions docs/src/basics/common_solver_opts.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,69 @@ solve completely. Error controls only apply to iterative solvers.
- `maxiters`: The number of iterations allowed. Defaults to `length(prob.b)`
- `Pl,Pr`: The left and right preconditioners, respectively. For more information,
see [the Preconditioners page](@ref prec).

## Verbosity Controls

The verbosity system in LinearSolve.jl provides fine-grained control over the diagnostic messages, warnings, and errors that are displayed during the solution of linear systems. To use this system, a keyword argument `verbose` is provided to `solve`.

```@docs
LinearVerbosity
```

### Basic Usage

#### Global Verbosity Control

```julia
using LinearSolve

# Suppress all messages
verbose = LinearVerbosity(SciMLLogging.None())
prob = LinearProblem(A, b)
sol = solve(prob; verbose=verbose)

# Show only essential messages (critical errors and fatal issues)
verbose = LinearVerbosity(SciMLLogging.Minimal())
sol = solve(prob; verbose=verbose)

# Use default settings (balanced verbosity for typical usage)
verbose = LinearVerbosity(SciMLLogging.Standard())
sol = solve(prob; verbose=verbose)

# Show comprehensive debugging information
verbose = LinearVerbosity(SciMLLogging.Detailed())
sol = solve(prob; verbose=verbose)

# Show all messages (maximum verbosity)
verbose = LinearVerbosity(SciMLLogging.All())
sol = solve(prob; verbose=verbose)
```

#### Group Level Control

```julia
# Customize by category
verbose = LinearVerbosity(
error_control = SciMLLogging.Warn(), # Show warnings for error control related issues
performance = SciMLLogging.Silent(), # Suppress performance messages
numerical = SciMLLogging.Info() # Show all numerical related log messages at info level
)

sol = solve(prob; verbose=verbose)
```

#### Fine-grained Control
The constructor for `LinearVerbosity` allows you to set verbosity for each specific message toggle, giving you fine-grained control.
The verbosity settings for the toggles are automatically passed to the group objects.
```julia
# Set specific message types
verbose = LinearVerbosity(
default_lu_fallback = SciMLLogging.InfoLevel(), # Show info when LU fallback is used
KrylovJL_verbosity = SciMLLogging.WarnLevel(), # Show warnings from KrylovJL
no_right_preconditioning = SciMLLogging.Silent(), # Suppress right preconditioning messages
KrylovKit_verbosity = SciMLLogging.Level(KrylovKit.WARN_LEVEL) # Set KrylovKit verbosity level using KrylovKit's own verbosity levels
)

sol = solve(prob; verbose=verbose)

```
6 changes: 3 additions & 3 deletions ext/LinearSolveAMDGPUExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module LinearSolveAMDGPUExt

using AMDGPU
using LinearSolve: LinearSolve, LinearCache, AMDGPUOffloadLUFactorization,
AMDGPUOffloadQRFactorization, init_cacheval, OperatorAssumptions
AMDGPUOffloadQRFactorization, init_cacheval, OperatorAssumptions, LinearVerbosity
using LinearSolve.LinearAlgebra, LinearSolve.SciMLBase

# LU Factorization
Expand All @@ -25,7 +25,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::AMDGPUOffloadLUFa
end

function LinearSolve.init_cacheval(alg::AMDGPUOffloadLUFactorization, A, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
AMDGPU.rocSOLVER.getrf!(AMDGPU.ROCArray(A))
end
Expand Down Expand Up @@ -57,7 +57,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::AMDGPUOffloadQRFa
end

function LinearSolve.init_cacheval(alg::AMDGPUOffloadQRFactorization, A, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
A_gpu = AMDGPU.ROCArray(A)
tau = AMDGPU.ROCVector{eltype(A_gpu)}(undef, min(size(A_gpu)...))
Expand Down
41 changes: 38 additions & 3 deletions ext/LinearSolveBLISExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ using LinearSolve
using LinearAlgebra: BlasInt, LU
using LinearAlgebra.LAPACK: require_one_based_indexing, chkfinite, chkstride1,
@blasfunc, chkargsok
using LinearSolve: ArrayInterface, BLISLUFactorization, @get_cacheval, LinearCache, SciMLBase
using LinearSolve: ArrayInterface, BLISLUFactorization, @get_cacheval, LinearCache, SciMLBase, LinearVerbosity, get_blas_operation_info, blas_info_msg
using SciMLLogging: SciMLLogging, @SciMLMessage
using SciMLBase: ReturnCode

const global libblis = blis_jll.blis
Expand Down Expand Up @@ -206,13 +207,13 @@ const PREALLOCATED_BLIS_LU = begin
end

function LinearSolve.init_cacheval(alg::BLISLUFactorization, A::Matrix{Float64}, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
PREALLOCATED_BLIS_LU
end

function LinearSolve.init_cacheval(alg::BLISLUFactorization, A::AbstractMatrix{<:Union{Float32,ComplexF32,ComplexF64}}, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
A = rand(eltype(A), 0, 0)
ArrayInterface.lu_instance(A), Ref{BlasInt}()
Expand All @@ -222,13 +223,47 @@ function SciMLBase.solve!(cache::LinearCache, alg::BLISLUFactorization;
kwargs...)
A = cache.A
A = convert(AbstractMatrix, A)
verbose = cache.verbose
if cache.isfresh
cacheval = @get_cacheval(cache, :BLISLUFactorization)
res = getrf!(A; ipiv = cacheval[1].ipiv, info = cacheval[2])
fact = LU(res[1:3]...), res[4]
cache.cacheval = fact

info_value = res[3]

if info_value != 0
if !isa(verbose.blas_info, SciMLLogging.Silent) || !isa(verbose.blas_errors, SciMLLogging.Silent) ||
!isa(verbose.blas_invalid_args, SciMLLogging.Silent)
op_info = get_blas_operation_info(:dgetrf, A, cache.b, condition = !isa(verbose.condition_number, SciMLLogging.Silent))
@SciMLMessage(cache.verbose, :condition_number) do
if op_info[:condition_number] === nothing
return "Matrix condition number calculation failed."
else
return "Matrix condition number: $(round(op_info[:condition_number], sigdigits=4)) for $(size(A, 1))×$(size(A, 2)) matrix in dgetrf"
end
end
verb_option, message = blas_info_msg(
:dgetrf, info_value; extra_context = op_info)
@SciMLMessage(message, verbose, verb_option)
end
else
@SciMLMessage(cache.verbose, :blas_success) do
op_info = get_blas_operation_info(:dgetrf, A, cache.b,
condition = !isa(verbose.condition_number, SciMLLogging.Silent))
@SciMLMessage(cache.verbose, :condition_number) do
if op_info[:condition_number] === nothing
return "Matrix condition number calculation failed."
else
return "Matrix condition number: $(round(op_info[:condition_number], sigdigits=4)) for $(size(A, 1))×$(size(A, 2)) matrix in dgetrf"
end
end
return "BLAS LU factorization (dgetrf) completed successfully for $(op_info[:matrix_size]) matrix"
end
end

if !LinearAlgebra.issuccess(fact[1])
@SciMLMessage("Solver failed", cache.verbose, :solver_failure)
return SciMLBase.build_linear_solution(
alg, cache.u, nothing, cache; retcode = ReturnCode.Failure)
end
Expand Down
8 changes: 4 additions & 4 deletions ext/LinearSolveBandedMatricesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module LinearSolveBandedMatricesExt
using BandedMatrices, LinearAlgebra, LinearSolve
import LinearSolve: defaultalg,
do_factorization, init_cacheval, DefaultLinearSolver,
DefaultAlgorithmChoice
DefaultAlgorithmChoice, LinearVerbosity

# Defaults for BandedMatrices
function defaultalg(A::BandedMatrix, b, oa::OperatorAssumptions{Bool})
Expand Down Expand Up @@ -41,14 +41,14 @@ for alg in (:SVDFactorization, :MKLLUFactorization, :DiagonalFactorization,
:AppleAccelerateLUFactorization, :CholeskyFactorization)
@eval begin
function init_cacheval(::$(alg), ::BandedMatrix, b, u, Pl, Pr, maxiters::Int,
abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
abstol, reltol, verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions)
return nothing
end
end
end

function init_cacheval(::LUFactorization, A::BandedMatrix{T}, b, u, Pl, Pr, maxiters::Int,
abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions) where {T}
abstol, reltol, verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions) where {T}
(T <: BigFloat) && return qr(similar(A, 0, 0))
return lu(similar(A, 0, 0))
end
Expand All @@ -61,7 +61,7 @@ for alg in (:SVDFactorization, :MKLLUFactorization, :DiagonalFactorization,
:AppleAccelerateLUFactorization, :QRFactorization, :LUFactorization)
@eval begin
function init_cacheval(::$(alg), ::Symmetric{<:Number, <:BandedMatrix}, b, u, Pl,
Pr, maxiters::Int, abstol, reltol, verbose::Bool,
Pr, maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
return nothing
end
Expand Down
16 changes: 8 additions & 8 deletions ext/LinearSolveCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using LinearSolve: LinearSolve, is_cusparse, defaultalg, cudss_loaded, DefaultLi
error_no_cudss_lu, init_cacheval, OperatorAssumptions,
CudaOffloadFactorization, CudaOffloadLUFactorization, CudaOffloadQRFactorization,
CUDAOffload32MixedLUFactorization,
SparspakFactorization, KLUFactorization, UMFPACKFactorization
SparspakFactorization, KLUFactorization, UMFPACKFactorization, LinearVerbosity
using LinearSolve.LinearAlgebra, LinearSolve.SciMLBase, LinearSolve.ArrayInterface
using SciMLBase: AbstractSciMLOperator

Expand Down Expand Up @@ -53,7 +53,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::CudaOffloadLUFact
end

function LinearSolve.init_cacheval(alg::CudaOffloadLUFactorization, A::AbstractArray, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
# Check if CUDA is functional before creating CUDA arrays
if !CUDA.functional()
Expand Down Expand Up @@ -81,7 +81,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::CudaOffloadQRFact
end

function LinearSolve.init_cacheval(alg::CudaOffloadQRFactorization, A, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
# Check if CUDA is functional before creating CUDA arrays
if !CUDA.functional()
Expand All @@ -105,26 +105,26 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::CudaOffloadFactor
end

function LinearSolve.init_cacheval(alg::CudaOffloadFactorization, A::AbstractArray, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
qr(CUDA.CuArray(A))
end

function LinearSolve.init_cacheval(
::SparspakFactorization, A::CUDA.CUSPARSE.CuSparseMatrixCSR, b, u,
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions)
nothing
end

function LinearSolve.init_cacheval(
::KLUFactorization, A::CUDA.CUSPARSE.CuSparseMatrixCSR, b, u,
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions)
nothing
end

function LinearSolve.init_cacheval(
::UMFPACKFactorization, A::CUDA.CUSPARSE.CuSparseMatrixCSR, b, u,
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
Pl, Pr, maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions)
nothing
end

Expand Down Expand Up @@ -158,7 +158,7 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::CUDAOffload32Mixe
end

function LinearSolve.init_cacheval(alg::CUDAOffload32MixedLUFactorization, A, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
# Pre-allocate with Float32 arrays
m, n = size(A)
Expand Down
4 changes: 2 additions & 2 deletions ext/LinearSolveCUSOLVERRFExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ using SciMLBase: SciMLBase, LinearProblem, ReturnCode
function LinearSolve.init_cacheval(alg::LinearSolve.CUSOLVERRFFactorization,
A, b, u, Pl, Pr,
maxiters::Int, abstol, reltol,
verbose::Bool, assumptions::OperatorAssumptions)
verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions)
nothing
end

function LinearSolve.init_cacheval(alg::LinearSolve.CUSOLVERRFFactorization,
A::Union{CuSparseMatrixCSR{Float64, Int32}, SparseMatrixCSC{Float64, <:Integer}},
b, u, Pl, Pr,
maxiters::Int, abstol, reltol,
verbose::Bool, assumptions::OperatorAssumptions)
verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions)
# Create initial factorization with appropriate options
nrhs = b isa AbstractMatrix ? size(b, 2) : 1
symbolic = alg.symbolic
Expand Down
2 changes: 1 addition & 1 deletion ext/LinearSolveCliqueTreesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end

function LinearSolve.init_cacheval(
alg::CliqueTreesFactorization, A::AbstractMatrix, b, u, Pl, Pr, maxiters::Int, abstol,
reltol, verbose::Bool, assumptions::OperatorAssumptions)
reltol, verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions)
symbfact = _symbolic(A, alg)
cholfact, cholwork = cholinit(A, symbfact)
linwork = lininit(1, cholfact)
Expand Down
4 changes: 2 additions & 2 deletions ext/LinearSolveFastAlmostBandedMatricesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module LinearSolveFastAlmostBandedMatricesExt
using FastAlmostBandedMatrices, LinearAlgebra, LinearSolve
import LinearSolve: defaultalg,
do_factorization, init_cacheval, DefaultLinearSolver,
DefaultAlgorithmChoice
DefaultAlgorithmChoice, LinearVerbosity

function defaultalg(A::AlmostBandedMatrix, b, oa::OperatorAssumptions{Bool})
if oa.issq
Expand All @@ -21,7 +21,7 @@ for alg in (:SVDFactorization, :MKLLUFactorization, :DiagonalFactorization,
:AppleAccelerateLUFactorization, :CholeskyFactorization, :LUFactorization)
@eval begin
function init_cacheval(::$(alg), ::AlmostBandedMatrix, b, u, Pl, Pr, maxiters::Int,
abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
abstol, reltol, verbose::Union{LinearVerbosity, Bool}, assumptions::OperatorAssumptions)
return nothing
end
end
Expand Down
11 changes: 6 additions & 5 deletions ext/LinearSolveFastLapackInterfaceExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module LinearSolveFastLapackInterfaceExt

using LinearSolve, LinearAlgebra
using LinearSolve: LinearVerbosity
using FastLapackInterface

struct WorkspaceAndFactors{W, F}
Expand All @@ -9,7 +10,7 @@ struct WorkspaceAndFactors{W, F}
end

function LinearSolve.init_cacheval(::FastLUFactorization, A, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
ws = LUWs(A)
return WorkspaceAndFactors(
Expand All @@ -36,26 +37,26 @@ end

function LinearSolve.init_cacheval(
alg::FastQRFactorization{NoPivot}, A::AbstractMatrix, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
ws = QRWYWs(A; blocksize = alg.blocksize)
return WorkspaceAndFactors(ws,
LinearSolve.ArrayInterface.qr_instance(convert(AbstractMatrix, A)))
end
function LinearSolve.init_cacheval(
::FastQRFactorization{ColumnNorm}, A::AbstractMatrix, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
ws = QRpWs(A)
return WorkspaceAndFactors(ws,
LinearSolve.ArrayInterface.qr_instance(convert(AbstractMatrix, A)))
end

function LinearSolve.init_cacheval(alg::FastQRFactorization, A, b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
return init_cacheval(alg, convert(AbstractMatrix, A), b, u, Pl, Pr,
maxiters::Int, abstol, reltol, verbose::Bool,
maxiters::Int, abstol, reltol, verbose::Union{LinearVerbosity, Bool},
assumptions::OperatorAssumptions)
end

Expand Down
Loading
Loading