|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Classes | |
| struct | Bench_Result |
| Outcome of one measured anchor benchmark. More... | |
Functions | |
| std::string | compiler_string () |
| Describe the compiler that produced the running binary. | |
| std::string | cpu_string () |
| Read the CPU model name advertised by the host. | |
| std::size_t | resolve_repeats (const std::size_t fallback) |
| Resolve the number of timed repetitions for one anchor. | |
| template<typename Work > | |
| Bench_Result | measure (std::string name, const double processed_cells, std::size_t repeats, Work &&work) |
| Time a kernel with one warmup pass plus a median of timed passes. | |
| void | emit_json (const Bench_Result &result, std::ostream &out=std::cout) |
| Print one benchmark result as a single structured JSON object. | |
|
inline |
Describe the compiler that produced the running binary.
"gcc 13.2.0". Definition at line 80 of file bench_support.H.
References Aleph::blossom_maximum_cardinality_matching().
Referenced by emit_json().
|
inline |
Read the CPU model name advertised by the host.
On Linux the first model name line of /proc/cpuinfo is returned; any other platform (or a missing file) yields "unknown".
Definition at line 100 of file bench_support.H.
References Aleph::and, and Aleph::blossom_maximum_cardinality_matching().
Referenced by emit_json(), and TEST().
|
inline |
Print one benchmark result as a single structured JSON object.
The schema is fixed at {name, wall_ns, cells_per_sec, compiler, cpu} so that perf_gate.py can parse the line with a plain JSON reader. The number fields use decimal (non-exponential) notation for maximum parser compatibility.
| result | the benchmark to serialise. |
| out | destination stream (defaults to standard output). |
Definition at line 199 of file bench_support.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Bench::Bench_Result::cells_per_sec, compiler_string(), cpu_string(), emit_json(), Aleph::CA::Bench::Bench_Result::name, out, and Aleph::CA::Bench::Bench_Result::wall_ns.
Referenced by emit_json(), and main().
| Bench_Result Aleph::CA::Bench::measure | ( | std::string | name, |
| const double | processed_cells, | ||
| std::size_t | repeats, | ||
| Work && | work | ||
| ) |
Time a kernel with one warmup pass plus a median of timed passes.
The callable is invoked repeats + 1 times. The first invocation is an untimed warmup that pages in memory and primes caches; the remaining invocations are timed with a steady clock and their median is reported. A fresh run on every invocation is the caller's responsibility, so engines that mutate state should be constructed inside work.
| Work | nullary callable performing exactly one run. |
| name | stable benchmark identifier echoed into the JSON line. |
| processed_cells | number of cell updates performed by one run; used to derive the throughput figure. |
| repeats | number of timed passes (clamped to at least one). |
| work | the kernel under test. |
Definition at line 156 of file bench_support.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Bench::Bench_Result::cells_per_sec, Aleph::count(), Aleph::median(), Aleph::CA::Bench::Bench_Result::name, and Aleph::CA::Bench::Bench_Result::wall_ns.
Referenced by main().
|
inline |
Resolve the number of timed repetitions for one anchor.
The environment variable CA_BENCH_REPEATS, when set to a positive integer, overrides the per-benchmark default. This lets the orchestrator trade stability for wall time on slow runners without recompiling.
| fallback | default count used when the variable is unset or invalid. |
Definition at line 128 of file bench_support.H.
References Aleph::blossom_maximum_cardinality_matching().
Referenced by main().