Hello. Can someone explain why using SuiteSparse.CHOLMOD.lowrankupdate! does not give acceleration in this example?
using BenchmarkTools, LinearAlgebra, SparseArrays, Test, SuiteSparse
N = 100; M = 20
b = rand(N)
spA = spdiagm(-1 => ones(N-1),
1 => ones(N-1),
0 => 5 .* ones(N))
x1 = @btime (
F = cholesky($spA);
diags = spdiagm(sqrt.($b));
for n = 1:$M
SuiteSparse.CHOLMOD.lowrankupdate!(F, diags)
x1 .= F \ $b
end;
x1
) setup=(x1 = similar($b))
x2 = @btime (
A = copy($spA);
diagb = spdiagm($b);
for n = 1:$M
A .+= diagb
x2 .= A \ $b
end;
x2
) setup=(x2 = similar($b))
@test x1 ≈ x2
The result is
2.022 ms (565 allocations: 385.43 KiB)
639.500 μs (976 allocations: 978.42 KiB)
Test Passed
My Julia version is
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core™ i7-4710HQ CPU @ 2.50GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, haswell)
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS =