Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project 1: Shreyas Singh #40

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
**University of Pennsylvania, CIS 5650: GPU Programming and Architecture,
Project 1 - Flocking**

* (TODO) YOUR NAME HERE
* (TODO) [LinkedIn](), [personal website](), [twitter](), etc.
* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
* Shreyas Singh
* [LinkedIn](https://linkedin.com/in/shreyassinghiitr), [personal website](https://github.com/shreyas3156), etc.
* Tested on: Windows 10, i7-12700 @ 2.1GHz 32GB, T1000 (CETS Lab)
### Boids Flocking Simulation

### (TODO: Your README)
This project is a CUDA-based simulation of the Boids Flocking algorithm, and its performance with respect to parameters like number of boids, and number of threads in each block of the GPU.

![](images//UniformGridScattered.gif)
![](images//NaiveBoid.gif)

### Performance Analysis

* The Naive Neighbor Search algorithm yields the slowest performance that can be explained by the $O(n^2)$ complexity as each boid is evaluated against the other. The Uniform Grid Scattered is more than 5x faster than the Naive Neighbor Search owing to a more refined search space. Moreover, the coherent uniform grid search produces slightly faster results than the scattered version as the boid count was increased beyond 5000, because of the contiguous memory traversal of boid data pointers. These results are consistent across simulations both with and without visualizations.
![](images/FPSvsBoids_Without_Visualization.png)
![](images/FPSvsBoids_With_Visualization.png)

* The performance of all three algorithms remain roughly constant as the block size and block count is increased from 32 to 256, mainly because the scheduling is managed by "warps" of 32 threads each. The coherent uniform grid search has the best performance among the three algorithms which is as expected.
![](images/FPSvsBlockSize_Without_Visualization.png)
![](images/FPSvsBlockSize_With_Visualization.png)

* From the plots above, it is clear that the coherent search algorithm infact offers improved performance because of the efficient memory access of position and velocity data for the boids.

* The number of cells being increased to 27 from 8 cells marginally increases the performance until the boid count is increased beyond 20,000. This is because even though the number of cells to be searched is lesser in the latter case, the search space is still large, meaning more number of boids to search.

![](images/FPSvsBoids_Cells.png)

Include screenshots, analysis, etc. (Remember, this is public, so don't put
anything here that you don't want to share with the world.)
Binary file added images/FPSvsBlockSize_With_Visualization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/FPSvsBlockSize_Without_Visualization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/FPSvsBoids_Cells.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/FPSvsBoids_With_Visualization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/FPSvsBoids_Without_Visualization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/NaiveBoid.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/UniformGridScattered.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading