Skip to content

Commit a031648

Browse files
committed
Update perf.jl
1 parent b522f6e commit a031648

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

perf/lu.jl

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ end
1818

1919
bas_mflops = Float64[]
2020
rec_mflops = Float64[]
21+
rec4_mflops = Float64[]
22+
rec800_mflops = Float64[]
2123
ref_mflops = Float64[]
2224
ns = 4:8:500
2325
for n in ns
@@ -29,18 +31,34 @@ for n in ns
2931
rt = @belapsed RecursiveFactorization.lu!(B) setup=(B = copy(A))
3032
push!(rec_mflops, luflop(n)/rt/1e9)
3133

34+
rt4 = @belapsed RecursiveFactorization.lu!(B; threshold=4) setup=(B = copy(A))
35+
push!(rec4_mflops, luflop(n)/rt4/1e9)
36+
37+
rt800 = @belapsed RecursiveFactorization.lu!(B; threshold=800) setup=(B = copy(A))
38+
push!(rec800_mflops, luflop(n)/rt800/1e9)
39+
3240
ref = @belapsed LinearAlgebra.generic_lufact!(B) setup=(B = copy(A))
3341
push!(ref_mflops, luflop(n)/ref/1e9)
3442
end
3543

3644
using DataFrames, VegaLite
37-
df = DataFrame(Size = ns, RecursiveFactorization = rec_mflops, OpenBLAS = bas_mflops, Reference = ref_mflops)
38-
df = stack(df, [:RecursiveFactorization, :OpenBLAS, :Reference], variable_name = :Library, value_name = :GFLOPS)
45+
blaslib = BLAS.vendor() === :mkl ? :MKL : :OpenBLAS
46+
df = DataFrame(Size = ns,
47+
RecursiveFactorization = rec_mflops,
48+
RecursiveFactorization4 = rec4_mflops,
49+
RecursiveFactorization800 = rec800_mflops,
50+
Reference = ref_mflops)
51+
setproperty!(df, blaslib, bas_mflops)
52+
df = stack(df, [:RecursiveFactorization,
53+
:RecursiveFactorization4,
54+
:RecursiveFactorization800,
55+
blaslib,
56+
:Reference], variable_name = :Library, value_name = :GFLOPS)
3957
plt = df |> @vlplot(
40-
:line, color = :Library,
41-
x = {:Size}, y = {:GFLOPS},
42-
width = 2400, height = 600
43-
)
58+
:line, color = {:Library, scale={scheme="category10"}},
59+
x = {:Size}, y = {:GFLOPS},
60+
width = 2400, height = 600
61+
)
4462
save(joinpath(homedir(), "Pictures", "lu_float64.png"), plt)
4563

4664
#=

0 commit comments

Comments
 (0)