From 5576221571fbbdbccd87efa155268089fccefa2b Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Sun, 24 Nov 2024 10:38:03 +0100 Subject: [PATCH] fix: enable arbitrary benchmark aggregations (#639) --- DifferentiationInterfaceTest/src/tests/benchmark.jl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/DifferentiationInterfaceTest/src/tests/benchmark.jl b/DifferentiationInterfaceTest/src/tests/benchmark.jl index 0b74b0cd3..8e6b1e7e9 100644 --- a/DifferentiationInterfaceTest/src/tests/benchmark.jl +++ b/DifferentiationInterfaceTest/src/tests/benchmark.jl @@ -93,7 +93,6 @@ function record!( calls::Integer, aggregation, ) - bench_agg = aggregation(bench) row = DifferentiationBenchmarkDataRow(; backend=backend, scenario=scenario, @@ -101,12 +100,12 @@ function record!( prepared=prepared, calls=calls, samples=length(bench.samples), - evals=Int(bench_agg.evals), - time=bench_agg.time, - allocs=bench_agg.allocs, - bytes=bench_agg.bytes, - gc_fraction=bench_agg.gc_fraction, - compile_fraction=bench_agg.compile_fraction, + evals=Int(bench.samples[1].evals), + time=aggregation(getfield.(bench.samples, :time)), + allocs=aggregation(getfield.(bench.samples, :allocs)), + bytes=aggregation(getfield.(bench.samples, :bytes)), + gc_fraction=aggregation(getfield.(bench.samples, :gc_fraction)), + compile_fraction=aggregation(getfield.(bench.samples, :compile_fraction)), ) return push!(data, row) end