Simulator of GOL(Game of Life) with Python on both cpu and gpu(cuda)
pip install GOL_Simulator
If numba.cuda
is avaliable for you, use from GOL_Simulator.gpu import Simulator
(or cpu if you like it).
Otherwise you can use from GOL_Simulator.cpu import Simulator
only.
(all API are the same between gpu
and cpu
)
run cpu_example.py to get cpu_result.png which is a randomly (with all cells 95% probability to be dead and 5% to be alive) initialized 1000x1000
state after 200
iterations.
run gpu_example.py to get gpu_result.png which is the state in cpu_result.png (actually it reads the state from this picture) after another 2000
iterations.