Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
bench_wolfram_30_1d.cc
Go to the documentation of this file.
1/*
2 Aleph_w
3
4 Data structures & Algorithms
5 version 2.0.0b
6 https://github.com/lrleon/Aleph-w
7
8 This file is part of Aleph-w library
9
10 Copyright (c) 2002-2026 Leandro Rabindranath Leon
11*/
12
18#include <cstddef>
19#include <cstdint>
20
22#include <ca-engine-utils.H>
23#include <tpl_ca_lattice.H>
24#include <tpl_ca_storage.H>
25
26using namespace Aleph::CA;
27using namespace Aleph::CA::Bench;
28
29namespace
30{
31
33
34} // namespace
35
36int main()
37{
38 constexpr ca_size_t width = 1'000'000;
39 constexpr std::size_t steps = 1'000;
40 constexpr std::uint8_t rule_no = 30;
41
42 Row seed({width}, 0);
43 seed.set({static_cast<ca_index_t>(width / 2)}, 1);
44 const double processed_cells
45 = static_cast<double>(width) * static_cast<double>(steps);
46
47 const Bench_Result result = measure("wolfram_30_1d", processed_cells, resolve_repeats(3), [&]
48 {
50 engine.run(steps);
51 });
52
53 emit_json(result);
54 return 0;
55}
Shared harness for the cellular-automata performance-gate anchors.
int main()
size_t steps
Definition ca-c-api.h:126
Convenience builders for the Phase 3 synchronous engine.
Lattice that adds boundary-aware access on top of a storage.
Synchronous double-buffered engine.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Definition Blossom.H:466
std::size_t resolve_repeats(const std::size_t fallback)
Resolve the number of timed repetitions for one anchor.
void emit_json(const Bench_Result &result, std::ostream &out=std::cout)
Print one benchmark result as a single structured JSON object.
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.
Wolfram_1D_Engine make_wolfram_engine(std::uint8_t rule_no, ca_size_t width)
Build a 1D elementary Wolfram engine of the given width.
std::ptrdiff_t ca_index_t
Signed coordinate component used by lattices and neighborhoods.
Definition ca-traits.H:60
std::size_t ca_size_t
Unsigned size component used for extents and counts.
Definition ca-traits.H:63
Outcome of one measured anchor benchmark.
Out-of-range neighbours behave as if the lattice ended.
Definition ca-traits.H:119
ValueArg< size_t > seed
Definition testHash.C:53
static mt19937 engine
Cellular automata lattice with pluggable boundary policies.
Dense, contiguous storage for cellular automata cells (1D/2D/3D).