Skip to content

Commit 9c82ae9

Browse files
committed
Benchmark fixes.
1 parent 054c8b9 commit 9c82ae9

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

benchmark/benchmarkflops.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,11 @@ function benchmark_random_access(sizes)
407407
br = BenchmarkResult(tests, sizes)
408408
for (i,s) enumerate(sizes)
409409
A, C = totwotuple(s)
410-
P = rand(A, C);
410+
P = rand(A, C) .+= 0.5;
411411
basis = rand(1:C, A, C);
412-
coefs = randn(C)
412+
coefs = randn(C);
413413
n_gflop = 1e-9*(A*C + C)
414-
p = randomaccess(P, basis, coefs)
414+
p = randomaccess(P, basis, coefs);
415415
br[1,i] = n_gflop / @belapsed randomaccess($P, $basis, $coefs)
416416
br[2,i] = n_gflop / @belapsed crandomaccess($P, $basis, $coefs)
417417
@assert p crandomaccess(P, basis, coefs) "Clang wrong?"

benchmark/driver.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ AtmulB_bench = fetch(AtmulB_future)
4747
AmulBt_bench = fetch(AmulBt_future)
4848
Atmulvb_bench = fetch(Atmulvb_future)
4949

50-
v = 2
50+
v = 3
5151
const PICTURES = "/home/chriselrod/Pictures"
5252
save(joinpath(PICTURES, "bench_gemm_v$v.png"), plot(gemm_bench));
5353
save(joinpath(PICTURES, "bench_AtmulB_v$v.png"), plot(AtmulB_bench));
@@ -60,7 +60,7 @@ save(joinpath(PICTURES, "bench_exp_v$v.png"), plot(exp_bench));
6060
save(joinpath(PICTURES, "bench_aplusBc_v$v.png"), plot(aplusBc_bench));
6161
save(joinpath(PICTURES, "bench_AplusAt_v$v.png"), plot(AplusAt_bench));
6262
save(joinpath(PICTURES, "bench_random_access_v$v.png"), plot(randomaccess_bench));
63-
save(joinpath(PICTURES, "bench_AmulBt_v$b.png"), plot(AmulBt_bench));
63+
save(joinpath(PICTURES, "bench_AmulBt_v$v.png"), plot(AmulBt_bench));
6464
save(joinpath(PICTURES, "bench_Atmulvb_v$v.png"), plot(Atmulvb_bench));
6565

6666
plot(gemm_bench)

benchmark/loadsharedlibs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ for (prefix,Cshared,Fshared) ∈ ((Symbol(""),LIBCTEST,LIBFTEST), (:i,LIBICTEST,
306306
A, C = size(P)
307307
p = Ref{Float64}()
308308
ccall(
309-
(:randomaccess, $Cshared), Cvoid,
309+
(:randomaccess, $Fshared), Cvoid,
310310
(Ref{Float64}, Ptr{Float64}, Ptr{Clong}, Ptr{Float64}, Ref{Clong}, Ref{Clong}),
311311
p, P, basis, coefs, Ref(A), Ref(C)
312312
)

benchmark/looptests.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,8 @@ subroutine AplusAtbuiltin(B, A, N) BIND(C, name="AplusAtbuiltin")
292292
B = A + transpose(A)
293293
end subroutine AplusAtbuiltin
294294
subroutine randomaccess(pp, P, basis, coefs, A, C) BIND(C, name="randomaccess")
295-
integer(C_long), intent(in) :: A, C
295+
integer(C_long), intent(in) :: A, C, basis(A,C)
296296
real(C_double), intent(in) :: P(A,C), coefs(C)
297-
integer(C_long), intent(in) :: basis(A,C)
298297
real(C_double), intent(out) :: pp
299298
real(C_double) :: pc
300299
integer(C_long) :: aa, cc

benchmark/looptests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ end
2020
C[m,n] = Cₘₙ
2121
end
2222
end
23-
@inline function jgemm!(C, A, B::Adjoint)
23+
@inline function jgemm!(C, A, Bᵀ::Adjoint)
2424
C .= 0
25+
B = parent(B)
2526
M, N = size(C); K = size(B,1)
2627
@inbounds for k 1:K, n 1:N
2728
@simd ivdep for m 1:M

benchmark/plotbenchmarks.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function plot(br::BenchmarkResult)
2929
x = :Size,
3030
y = :GFLOPS,
3131
color = :Method,
32-
width = 549,
33-
height = 372
32+
width = 720,
33+
height = 480
3434
)
3535
end
3636

0 commit comments

Comments
 (0)