Skip to content

Commit 78d9c64

Browse files
Fix method overwriting error during precompilation on Apple Silicon
Resolves #768 by using Union type for fallback init_cacheval methods The issue was that individual fallback methods for BLISLUFactorization, CudaOffloadLUFactorization, and MetalLUFactorization had the same signatures as their extension counterparts, causing method overwriting during precompilation when LinearSolveAutotune is loaded. This change consolidates the three individual fallback methods into a single method using a Union type, which avoids the signature conflict while maintaining the same functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 1090c5e commit 78d9c64

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/factorization.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,19 +1203,9 @@ function init_cacheval(::CliqueTreesFactorization, ::StaticArray, b, u, Pl, Pr,
12031203
nothing
12041204
end
12051205

1206-
# Fallback init_cacheval for extension-based algorithms when extensions aren't loaded
1207-
# These return nothing since the actual implementations are in the extensions
1208-
function init_cacheval(::BLISLUFactorization, A, b, u, Pl, Pr,
1209-
maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
1210-
nothing
1211-
end
1212-
1213-
function init_cacheval(::CudaOffloadLUFactorization, A, b, u, Pl, Pr,
1214-
maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
1215-
nothing
1216-
end
1217-
1218-
function init_cacheval(::MetalLUFactorization, A, b, u, Pl, Pr,
1206+
# Fallback method for extension-based algorithms when extensions aren't loaded
1207+
# Uses Union type to avoid method overwriting with extension-specific methods
1208+
function init_cacheval(::Union{BLISLUFactorization, CudaOffloadLUFactorization, MetalLUFactorization}, A, b, u, Pl, Pr,
12191209
maxiters::Int, abstol, reltol, verbose::Bool, assumptions::OperatorAssumptions)
12201210
nothing
12211211
end

0 commit comments

Comments
 (0)