@@ -73,11 +73,23 @@ function maybe_sleep(x)
73
73
end
74
74
75
75
function benchmark_fun! (
76
- f!:: F , summarystat, C, A, B, sleep_time, force_belapsed = false , reference = nothing
76
+ f!:: F ,
77
+ summarystat,
78
+ C,
79
+ A,
80
+ B,
81
+ sleep_time,
82
+ force_belapsed,
83
+ reference,
84
+ comment:: String , # `comment` is a place to put the library name, the dimensions of the matrices, etc.
77
85
) where {F}
78
86
maybe_sleep (sleep_time)
79
87
t0 = @elapsed f! (C, A, B)
80
- isnothing (reference) || @assert C ≈ reference
88
+ if (reference != = nothing ) && (! (C ≈ reference))
89
+ msg = " C is not approximately equal to reference"
90
+ @error (msg, comment)
91
+ throw (ErrorException (msg))
92
+ end
81
93
if force_belapsed || 2 t0 < BenchmarkTools. DEFAULT_PARAMETERS. seconds
82
94
maybe_sleep (sleep_time)
83
95
br = @benchmark $ f! ($ C, $ A, $ B)
@@ -287,8 +299,18 @@ function runbench(
287
299
last_perfs[1 ] = (:Size , (M,K,N) .% Int)
288
300
for i ∈ eachindex (funcs)
289
301
C, ref = i == 1 ? (C0, nothing ) : (fill! (C1,junk (T)), C0)
302
+ lib = library[i]
303
+ comment = " lib=$(lib) , M=$(M) , K=$(K) , N=$(N) "
290
304
t = benchmark_fun! (
291
- funcs[i], summarystat, C, A, B, sleep_time, force_belapsed, ref
305
+ funcs[i],
306
+ summarystat,
307
+ C,
308
+ A,
309
+ B,
310
+ sleep_time,
311
+ force_belapsed,
312
+ ref,
313
+ comment,
292
314
)
293
315
gffactor = 2e-9 M* K* N
294
316
@inbounds for k ∈ 1 : 4
0 commit comments