Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1344576
added some comments for myself
Sep 4, 2017
6de7a53
some code has finally been added
Sep 5, 2017
51d2696
little bit mroe code
Sep 5, 2017
3cf8bf6
filled in high level function kernUpdateVelocityBruteForce
Sep 5, 2017
5854d68
velocity update pipeline working
Sep 5, 2017
89cd209
flocking rules implemented but behavior seems incorrect
Sep 5, 2017
fbee270
re implemented naive but needs debugging
Sep 5, 2017
1d3f21d
simulation working ish
Sep 5, 2017
15db882
fixed wrapping bug
Sep 7, 2017
3689b50
added pseudocode for 2.a
Sep 7, 2017
1bc4f61
testing kernComputeIndices
Sep 7, 2017
985e055
kernComputeIndices works
Sep 7, 2017
0ef1594
identifyStartEnd works
Sep 7, 2017
452a54e
added function to find grid indices for a point
Sep 7, 2017
8c24d18
need to debug scattered implementation
Sep 8, 2017
ea2b12e
2.1 implementation works
Sep 8, 2017
0ce0187
coherent grid working but the world appears to be ending
Sep 8, 2017
9378f11
fixed minor bug, still doesn't work for coherent
Sep 8, 2017
6c4846c
It would appear that it all works
Sep 8, 2017
fe37c60
Seems to perform fine at low numbers of boids e.g. 5000 or less
Sep 8, 2017
f2f2e84
all implementations work, but coherent grid shows strange behavior to…
Sep 10, 2017
ffea0d3
Preliminary Analysis
Sep 10, 2017
63a8501
more analysis
Sep 10, 2017
009f0e8
Graphs
Sep 11, 2017
65980d6
updated analysis
Sep 11, 2017
e60fac4
Merge remote-tracking branch 'origin/master'
Sep 11, 2017
f5cc4c5
fixed image refs
Sep 11, 2017
82b42a7
formatting
Sep 11, 2017
7f04245
merged in upstream
Sep 11, 2017
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
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,45 @@
**University of Pennsylvania, CIS 565: GPU Programming and Architecture,
Project 1 - Flocking**

* (TODO) YOUR NAME HERE
* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)

### (TODO: Your README)
* William Ho
* Tested On: Windows 7 Professional, i7-6700 @ 3.40 GHz 16.0GB, NVIDIA QuadroK620 (Moore 100C Lab)

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


The machines in Moore 100C seemed to lack a method of video screen capture. Below are screenshots of a simulation of about 7500 boids progressing.

Boid Count: 7500
Implementation: Uniform Grid

![Boids begin movement in small flocks](images/scattered1.PNG)
![Flocks coalesce into larger groups](images/scattered4.PNG)
![Major flock group begins to dominate simulation](images/scattered5.PNG)


The following graphs illustrate performance changes based on changes in parameters. Each graph represents a change in only 1 parameter, and where otherwise specified, baseline simulation parameters are as follows:

Threads per Block: 128

Cell Width: 6.0f

Number of Boids: 5000

Grids Queried: 8

This Flocking Boids project showcases 3 implementations of flocking behavior:

A naive approach that checks each boid against each other boid and two uniform grid approaches(scattered and coherent). The second uniform grid approach preprocess position and velocity into buffers to optimize memory access (coherent uniform grid). The coherent uniform grid out-performs the scattered uniform grid by minimizing cache misses, and lowering the number of global memory reads that are required per thread.

![Graph 1](images/fpsOverBoidNumber.PNG)
Here, we can clearly see the difference in how our implementations can scale. Uniform grid implementations are intended to be more efficient than a naive approach because they cull unnecessary comparisons. Of course, the trade off is the overhead of building the grid data structure, and at low numbers of boids, this cost actually out weighs the benefits. But it is clear that to quickly simulate orders of magnitudes of more boids, a uniform grid is necessary.

![Graph 2](images/fpsOverThreads.PNG)
In this project, block size did not appear to create significant performance differences. Our naive implementation benefited modestly from higher numbers of threads.

![Graph 3](images/fpsOverCellWidth.PNG)
Changing grid cell width comes with its tradeoffs. Smaller grid cells require more overhead to store and maintain the uniform grid data. Working in 3 dimensions, such memory requirements could balloon. Larger grid cells, on the other hand, are likely to contain more boids, and do not cull as effectively.

![Graph 4](images/fpsOverGrids.PNG)
Unsurprisingly, the benefit of scanning only 8 grid cells instead of 27 is significant.
Binary file added images/fpsOverBoidNumber.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/fpsOverCellWidth.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/fpsOverGrids.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/fpsOverThreads.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/scattered1.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/scattered2.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/scattered4.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/scattered5.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading