Skip to content

Commit f7e0e32

Browse files
Simplify a ton since the bound is now v1.9
1 parent cea1a07 commit f7e0e32

File tree

6 files changed

+71
-133
lines changed

6 files changed

+71
-133
lines changed

Project.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,33 @@ ArrayInterface = "7.4.11"
6262
BandedMatrices = "1"
6363
BlockDiagonals = "0.1"
6464
ConcreteStructs = "0.2"
65-
DocStringExtensions = "0.8, 0.9"
65+
DocStringExtensions = "0.9"
6666
EnumX = "1"
67-
EnzymeCore = "0.5, 0.6"
68-
FastLapackInterface = "1, 2"
67+
EnzymeCore = "0.6"
68+
FastLapackInterface = "2"
6969
GPUArraysCore = "0.1"
7070
HYPRE = "1.4.0"
7171
InteractiveUtils = "1.6"
7272
IterativeSolvers = "0.9.3"
7373
Libdl = "1.6"
74-
LinearAlgebra = "1.6"
74+
LinearAlgebra = "1.9"
7575
KLU = "0.3.0, 0.4"
7676
KernelAbstractions = "0.9"
7777
Krylov = "0.9"
78-
KrylovKit = "0.5, 0.6"
78+
KrylovKit = "0.6"
7979
MKL = "0.6"
8080
PrecompileTools = "1"
8181
Preferences = "1"
8282
RecursiveArrayTools = "2"
8383
RecursiveFactorization = "0.2.8"
8484
Reexport = "1"
8585
Requires = "1"
86-
SciMLBase = "1.82, 2"
87-
SciMLOperators = "0.2, 0.3"
88-
Setfield = "0.7, 0.8, 1"
89-
SparseArrays = "1.6"
86+
SciMLBase = "2"
87+
SciMLOperators = "0.3"
88+
Setfield = "1"
89+
SparseArrays = "1.9"
9090
Sparspak = "0.3.6"
91-
SuiteSparse = "1.6"
91+
SuiteSparse = "1.9"
9292
UnPack = "1"
9393
julia = "1.9"
9494

src/LinearSolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PrecompileTools.@recompile_invalidations begin
4646
import Preferences
4747
end
4848

49-
if VERSION >= v"1.8" && Preferences.@load_preference("TriggerMKLLBT", true)
49+
if Preferences.@load_preference("TriggerMKLLBT", true)
5050
using MKL
5151
end
5252

src/appleaccelerate.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,10 @@ end
209209
default_alias_A(::AppleAccelerateLUFactorization, ::Any, ::Any) = false
210210
default_alias_b(::AppleAccelerateLUFactorization, ::Any, ::Any) = false
211211

212-
const PREALLOCATED_APPLE_LU = @static if VERSION >= v"1.8"
212+
const PREALLOCATED_APPLE_LU = begin
213213
A = rand(0, 0)
214214
luinst = ArrayInterface.lu_instance(A)
215215
LU(luinst.factors, similar(A, Cint, 0), luinst.info), Ref{Cint}()
216-
else
217-
nothing
218216
end
219217

220218
function LinearSolve.init_cacheval(alg::AppleAccelerateLUFactorization, A, b, u, Pl, Pr,

src/default.jl

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,7 @@ function defaultalg(A::GPUArraysCore.AbstractGPUArray, b, assump::OperatorAssump
9797
if assump.condition === OperatorCondition.IllConditioned || !assump.issq
9898
DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)
9999
else
100-
@static if VERSION >= v"1.8-"
101-
DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization)
102-
else
103-
DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)
104-
end
100+
DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization)
105101
end
106102
end
107103

@@ -110,11 +106,7 @@ function defaultalg(A, b::GPUArraysCore.AbstractGPUArray, assump::OperatorAssump
110106
if assump.condition === OperatorCondition.IllConditioned || !assump.issq
111107
DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)
112108
else
113-
@static if VERSION >= v"1.8-"
114-
DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization)
115-
else
116-
DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)
117-
end
109+
DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization)
118110
end
119111
end
120112

@@ -124,11 +116,7 @@ function defaultalg(A::GPUArraysCore.AbstractGPUArray, b::GPUArraysCore.Abstract
124116
if assump.condition === OperatorCondition.IllConditioned || !assump.issq
125117
DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)
126118
else
127-
@static if VERSION >= v"1.8-"
128-
DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization)
129-
else
130-
DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)
131-
end
119+
DefaultLinearSolver(DefaultAlgorithmChoice.LUFactorization)
132120
end
133121
end
134122

@@ -162,7 +150,7 @@ function defaultalg(A, b, assump::OperatorAssumptions)
162150
__conditioning(assump) === OperatorCondition.WellConditioned)
163151
if length(b) <= 10
164152
DefaultAlgorithmChoice.GenericLUFactorization
165-
elseif VERSION >= v"1.8" && appleaccelerate_isavailable()
153+
elseif appleaccelerate_isavailable()
166154
DefaultAlgorithmChoice.AppleAccelerateLUFactorization
167155
elseif (length(b) <= 100 || (isopenblas() && length(b) <= 500) ||
168156
(usemkl && length(b) <= 200)) &&
@@ -327,11 +315,7 @@ function defaultalg_symbol(::Type{T}) where {T}
327315
end
328316
defaultalg_symbol(::Type{<:GenericFactorization{typeof(ldlt!)}}) = :LDLtFactorization
329317

330-
@static if VERSION >= v"1.7"
331-
defaultalg_symbol(::Type{<:QRFactorization{ColumnNorm}}) = :QRFactorizationPivoted
332-
else
333-
defaultalg_symbol(::Type{<:QRFactorization{Val{true}}}) = :QRFactorizationPivoted
334-
end
318+
defaultalg_symbol(::Type{<:QRFactorization{ColumnNorm}}) = :QRFactorizationPivoted
335319

336320
"""
337321
if alg.alg === DefaultAlgorithmChoice.LUFactorization

src/deprecated.jl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ function set_cacheval(cache::LinearCache, alg_cache)
7979
end
8080
end
8181

82-
@static if VERSION >= v"1.9" # qualified names only supported in Julia 1.9
83-
@deprecate SciMLBase.solve(cache::LinearCache, args...; kwargs...) SciMLBase.solve!(cache::LinearCache,
84-
args...;
85-
kwargs...) false
86-
else
87-
function SciMLBase.solve(cache::LinearCache, args...; kwargs...)
88-
@warn "SciMLBase.solve(cache::LinearCache, args...; kwargs...) is deprecated for SciMLBase.solve!(cache::LinearCache, args...; kwargs...) to follow the CommonSolve.jl interface."
89-
SciMLBase.solve!(cache::LinearCache, args...; kwargs...)
90-
end
91-
end
82+
@deprecate SciMLBase.solve(cache::LinearCache, args...; kwargs...) SciMLBase.solve!(cache::LinearCache,
83+
args...;
84+
kwargs...) false

src/extension_algs.jl

Lines changed: 51 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,12 @@ sol = solve(prob, alg; Pl = prec)
5151
"""
5252
struct HYPREAlgorithm <: SciMLLinearSolveAlgorithm
5353
solver::Any
54-
55-
@static if VERSION >= v"1.9-"
56-
function HYPREAlgorithm(solver)
57-
ext = Base.get_extension(@__MODULE__, :LinearSolveHYPREExt)
58-
if ext === nothing
59-
error("HYPREAlgorithm requires that HYPRE is loaded, i.e. `using HYPRE`")
60-
else
61-
return new{}(solver)
62-
end
54+
function HYPREAlgorithm(solver)
55+
ext = Base.get_extension(@__MODULE__, :LinearSolveHYPREExt)
56+
if ext === nothing
57+
error("HYPREAlgorithm requires that HYPRE is loaded, i.e. `using HYPRE`")
58+
else
59+
return new{}(solver)
6360
end
6461
end
6562
end
@@ -75,14 +72,12 @@ Requires a sufficiently large `A` to overcome the data transfer costs.
7572
Using this solver requires adding the package CUDA.jl, i.e. `using CUDA`
7673
"""
7774
struct CudaOffloadFactorization <: LinearSolve.AbstractFactorization
78-
@static if VERSION >= v"1.9-"
79-
function CudaOffloadFactorization()
80-
ext = Base.get_extension(@__MODULE__, :LinearSolveCUDAExt)
81-
if ext === nothing
82-
error("CudaOffloadFactorization requires that CUDA is loaded, i.e. `using CUDA`")
83-
else
84-
return new{}()
85-
end
75+
function CudaOffloadFactorization()
76+
ext = Base.get_extension(@__MODULE__, :LinearSolveCUDAExt)
77+
if ext === nothing
78+
error("CudaOffloadFactorization requires that CUDA is loaded, i.e. `using CUDA`")
79+
else
80+
return new{}()
8681
end
8782
end
8883
end
@@ -133,83 +128,51 @@ default handling process. This should not be required by most users.
133128
"""
134129
MKLPardisoIterate(; kwargs...) = PardisoJL(; solver_type = 1, kwargs...)
135130

136-
@static if VERSION >= v"1.9-"
137-
"""
138-
```julia
139-
PardisoJL(; nprocs::Union{Int, Nothing} = nothing,
140-
solver_type = nothing,
141-
matrix_type = nothing,
142-
iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing,
143-
dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing)
144-
```
145-
146-
A generic method using MKL Pardiso. Specifying `solver_type` is required.
147-
148-
!!! note
149-
150-
Using this solver requires adding the package Pardiso.jl, i.e. `using Pardiso`
151-
152-
## Keyword Arguments
153-
154-
For the definition of the keyword arguments, see the Pardiso.jl documentation.
155-
All values default to `nothing` and the solver internally determines the values
156-
given the input types, and these keyword arguments are only for overriding the
157-
default handling process. This should not be required by most users.
158-
"""
159-
struct PardisoJL{T1, T2} <: LinearSolve.SciMLLinearSolveAlgorithm
160-
nprocs::Union{Int, Nothing}
161-
solver_type::T1
162-
matrix_type::T2
163-
iparm::Union{Vector{Tuple{Int, Int}}, Nothing}
164-
dparm::Union{Vector{Tuple{Int, Int}}, Nothing}
165-
166-
function PardisoJL(; nprocs::Union{Int, Nothing} = nothing,
131+
"""
132+
```julia
133+
PardisoJL(; nprocs::Union{Int, Nothing} = nothing,
167134
solver_type = nothing,
168135
matrix_type = nothing,
169136
iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing,
170137
dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing)
171-
ext = Base.get_extension(@__MODULE__, :LinearSolvePardisoExt)
172-
if ext === nothing
173-
error("PardisoJL requires that Pardiso is loaded, i.e. `using Pardiso`")
174-
else
175-
T1 = typeof(solver_type)
176-
T2 = typeof(matrix_type)
177-
@assert T1 <: Union{Int, Nothing, ext.Pardiso.Solver}
178-
@assert T2 <: Union{Int, Nothing, ext.Pardiso.MatrixType}
179-
return new{T1, T2}(nprocs, solver_type, matrix_type, iparm, dparm)
180-
end
138+
```
139+
140+
A generic method using MKL Pardiso. Specifying `solver_type` is required.
141+
142+
!!! note
143+
144+
Using this solver requires adding the package Pardiso.jl, i.e. `using Pardiso`
145+
146+
## Keyword Arguments
147+
148+
For the definition of the keyword arguments, see the Pardiso.jl documentation.
149+
All values default to `nothing` and the solver internally determines the values
150+
given the input types, and these keyword arguments are only for overriding the
151+
default handling process. This should not be required by most users.
152+
"""
153+
struct PardisoJL{T1, T2} <: LinearSolve.SciMLLinearSolveAlgorithm
154+
nprocs::Union{Int, Nothing}
155+
solver_type::T1
156+
matrix_type::T2
157+
iparm::Union{Vector{Tuple{Int, Int}}, Nothing}
158+
dparm::Union{Vector{Tuple{Int, Int}}, Nothing}
159+
160+
function PardisoJL(; nprocs::Union{Int, Nothing} = nothing,
161+
solver_type = nothing,
162+
matrix_type = nothing,
163+
iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing,
164+
dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing)
165+
ext = Base.get_extension(@__MODULE__, :LinearSolvePardisoExt)
166+
if ext === nothing
167+
error("PardisoJL requires that Pardiso is loaded, i.e. `using Pardiso`")
168+
else
169+
T1 = typeof(solver_type)
170+
T2 = typeof(matrix_type)
171+
@assert T1 <: Union{Int, Nothing, ext.Pardiso.Solver}
172+
@assert T2 <: Union{Int, Nothing, ext.Pardiso.MatrixType}
173+
return new{T1, T2}(nprocs, solver_type, matrix_type, iparm, dparm)
181174
end
182175
end
183-
else
184-
"""
185-
```julia
186-
PardisoJL(; nprocs::Union{Int, Nothing} = nothing,
187-
solver_type = nothing,
188-
matrix_type = nothing,
189-
iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing,
190-
dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing)
191-
```
192-
193-
A generic method using MKL Pardiso. Specifying `solver_type` is required.
194-
195-
!!! note
196-
197-
Using this solver requires adding the package Pardiso.jl, i.e. `using Pardiso`
198-
199-
## Keyword Arguments
200-
201-
For the definition of the keyword arguments, see the Pardiso.jl documentation.
202-
All values default to `nothing` and the solver internally determines the values
203-
given the input types, and these keyword arguments are only for overriding the
204-
default handling process. This should not be required by most users.
205-
"""
206-
Base.@kwdef struct PardisoJL <: LinearSolve.SciMLLinearSolveAlgorithm
207-
nprocs::Union{Int, Nothing} = nothing
208-
solver_type::Any = nothing
209-
matrix_type::Any = nothing
210-
iparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing
211-
dparm::Union{Vector{Tuple{Int, Int}}, Nothing} = nothing
212-
end
213176
end
214177

215178
"""

0 commit comments

Comments
 (0)