Homework #4

Due: Wednesday, August 2nd, 5:30 PM

We are interested in comparing GPU performance to CPU performance. An nbody simulation that can be performed on both platforms can be found here: hw4.zip. Questions to investigate include:

1.) How does the overhead of a CPU thread compare to a GPU thread? Try to run each program and use profilers to isolate the amount of time it takes to spawn a single thread of each type.
2.) Investigate how changing the block size and number of blocks affect code performance. Is there a relationship between the two?
3.) In class we discussed the effects of caching on both CPU and GPU performance. Investigate the cache performance of these two programs. Try to find cases where the program is causing a significant number of cache misses on both the CPU and GPU and comment on how this affects performance.
4.) Using your answers to the above questions as well as your experience from past labs, try to implement an improvement to the GPU code. Explain how your changes led to an improvement in performance.

Answer all of the above questions, or feel free to come up with your own avenues of investigation. For each question, be sure to include the following in your report:

- What platform(s) were used? (processor speed, cache size, etc. as relevant)
- How did you go about collecting data?
- What raw data did you collect?
- Analyze the raw data with the appropriate statistical method(s) as discussed in class.
- What did you learn from this investigation? Were your results surprising?

Submission Instructions

Submit a single report for your entire group. Please make sure that each group member's name is on the report. You need not turn in the code that you used unless you feel it is particularly relevant to your results (please default to explaining any code modifications in the text of your report). Once your report is finished, please email it as an attachment to dshook@wustl.edu with "Homework 4" in the subject line.