Skip to content

Commit d57642c

Browse files
authored
format (#458)
1 parent a73a797 commit d57642c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3698
-1630
lines changed

.JuliaFormatter.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
indent = 2
1+
indent = 2
2+
margin = 80
3+
remove_extra_newlines = true
4+
long_to_short_function_def = true
5+
format_docstrings = true
6+
trailing_comma = false
7+
separate_kwargs_with_semicolon = true

benchmark/benchmarkflops.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ function Base.vcat(br1::BenchmarkResult, br2::BenchmarkResult)
2828
br1.tests,
2929
SizedResults(
3030
hcat(br1.sizedresults.results, br2.sizedresults.results),
31-
vcat(br1.sizedresults.sizes, br2.sizedresults.sizes),
32-
),
31+
vcat(br1.sizedresults.sizes, br2.sizedresults.sizes)
32+
)
3333
)
3434
end
3535

@@ -119,7 +119,6 @@ function At_mul_Bt_bench!(br, s, i)
119119
matmul_bench!(br, C, A, B, i)
120120
end
121121

122-
123122
function dot_bench!(br, s, i)
124123
a = rand(s)
125124
b = rand(s)
@@ -440,7 +439,6 @@ function logdettriangle_bench!(br, s, i)
440439
br[5+2INTEL_BENCH, i] = n_gflop / @belapsed logdet($U)
441440
end
442441

443-
444442
function filter2d_bench_run!(br, s, i, K)
445443
A = rand(s + 2, s + 2)
446444
B = OffsetArray(similar(A, (s, s)), 1, 1)
@@ -463,7 +461,6 @@ function filter2d_bench_run!(br, s, i, K)
463461
end
464462
end
465463

466-
467464
function filter2dunrolled_bench_run!(br, s, i, K)
468465
A = rand(s + 2, s + 2)
469466
B = OffsetArray(similar(A, (s, s)), 1, 1)

benchmark/benchmarks.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ for n ∈ 1:64
1414
B = rand(n, n)
1515
C = Matrix{Float64}(undef, n, n)
1616
SUITE["linalg"]["matmul"]["AmulB", n] = @benchmarkable gemmavx!($C, $A, $B)
17-
SUITE["linalg"]["matmul"]["A′mulB", n] = @benchmarkable jAtmulBavx!($C, $A′, $B)
17+
SUITE["linalg"]["matmul"]["A′mulB", n] =
18+
@benchmarkable jAtmulBavx!($C, $A′, $B)
1819
x = rand(n)
1920
y = rand(n)
2021
SUITE["linalg"]["dot"]["dot", n] = @benchmarkable jdotavx($x, $y)

benchmark/driver.jl

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,26 @@ const LOOPVECBENCHDIR = joinpath(pkgdir(LoopVectorization), "benchmark")
77
include(joinpath(LOOPVECBENCHDIR, "benchmarkflops.jl"))
88
include(joinpath(LOOPVECBENCHDIR, "plotbenchmarks.jl"))
99

10-
1110
nprocs_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"))
1414
function 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()))
1717
end
1818
stop_workers() = rmprocs(workers())
1919

20-
2120
function 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
217231
end
218232

219-
220-
221233
# sizes = 23:23
222234
sizes = 256:-1:2
223235
longsizes = 1024:-1:2
@@ -287,7 +299,8 @@ const v = 2
287299
# using Cairo, Fontconfig
288300
const 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"), 12inch, 8inch), plot(br))
302+
saveplot(f, br) =
303+
draw(SVG(joinpath(PICTURES, f * "$v.svg"), 12inch, 8inch), 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);
305318
saveplot("bench_Amulvb_v", Amulvb_bench);
306319
saveplot("bench_Atmulvb_v", Atmulvb_bench);
307320

308-
309321
saveplot("bench_logdettriangle_v", logdettriangle_bench);
310322
saveplot("bench_filter2d_dynamic_v", filter2d_dynamic_bench);
311323
saveplot("bench_filter2d_3x3_v", filter2d_3x3_bench);

0 commit comments

Comments
 (0)