- Lesley Lai
- Tested on: Ubuntu Linux 20.04 LTS, i7-7700 @ 3.60GHz, RTX 2070 (desktop)
This project is a CUDA implementation of Boid, an artificial life program that simulates fishes or birds’ flocking behaviors. Besides the naive brute-force implementation, the project also implements grid accelerating data-structure. The simulation is visualized by OpenGL.
- Starting code adapted from University of Pennsylvania CIS565-Fall-2020 Project 1
This project use CMake as the build system generator and Conan as the package manager. You need to have an up-to-date version of the CMake and CUDA toolkit installed.
You can install Conan through pip
:
$ pip install conanfile.txt # Or pip3 on some linux distributions, use sudo if nessesory
After installing all the tools, build the project with the following command line instructions:
$ mkdir build && cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make
TODO
As Boid is an O(N2) algorithm, we expect the runtime has quadratic growth when increasing the boids count. The benchmark confirmed this expectation:
As expected, the utilization of grid data structure causes fantastic performance improvement, and optimization on memory locality (coherent grid) makes the simulation faster.