Skip to content
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
48 changes: 42 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
**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)
* Yiyang Chen
* [LinkedIn](https://www.linkedin.com/in/yiyang-chen-6a7641210/), [personal website](https://cyy0915.github.io/)
* Tested on: Windows 10, i5-8700k @ 3.7GHz, GTX 1080, personal computer

### (TODO: Your README)
## Screenshot and Video

Include screenshots, analysis, etc. (Remember, this is public, so don't put
anything here that you don't want to share with the world.)
![](images/screenShot.png)

![](images/gif.gif)

## Performance Analysis

![](images/boidsNum1.png)

![](images/boidsNum2.png)

![](images/blockSize.png)
(coherent grid, 600000 boids)

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

Answer: Increasing the number of boids will reduce performance. I think it's obvious because more boids means more computation involving searching for neighbors, updating velocities, etc.


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

Answer: When the block size is very small, for example 16 or 32, the performance is bad, and when the block size is bigger than 128, it's almost the same, see the above figure. I think it's because that, when the block size is very small, the block count is large, so it's less parallel, which affects performance.

**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?**

Answer: the more coherent uniform grid is faster. It's the outcome I expected, because it's memory friendly when getting and setting position and velocity array.

**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!**

![](images/neighbor.png)
(coherent grid, 128 block size)

It affects performance. When the boids number is small, 8 neighbor performs better than 27 neighbor. But when the boids number is large, 27 neighbor performs better than 8 neighbor. I think the reason is that: When the boids are sparse in the space, the number of all boids they check in neighbor is about the same but iterating 27 neighbor cost more than 8. When the boids are dense, because the space range of 8 neighbor (double cell width) is larger than 27 neighbor, it will check more boids, affecting the preformance.
Binary file added images/blockSize.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/boidsNum1.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/boidsNum2.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/gif.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/neighbor.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/screenShot.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/video.mp4
Binary file not shown.
Loading