Remove benchmark::internal::Benchmark* from all benchmarks

libeigen/eigen!2332

Co-authored-by: Rasmus Munk Larsen <rlarsen@nvidia.com>
This commit is contained in:
Rasmus Munk Larsen
2026-03-20 17:42:07 -07:00
parent 8115b45e50
commit 9d1e5f3915
32 changed files with 477 additions and 576 deletions

View File

@@ -158,25 +158,9 @@ static void BM_BiCGSTAB(benchmark::State& state) {
state.counters["iterations"] = solver.iterations();
}
static void DirectSolverSizes(::benchmark::Benchmark* b) {
for (int n : {1000, 5000, 10000, 50000}) {
for (int bw : {5, 20}) {
b->Args({n, bw});
}
}
}
static void IterativeSolverSizes(::benchmark::Benchmark* b) {
for (int n : {1000, 10000, 50000}) {
for (int bw : {5, 20}) {
b->Args({n, bw});
}
}
}
BENCHMARK(BM_SimplicialLLT)->Apply(DirectSolverSizes);
BENCHMARK(BM_SimplicialLDLT)->Apply(DirectSolverSizes);
BENCHMARK(BM_SparseLU)->Apply(DirectSolverSizes);
BENCHMARK(BM_SparseQR)->Apply(DirectSolverSizes);
BENCHMARK(BM_CG)->Apply(IterativeSolverSizes);
BENCHMARK(BM_BiCGSTAB)->Apply(IterativeSolverSizes);
BENCHMARK(BM_SimplicialLLT)->ArgsProduct({{1000, 5000, 10000, 50000}, {5, 20}});
BENCHMARK(BM_SimplicialLDLT)->ArgsProduct({{1000, 5000, 10000, 50000}, {5, 20}});
BENCHMARK(BM_SparseLU)->ArgsProduct({{1000, 5000, 10000, 50000}, {5, 20}});
BENCHMARK(BM_SparseQR)->ArgsProduct({{1000, 5000, 10000, 50000}, {5, 20}});
BENCHMARK(BM_CG)->ArgsProduct({{1000, 10000, 50000}, {5, 20}});
BENCHMARK(BM_BiCGSTAB)->ArgsProduct({{1000, 10000, 50000}, {5, 20}});

View File

@@ -33,13 +33,5 @@ static void BM_SparseTranspose(benchmark::State& state) {
state.counters["density%"] = density * 100;
}
static void TransposeSizes(::benchmark::Benchmark* b) {
// Args: {size, density*10000}
for (int n : {1000, 10000}) {
for (int d : {100, 50, 10, 4}) { // 1%, 0.5%, 0.1%, 0.04%
b->Args({n, d});
}
}
}
BENCHMARK(BM_SparseTranspose)->Apply(TransposeSizes);
// Args: {size, density*10000}: 1%, 0.5%, 0.1%, 0.04%
BENCHMARK(BM_SparseTranspose)->ArgsProduct({{1000, 10000}, {100, 50, 10, 4}});

View File

@@ -38,12 +38,4 @@ static void BM_SparseMM(benchmark::State& state) {
state.counters["nnz_B"] = sm2.nonZeros();
}
static void SpMMSizes(::benchmark::Benchmark* b) {
for (int n : {1000, 10000}) {
for (int nnz : {4, 6, 10}) {
b->Args({n, nnz});
}
}
}
BENCHMARK(BM_SparseMM)->Apply(SpMMSizes);
BENCHMARK(BM_SparseMM)->ArgsProduct({{1000, 10000}, {4, 6, 10}});

View File

@@ -52,13 +52,5 @@ static void BM_SpMV_Transpose(benchmark::State& state) {
state.counters["nnz"] = sm.nonZeros();
}
static void SpMVSizes(::benchmark::Benchmark* b) {
for (int n : {1000, 10000, 100000}) {
for (int nnz : {7, 20, 50}) {
b->Args({n, nnz});
}
}
}
BENCHMARK(BM_SpMV)->Apply(SpMVSizes);
BENCHMARK(BM_SpMV_Transpose)->Apply(SpMVSizes);
BENCHMARK(BM_SpMV)->ArgsProduct({{1000, 10000, 100000}, {7, 20, 50}});
BENCHMARK(BM_SpMV_Transpose)->ArgsProduct({{1000, 10000, 100000}, {7, 20, 50}});