Skip to content
ParaCoToUlPublic

About

C++/CUDA library and DSL for efficient cellular automata

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Cellato

Cellato ice cream avatar

CI license C++20 CUDA DOI

Cellato is a C++20 library and embedded DSL for cellular automata. It lets you describe an automaton rule as a type-level C++ expression, then run that same rule through different evaluators, memory layouts, and traversers.

The library is designed around separation of concerns:

Component Role
Algorithm Cellular automaton rule written with the DSL.
Evaluator Per-cell or per-word rule evaluation.
Layout Memory representation such as standard cells, bit arrays, or bit planes.
Traverser CPU or CUDA execution strategy.

This keeps rule definitions independent from performance-oriented choices like packed state storage, bit-plane vectorization, CUDA traversal, and temporal blocking.

Documentation

Start with docs/README.md. The documentation covers:

  • getting started with the CMake build and CLI;
  • defining a custom automaton in examples/your_own_ca;
  • the DSL nodes and bundled automata;
  • layout, evaluator, traverser, and CUDA instantiation details;
  • performance guidance for bit arrays, bit planes, tiled bit planes, and temporal blocking.

Build

Configure and build the default release profile:

cmake --preset release
cmake --build --preset release --parallel 4

CUDA support is enabled when CMake detects a CUDA compiler. To build without the CUDA toolkit or runtime, configure with cmake --preset release -DCELLATO_ENABLE_CUDA=OFF. CPU traversers, layouts, and reference implementations remain available.

Run unit tests:

ctest --preset release

Verification and benchmark builds use separate build directories:

cmake --preset verification
cmake --build --preset verification --parallel 4
ctest --preset verification
cmake --preset benchmark
cmake --build --preset benchmark --parallel 4

Continuous Integration

GitHub Actions runs CPU builds, unit tests, CLI validation, and the standalone example on Ubuntu, macOS, and Windows, covering GCC, Clang, Apple Clang, MSVC, and MinGW toolchains. Checks run on pushes and pull requests, with manual runs also available.

See the CI build matrix for platform and compiler details, including the additional verification build. CUDA compilation and GPU execution are outside CI coverage.

CLI Example

build/release/cellato \
  --automaton game-of-life \
  --device CPU \
  --traverser simple \
  --evaluator standard \
  --layout standard \
  --x_size 8 \
  --y_size 8 \
  --rounds 1 \
  --warmup_rounds 0 \
  --steps 2 \
  --seed 1

This runs the Game of Life automaton on a CPU with a simple traverser, standard evaluator, and standard layout (equivalent to a standard 2D array of cells). The program should end quickly and print a report of the run, including checksum values. Seeded initialization can produce different states with different C++ standard libraries.

Make Your Own Automaton

The examples/your_own_ca directory contains a small application using the Cellato DSL to implement and run a custom cellular automaton.

cmake --preset release -S examples/your_own_ca
cmake --build examples/your_own_ca/build/release --parallel 4
examples/your_own_ca/build/release/your_own_ca

Publications

Cellato builds on the DSL paper and the follow-up work on bit-plane encoding and bitwise vectorization listed below. If you use Cellato in research, please cite the most recent paper on bit-plane encoding and bitwise vectorization.

  • Cellato: a DSL for Cellular Automata based on C++ Template Meta-programming

    BibTeX:

    @article{brabec2026cellato,
      title = {{Cellato}: a {DSL} for Cellular Automata based on {C++} Template Meta-programming},
      author = {Matyáš Brabec and Jiří Klepl and Martin Kruliš},
      journal = {Journal of Object Technology},
      volume = {25},
      number = {1},
      year = {2026},
      month = mar,
      pages = {1:1--13},
      issn = {1660-1769},
      doi = {10.5381/jot.2026.25.1.a13},
      url = {https://www.jot.fm/contents/issue_2026_01/a13.html},
      note = {ECOOP 2025 Workshops}
    }
  • Improving Cellular Automata Performance with Bit-Planes Encoding and Bitwise Vectorization

    BibTeX:

    @article{brabec2026improving,
      title = {Improving cellular automata performance with bit-planes encoding and bitwise vectorization},
      author = {Matyáš Brabec and Jiří Klepl and Martin Kruliš},
      journal = {Parallel Computing},
      volume = {130},
      year = {2026},
      month = dec,
      pages = {103226},
      issn = {0167-8191},
      doi = {10.1016/j.parco.2026.103226},
      url = {https://www.sciencedirect.com/science/article/pii/S016781912600044X}
    }

The linked artifacts contain the replication packages and the versions of Cellato used in each paper.

License

Cellato is released under the MIT License.

About

C++/CUDA library and DSL for efficient cellular automata

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages