@@ -56,7 +56,7 @@ $(TYPEDFIELDS)
5656
5757See the documentation of [Chairmarks.jl](https://github.com/LilithHafner/Chairmarks.jl) for more details on the measurement fields.
5858"""
59- Base. @kwdef struct DifferentiationBenchmarkDataRow
59+ Base. @kwdef struct DifferentiationBenchmarkDataRow{T}
6060 " backend used for benchmarking"
6161 backend:: AbstractADType
6262 " scenario used for benchmarking"
@@ -71,16 +71,16 @@ Base.@kwdef struct DifferentiationBenchmarkDataRow
7171 samples:: Int
7272 " number of evaluations used for averaging in each sample"
7373 evals:: Int
74- " minimum runtime over all samples, in seconds"
75- time:: Float64
76- " minimum number of allocations over all samples"
77- allocs:: Float64
78- " minimum memory allocated over all samples, in bytes"
79- bytes:: Float64
80- " minimum fraction of time spent in garbage collection over all samples, between 0.0 and 1.0"
81- gc_fraction:: Float64
82- " minimum fraction of time spent compiling over all samples, between 0.0 and 1.0"
83- compile_fraction:: Float64
74+ " aggregated runtime over all samples, in seconds"
75+ time:: T
76+ " aggregated number of allocations over all samples"
77+ allocs:: T
78+ " aggregated memory allocated over all samples, in bytes"
79+ bytes:: T
80+ " aggregated fraction of time spent in garbage collection over all samples, between 0.0 and 1.0"
81+ gc_fraction:: T
82+ " aggregated fraction of time spent compiling over all samples, between 0.0 and 1.0"
83+ compile_fraction:: T
8484end
8585
8686function record! (
@@ -91,21 +91,22 @@ function record!(
9191 prepared:: Union{Nothing,Bool} ,
9292 bench:: Benchmark ,
9393 calls:: Integer ,
94+ aggregation,
9495)
95- bench_min = minimum (bench)
96+ bench_agg = aggregation (bench)
9697 row = DifferentiationBenchmarkDataRow (;
9798 backend= backend,
9899 scenario= scenario,
99100 operator= Symbol (operator),
100101 prepared= prepared,
101102 calls= calls,
102103 samples= length (bench. samples),
103- evals= Int (bench_min . evals),
104- time= bench_min . time,
105- allocs= bench_min . allocs,
106- bytes= bench_min . bytes,
107- gc_fraction= bench_min . gc_fraction,
108- compile_fraction= bench_min . compile_fraction,
104+ evals= Int (bench_agg . evals),
105+ time= bench_agg . time,
106+ allocs= bench_agg . allocs,
107+ bytes= bench_agg . bytes,
108+ gc_fraction= bench_agg . gc_fraction,
109+ compile_fraction= bench_agg . compile_fraction,
109110 )
110111 return push! (data, row)
111112end
0 commit comments