num_branches = 1024
bhist_iterations = 10000
branch_tests = []
for size in [2**n for n in range(12)]:
# This rule compiles a file and can be run in parallel
benchmark = compile_local_ubench_zig(
name=f"directional_branch_history_{size}",
compiler_path=compiler_path,
benchmark_path=branch_hist,
ubench_parameters={
"INNER_ITERATIONS": size,
"ITERATIONS": bhist_iterations,
"NUM_BRANCHES": num_branches,
},
compiler_target=cpp_compiler.as_ref,
)
bench_bin = benchmark.get_outputs()["binary"]
# This is a test that benchmarks the local system, and should exhibit no parallelism, to avoid crosstalk
bench = local_benchmark(
name=f"directional_branch_history_{size}_local",
profiler_path=profiler_bin,
benchmark_path=bench_bin,
metadata={
"BRANCHES_OBSERVED": size * num_branches * bhist_iterations,
"HISTORY": size,
},
)
branch_tests.append(bench)
dbh = test_group(name="directional_branch_history_sweep", tests=branch_tests)
ftcg = test_group(name="all_frontend_tests", tests=[dbh.as_ref])