Pause GC during benchmark to reduce noise

This commit is contained in:
Tom Lin 2021-08-28 11:16:19 +01:00
parent 13cb8ffced
commit 41f1767365

View File

@ -260,8 +260,9 @@ function main()
init::Tuple{type,type,type} = DefaultInit init::Tuple{type,type,type} = DefaultInit
scalar::type = DefaultScalar scalar::type = DefaultScalar
(data, context) = make_stream(config.arraysize, scalar, device, config.csv) GC.enable(false)
(data, context) = make_stream(config.arraysize, scalar, device, config.csv)
init_arrays!(data, context, init) init_arrays!(data, context, init)
if benchmark == All if benchmark == All
(timings, sum) = run_all!(data, context, config.numtimes) (timings, sum) = run_all!(data, context, config.numtimes)
@ -289,6 +290,8 @@ function main()
else else
error("Bad benchmark $(benchmark)") error("Bad benchmark $(benchmark)")
end end
GC.enable(true)
if !valid if !valid
exit(1) exit(1)