@@ -7,21 +7,26 @@ const LOOPVECBENCHDIR = joinpath(pkgdir(LoopVectorization), "benchmark")
77include (joinpath (LOOPVECBENCHDIR, " benchmarkflops.jl" ))
88include (joinpath (LOOPVECBENCHDIR, " plotbenchmarks.jl" ))
99
10-
1110nprocs_to_add () = ((Sys. CPU_THREADS):: Int >> 1 )
1211# 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" ))
1414function start_workers (nprocs = nprocs_to_add ())
15- addprocs (nprocs, exeflags = " --project=$(Base. active_project ()) " )
15+ addprocs (nprocs; exeflags = " --project=$(Base. active_project ()) " )
1616 foreach (wait, map (start_worker, workers ()))
1717end
1818stop_workers () = rmprocs (workers ())
1919
20-
2120function blastests ()
2221 tests = [" LoopVectorization" , " Julia" , " Clang" , " GFortran" ]
2322 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+ )
2530 INTEL_BENCH && push! (tests, " ifort-builtin" )
2631 MKL_BENCH && push! (tests, " MKL" )
2732 tests
@@ -166,7 +171,10 @@ function benchmark_random_access(sizes)
166171 INTEL_BENCH && push! (tests, " icc" , " ifort" )
167172 start_workers ()
168173 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+ )
170178 br = BenchmarkResult (Matrix (sm), tests, sizes)
171179 stop_workers ()
172180 br
@@ -178,7 +186,10 @@ function benchmark_logdettriangle(sizes)
178186 push! (tests, " LinearAlgebra" )
179187 start_workers ()
180188 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+ )
182193 br = BenchmarkResult (Matrix (sm), tests, sizes)
183194 stop_workers ()
184195 br
@@ -188,7 +199,10 @@ function benchmark_filter2d(sizes, K)
188199 INTEL_BENCH && push! (tests, " icc" , " ifort" )
189200 start_workers ()
190201 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+ )
192206 br = BenchmarkResult (Matrix (sm), tests, sizes)
193207 stop_workers ()
194208 br
@@ -209,15 +223,13 @@ function benchmark_filter2dunrolled(sizes)
209223 K = SizedOffsetMatrix {Float64,-1,1,-1,1} (rand (3 , 3 ))
210224 @showprogress pmap (
211225 is -> filter2dunrolled_bench_run! (sm, is[2 ], is[1 ], K),
212- enumerate (sizes),
226+ enumerate (sizes)
213227 )
214228 br = BenchmarkResult (Matrix (sm), tests, sizes)
215229 stop_workers ()
216230 br
217231end
218232
219-
220-
221233# sizes = 23:23
222234sizes = 256 : - 1 : 2
223235longsizes = 1024 : - 1 : 2
@@ -287,7 +299,8 @@ const v = 2
287299# using Cairo, Fontconfig
288300const PICTURES = joinpath (pkgdir (LoopVectorization), " docs" , " src" , " assets" )
289301# 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))
291304
292305# If only rerunning a few, remove them from load.
293306# @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);
305318saveplot (" bench_Amulvb_v" , Amulvb_bench);
306319saveplot (" bench_Atmulvb_v" , Atmulvb_bench);
307320
308-
309321saveplot (" bench_logdettriangle_v" , logdettriangle_bench);
310322saveplot (" bench_filter2d_dynamic_v" , filter2d_dynamic_bench);
311323saveplot (" bench_filter2d_3x3_v" , filter2d_3x3_bench);
0 commit comments