Skip to content

Commit 707eb22

Browse files
Fix method overwriting error during precompilation on Apple Silicon (#769)
* Fix method overwriting error during precompilation on Apple Silicon Resolves #768 by making extension method signatures more specific The issue was that the BLIS extension method for preallocated cache was dispatching on any type A, causing method signature conflicts with the base fallback methods during precompilation. The fix makes the preallocated BLIS method dispatch on the exact type (Matrix{Float64}) that matches the preallocated cache, while keeping the base fallback methods for when extensions aren't loaded. Changes: - BLIS extension: Change from `A` to `A::Matrix{Float64}` for preallocated method - Metal extension: Keep `A::AbstractArray` (already correct for dynamic computation) - CUDA extension: Already correct with `A::AbstractArray` - Base methods: Restored individual fallback methods 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update Project.toml --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1090c5e commit 707eb22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/LinearSolveBLISExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ const PREALLOCATED_BLIS_LU = begin
203203
luinst = ArrayInterface.lu_instance(A), Ref{BlasInt}()
204204
end
205205

206-
function LinearSolve.init_cacheval(alg::BLISLUFactorization, A, b, u, Pl, Pr,
206+
function LinearSolve.init_cacheval(alg::BLISLUFactorization, A::Matrix{Float64}, b, u, Pl, Pr,
207207
maxiters::Int, abstol, reltol, verbose::Bool,
208208
assumptions::OperatorAssumptions)
209209
PREALLOCATED_BLIS_LU

ext/LinearSolveMetalExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using LinearSolve: ArrayInterface, MKLLUFactorization, MetalOffload32MixedLUFact
99
default_alias_A(::MetalLUFactorization, ::Any, ::Any) = false
1010
default_alias_b(::MetalLUFactorization, ::Any, ::Any) = false
1111

12-
function LinearSolve.init_cacheval(alg::MetalLUFactorization, A, b, u, Pl, Pr,
12+
function LinearSolve.init_cacheval(alg::MetalLUFactorization, A::AbstractArray, b, u, Pl, Pr,
1313
maxiters::Int, abstol, reltol, verbose::Bool,
1414
assumptions::OperatorAssumptions)
1515
ArrayInterface.lu_instance(convert(AbstractMatrix, A))

0 commit comments

Comments
 (0)