Skip to content

Commit 7d766d8

Browse files
committed
Prevent KrylovJL use for RecursiveArrayTools
1 parent 3eb186f commit 7d766d8

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

Project.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
3333
[weakdeps]
3434
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
3535
BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0"
36-
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
3736
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
37+
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
3838
HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771"
3939
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
4040
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
4141
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
4242
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
4343
Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2"
44+
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
4445

4546
[extensions]
4647
LinearSolveBandedMatricesExt = "BandedMatrices"
@@ -53,6 +54,7 @@ LinearSolveKernelAbstractionsExt = "KernelAbstractions"
5354
LinearSolveKrylovKitExt = "KrylovKit"
5455
LinearSolveMetalExt = "Metal"
5556
LinearSolvePardisoExt = "Pardiso"
57+
LinearSolveRecursiveArrayToolsExt = "RecursiveArrayTools"
5658

5759
[compat]
5860
ArrayInterface = "7.4.11"
@@ -72,6 +74,7 @@ Krylov = "0.9"
7274
KrylovKit = "0.5, 0.6"
7375
PrecompileTools = "1"
7476
Preferences = "1"
77+
RecursiveArrayTools = "2"
7578
RecursiveFactorization = "0.2.8"
7679
Reexport = "1"
7780
Requires = "1"
@@ -99,6 +102,7 @@ Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
99102
MultiFloats = "bdf0d083-296b-4888-a5b6-7498122e68a5"
100103
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
101104
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
105+
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
102106
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
103107
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
104108

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module LinearSolveRecursiveArrayToolsExt
2+
3+
using LinearSolve, RecursiveArrayTools
4+
import LinearSolve: init_cacheval
5+
6+
# Krylov.jl tries to init with `ArrayPartition(undef, ...)`. Avoid hitting that!
7+
function init_cacheval(alg::LinearSolve.KrylovJL, A, b::ArrayPartition, u, Pl, Pr,
8+
maxiters::Int, abstol, reltol, verbose::Bool, ::LinearSolve.OperatorAssumptions)
9+
return nothing
10+
end
11+
12+
end

src/default.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ end
9393
end
9494

9595
function defaultalg(A::GPUArraysCore.AbstractGPUArray, b, assump::OperatorAssumptions)
96-
if assump.condition === OperatorConodition.IllConditioned || !assump.issq
96+
if assump.condition === OperatorCondition.IllConditioned || !assump.issq
9797
DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)
9898
else
9999
@static if VERSION >= v"1.8-"

0 commit comments

Comments
 (0)