diff --git a/Project.toml b/Project.toml index 2adacb4..543f74f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RecursiveFactorization" uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" authors = ["Yingbo Ma "] -version = "0.2.29" +version = "0.2.30" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/RecursiveFactorization.jl b/src/RecursiveFactorization.jl index fb6784a..3b38e9c 100644 --- a/src/RecursiveFactorization.jl +++ b/src/RecursiveFactorization.jl @@ -8,8 +8,31 @@ include("./butterflylu.jl") import PrecompileTools -PrecompileTools.@compile_workload begin - lu!(rand(2, 2)) +# Inference is whole-body, so n = 4 already reaches the recursive kernel and +# the TriangularSolve legs that only run above the blocksize threshold. Only +# type changes need their own case: eltype, the two `Val`s, and a matrix RHS. +PrecompileTools.@setup_workload begin + n = 4 + for T in (Float64, Float32) + A = Matrix{T}(undef, n, n) + A .= rand.(T) + @view(A[LinearAlgebra.diagind(A)]) .+= T(n) + b = Vector{T}(undef, n) + b .= rand.(T) + B = Matrix{T}(undef, n, 2) + B .= rand.(T) + PrecompileTools.@compile_workload begin + lu(A) + lu!(copy(A)) + lu!(copy(A), Val(true), Val(true)) + lu!(copy(A), Val(false), Val(true)) + F = lu!(copy(A), Val(false)) + LinearAlgebra.ldiv!(F, copy(b)) + LinearAlgebra.ldiv!(F, copy(B)) + LinearAlgebra.ldiv!(lu(A), copy(b)) + 🦋solve!(🦋workspace(copy(A), copy(b)), Val(false)) + end + end end end # module