@@ -7,21 +7,26 @@ const LOOPVECBENCHDIR = joinpath(pkgdir(LoopVectorization), "benchmark")
7
7
include (joinpath (LOOPVECBENCHDIR, " benchmarkflops.jl" ))
8
8
include (joinpath (LOOPVECBENCHDIR, " plotbenchmarks.jl" ))
9
9
10
-
11
10
nprocs_to_add () = ((Sys. CPU_THREADS):: Int >> 1 )
12
11
# nprocs_to_add() = ((Sys.CPU_THREADS)::Int >> 1) - 1
13
- start_worker (wid) = remotecall (include, wid, joinpath (LOOPVECBENCHDIR, " setup_worker.jl" ))
12
+ start_worker (wid) =
13
+ remotecall (include, wid, joinpath (LOOPVECBENCHDIR, " setup_worker.jl" ))
14
14
function start_workers (nprocs = nprocs_to_add ())
15
- addprocs (nprocs, exeflags = " --project=$(Base. active_project ()) " )
15
+ addprocs (nprocs; exeflags = " --project=$(Base. active_project ()) " )
16
16
foreach (wait, map (start_worker, workers ()))
17
17
end
18
18
stop_workers () = rmprocs (workers ())
19
19
20
-
21
20
function blastests ()
22
21
tests = [" LoopVectorization" , " Julia" , " Clang" , " GFortran" ]
23
22
INTEL_BENCH && push! (tests, " icc" , " ifort" )
24
- push! (tests, " g++ & Eigen-3" , " clang++ & Eigen-3" , " GFortran-builtin" , " OpenBLAS" )
23
+ push! (
24
+ tests,
25
+ " g++ & Eigen-3" ,
26
+ " clang++ & Eigen-3" ,
27
+ " GFortran-builtin" ,
28
+ " OpenBLAS"
29
+ )
25
30
INTEL_BENCH && push! (tests, " ifort-builtin" )
26
31
MKL_BENCH && push! (tests, " MKL" )
27
32
tests
@@ -166,7 +171,10 @@ function benchmark_random_access(sizes)
166
171
INTEL_BENCH && push! (tests, " icc" , " ifort" )
167
172
start_workers ()
168
173
sm = SharedMatrix (Matrix {Float64} (undef, length (tests), length (sizes)))
169
- @showprogress pmap (is -> randomaccess_bench! (sm, is[2 ], is[1 ]), enumerate (sizes))
174
+ @showprogress pmap (
175
+ is -> randomaccess_bench! (sm, is[2 ], is[1 ]),
176
+ enumerate (sizes)
177
+ )
170
178
br = BenchmarkResult (Matrix (sm), tests, sizes)
171
179
stop_workers ()
172
180
br
@@ -178,7 +186,10 @@ function benchmark_logdettriangle(sizes)
178
186
push! (tests, " LinearAlgebra" )
179
187
start_workers ()
180
188
sm = SharedMatrix (Matrix {Float64} (undef, length (tests), length (sizes)))
181
- @showprogress pmap (is -> logdettriangle_bench! (sm, is[2 ], is[1 ]), enumerate (sizes))
189
+ @showprogress pmap (
190
+ is -> logdettriangle_bench! (sm, is[2 ], is[1 ]),
191
+ enumerate (sizes)
192
+ )
182
193
br = BenchmarkResult (Matrix (sm), tests, sizes)
183
194
stop_workers ()
184
195
br
@@ -188,7 +199,10 @@ function benchmark_filter2d(sizes, K)
188
199
INTEL_BENCH && push! (tests, " icc" , " ifort" )
189
200
start_workers ()
190
201
sm = SharedMatrix (Matrix {Float64} (undef, length (tests), length (sizes)))
191
- @showprogress pmap (is -> filter2d_bench_run! (sm, is[2 ], is[1 ], K), enumerate (sizes))
202
+ @showprogress pmap (
203
+ is -> filter2d_bench_run! (sm, is[2 ], is[1 ], K),
204
+ enumerate (sizes)
205
+ )
192
206
br = BenchmarkResult (Matrix (sm), tests, sizes)
193
207
stop_workers ()
194
208
br
@@ -209,15 +223,13 @@ function benchmark_filter2dunrolled(sizes)
209
223
K = SizedOffsetMatrix {Float64,-1,1,-1,1} (rand (3 , 3 ))
210
224
@showprogress pmap (
211
225
is -> filter2dunrolled_bench_run! (sm, is[2 ], is[1 ], K),
212
- enumerate (sizes),
226
+ enumerate (sizes)
213
227
)
214
228
br = BenchmarkResult (Matrix (sm), tests, sizes)
215
229
stop_workers ()
216
230
br
217
231
end
218
232
219
-
220
-
221
233
# sizes = 23:23
222
234
sizes = 256 : - 1 : 2
223
235
longsizes = 1024 : - 1 : 2
@@ -287,7 +299,8 @@ const v = 2
287
299
# using Cairo, Fontconfig
288
300
const PICTURES = joinpath (pkgdir (LoopVectorization), " docs" , " src" , " assets" )
289
301
# saveplot(f, br) = draw(PNG(joinpath(PICTURES, f * "$v.png"), 12inch, 8inch), plot(br))
290
- saveplot (f, br) = draw (SVG (joinpath (PICTURES, f * " $v .svg" ), 12 inch, 8 inch), plot (br))
302
+ saveplot (f, br) =
303
+ draw (SVG (joinpath (PICTURES, f * " $v .svg" ), 12 inch, 8 inch), plot (br))
291
304
292
305
# If only rerunning a few, remove them from load.
293
306
# @load "benchmarkresults.jld2" logdettriangle_bench filter2d_dynamic_bench filter2d_3x3_bench filter2d_unrolled_bench dot_bench selfdot_bench dot3_bench sse_bench aplusBc_bench AplusAt_bench vexp_bench randomaccess_bench AmulB_bench AmulBt_bench AtmulB_bench AtmulBt_bench Amulvb_bench Atmulvb_bench
@@ -305,7 +318,6 @@ saveplot("bench_AtmulBt_v", AtmulBt_bench);
305
318
saveplot (" bench_Amulvb_v" , Amulvb_bench);
306
319
saveplot (" bench_Atmulvb_v" , Atmulvb_bench);
307
320
308
-
309
321
saveplot (" bench_logdettriangle_v" , logdettriangle_bench);
310
322
saveplot (" bench_filter2d_dynamic_v" , filter2d_dynamic_bench);
311
323
saveplot (" bench_filter2d_3x3_v" , filter2d_3x3_bench);
0 commit comments