Skip to content

Project 1: Xiaoxiao Zou #15

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

Open
wants to merge 5 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
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
**University of Pennsylvania, CIS 565: 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)

### (TODO: Your README)
* Xiaoxiao Zou
* [LinkedIn](https://www.linkedin.com/in/xiaoxiao-zou-23482a1b9/)
* Tested on: Windows 11, AMD Ryzen 9 7940HS @ 4.00 GHz, RTX 4060 Laptop

Include screenshots, analysis, etc. (Remember, this is public, so don't put
anything here that you don't want to share with the world.)

## Output
![](images/result.gif)

## Performance Analysis

![](images/boid_count.png)

![](images/block_size.png)

Note: Since I use the title bar to observe the FPS, I am not able to get the accurate data for visualized ones (FPS is fixed there).

Q: For each implementation, how does changing the number of boids affect performance? Why do you think this is?

Changing number of boids significantly impact the performance. As the number of boid increase, the FPS decreases significantly. Since number of boids count will affect number of neighbors each boid need to search around it, the time cost for each neighboring search will increase.

Q: For each implementation, how does changing the block count and block size affect performance? Why do you think this is?

The change of block size almost not influence the performance with boids count 20000 when the block size is larger than 64. When block size is small, the increase of blocks size will improve the performance. Since the block size will change the number of block, when block size is really small, the block counts will become larger. Then, if GPU does not have enough blocks for computing, the performance will get lower.

Q: For the coherent uniform grid: did you experience any performance improvements with the more coherent uniform grid? Was this the outcome you expected? Why or why not?

A: Coherent grid gives slightly better performance compared to scattered grid. Since for scattered grid, it takes a long time to sort the boid every frame, if we also sort the position array, the next round, when we label the boid, it will almost in right order in terms of grid since boid will not travel too far. Then, it takes less time averagely for sorting and accessing the elements on array indices, but longer time to reshuffle two arrays.

Q: Did changing cell width and checking 27 vs 8 neighboring cells affect performance? Why or why not? Be careful: it is insufficient (and possibly incorrect) to say that 27-cell is slower simply because there are more cells to check!

A: 27 cells will not always hurt performance since the overall volume is smaller than 8 cells, when the density went high, the number of neighbors need to be checked for 27 cells is smaller than number of neighbors need to be checked for 8 cells.
Binary file added images/27_8.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/block_size.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/boid_count.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/result.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading