tests/benchmarks/bench_all.cpp
// run 10 iterations on a medium sized grid varying the number of workers
run 10 iterations on a medium sized grid varying the number of workers
run 10 iterations on a medium sized grid varying the number of workers
static void BM_VaryingWorkersGrid1000Parallel(benchmark::State &state)
{
    size_t nrows = 1000;
    size_t ncols = nrows;
    auto nsteps = 10;
    unsigned workers = state.range(0);
    auto grid = ca::Grid<int>(nrows, ncols);
    auto update_fn = conways_game_of_life_update_function<int>;
    auto cellaut = ca::par::CellularAutomaton<int>(grid, update_fn, workers);
    for (auto _ : state)
    {
        cellaut.simulate(nsteps);
    }
}
static void BM_VaryingWorkersGrid1000Parallel ( benchmark :: State & state ) { size_t nrows = 1000 ; size_t ncols = nrows ; auto nsteps = 10 ; unsigned workers = state . range ( 0 ) ; auto grid = ca :: Grid < int > ( nrows , ncols ) ; auto update_fn = conways_game_of_life_update_function < int > ; auto cellaut = ca :: par :: CellularAutomaton < int > ( grid , update_fn , workers ) ; for ( auto _ : state ) { cellaut . simulate ( nsteps ) ; } }
run 10 iterations on a medium sized grid varying the number of workers
run 10 iterations on a medium sized grid varying the number of workers