-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
plot_script.jl
76 lines (71 loc) · 2.6 KB
/
plot_script.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using Plots
using CSV
ENV["GKSwstype"]="nul"
SIZE = (640, 400)
for ty in ["f32", "f64", "c32", "c64"]
for (algo, name) in [
("cholesky", "Cholesky"),
("qr", "QR"),
("piv_qr", "QR with column pivoting"),
("lu", "LU with partial pivoting"),
("piv_lu", "LU with full pivoting"),
("svd", "Singular value decomposition"),
("thin_svd", "Thin singular value decomposition"),
("eigh", "Self adjoint eigenvalue decomposition"),
("eig", "General eigenvalue decomposition"),
]
data = CSV.File("./target/mt_$(algo)_$(ty).csv", types=Float64)
norm = data["faer"]
p = plot(
data["n"],
[data["faer"]./norm data["mkl"]./norm data["openblas"]./norm],
size=SIZE,
xaxis=:log,
yaxis=:log,
title="$(name) ($(ty))",
label=["faer" "mkl" "openblas"],
xlabel="Matrix dimension (n)",
ylabel="1/time (normalized)",
ylims=(0.1, 10.0),
yticks=([0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0], ["0.1", "0.2", "0.5", "1.0", "2.0", "5.0", "10.0"])
)
savefig(p, "./target/mt_$(algo)_$(ty)_plot.png")
end
end
for ty in ["f32", "f64", "c32", "c64"]
for (algo, name) in [
("cholesky", "Cholesky"),
("qr", "QR"),
("piv_qr", "QR with column pivoting"),
("lu", "LU with partial pivoting"),
("piv_lu", "LU with full pivoting"),
("svd", "Singular value decomposition"),
("thin_svd", "Thin singular value decomposition"),
("eigh", "Self adjoint eigenvalue decomposition"),
("eig", "General eigenvalue decomposition"),
]
data = CSV.File("./target/st_$(algo)_$(ty).csv", types=Float64)
norm = data["faer"]
if all(isnan.(data["nalgebra"]))
funcs = [data["faer"]./norm data["mkl"]./norm data["openblas"]./norm]
label = ["faer" "mkl" "openblas"]
else
funcs = [data["faer"]./norm data["mkl"]./norm data["openblas"]./norm data["nalgebra"]./norm]
label = ["faer" "mkl" "openblas" "nalgebra"]
end
p = plot(
data["n"],
funcs,
size=SIZE,
xaxis=:log,
yaxis=:log,
title="$(name) ($(ty))",
label=label,
xlabel="Matrix dimension (n)",
ylabel="1/time (normalized)",
ylims=(0.1, 10.0),
yticks=([0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0], ["0.1", "0.2", "0.5", "1.0", "2.0", "5.0", "10.0"])
)
savefig(p, "./target/st_$(algo)_$(ty)_plot.png")
end
end