Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LinearSolve"
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
version = "5.10.0"
version = "5.10.1"
authors = ["SciML"]

[deps]
Expand Down
8 changes: 3 additions & 5 deletions src/blocked_lufact.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ end
return kp, amax
end

# Unblocked factorization for the whole matrix at small sizes. Identical
# control flow to the scalar `generic_lufact!` RowMaximum path, with hoisted
# multipliers, `muladd`, and `@simd ivdep` on the column updates.
# Keep small factorizations identical to the scalar `generic_lufact!` RowMaximum path.
function _blocked_lu_unblocked!(A::AbstractMatrix{T}, ipiv, m::Int, n::Int) where {T}
minmn = min(m, n)
info = 0
Expand All @@ -79,8 +77,8 @@ function _blocked_lu_unblocked!(A::AbstractMatrix{T}, ipiv, m::Int, n::Int) wher
end
for j in (k + 1):n
Akj = A[k, j]
@simd ivdep for i in (k + 1):m
A[i, j] = muladd(-A[i, k], Akj, A[i, j])
for i in (k + 1):m
A[i, j] -= A[i, k] * Akj
end
end
end
Expand Down
11 changes: 11 additions & 0 deletions test/Core/blocked_lufact.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ end
@test !endswith(String(m_generic.file), "blocked_lufact.jl")
end

@testset "small path matches scalar arithmetic" begin
A = randn(MersenneTwister(1234), 4, 4)
F = LinearSolve.generic_lufact!(copy(A), RowMaximum(), _ipiv(4); check = false)
A_scalar_dispatch = @view copy(A)[:, [1, 2, 3, 4]]
F_scalar = LinearSolve.generic_lufact!(
A_scalar_dispatch, RowMaximum(), _ipiv(4); check = false
)
@test F.factors == F_scalar.factors
@test F.ipiv == F_scalar.ipiv
end

@testset "residual, square, default params ($T)" for T in (Float64, Float32)
for n in (
1, 2, 3, 5, 7, 8, 9, 13, 16, 17, 31, 32, 33, 40, 41, 63, 64, 65,
Expand Down
Loading