GPU Programming

CS 179

The use of Graphics Processing Units for rendering is well known, but their power for general parallel computation has only recently been explored. Parallel algorithms running on GPUs can often achieve up to 100x speedup over similar CPU algorithms, with many existing applications for physics simulations, signal processing, financial modeling, neural networks, and countless other fields.

This course will cover programming techniques for the GPU. The course will introduce NVIDIA's parallel computing language, CUDA. Beyond covering the CUDA programming model and syntax, the course will also discuss GPU architecture, high performance computing on GPUs, parallel algorithms, CUDA libraries, and applications of GPU computing. Problem sets will cover performance optimization and specific GPU applications in numerical mathematics, medical imaging, finance, and other fields.

Labwork will require significant programming. A working knowledge of the C programming language will be necessary. Although CS 24 is not a prerequisite, it (or equivalent systems programming experience) is recommended.

9 units; third term.

Instructors/TA's: Parker Won -
Nailen Matschke -
Jordan Bonilla -
  • Piazza Please ask through Piazza if you have a question/issue that likely affects other students.
  • Please send an email to the TA's if you have something that only affects you or your project group.
Supervising professors: Professor Al Barr -

Time and place: MWF 3:00-3:55 PM
Annenberg 105
Office Hours: Jordan Bonilla - Tue. 10 PM ~ 12 PM
Parker Won - Mon. 8 PM ~ 10 PM
Nailen Matschke - Tue. 6 PM ~ 8 PM

104 Annenberg, instructional laboratory
Grading policy: Here is the grading scheme for the class:
  • 6 labs (60% of grade)
  • 4 week project (40% of grade)
All labs will be scored out of 100 and are weighted equally (meaning each lab is worth 10% of your grade). The final project can be completed individually or as a pair.

Homework extensions may be granted if the TA's see it as appropriate. E grades will not be granted except under extreme circumstances.  

Lectures: Week 1 (Introduction), MW Parker, F Nailen
Lecture 1 (Mon. 04/03): PPT PDF
Lecture 2 (Wed. 04/05): PPT PDF
Lecture 3 (Fri. 04/07): PPT PDF
Week 2 (Shared Memory), MW Parker, F Nailen
Lecture 4 (Mon. 04/10): PPT PDF
Lecture 5 (Wed. 04/12): PPT PDF
Lecture 6 (Fri. 04/14): PPT PDF
Week 3 (Reductions, FFT) MW Parker, F Nailen
Lecture 7 (Mon. 04/17): PPT PDF
Lecture 8 (Wed. 04/19): PPT PDF
Lecture 9 (Fri. 04/21): PPT PDF
Week 4 (MRI) MW Jordan, F Nailen
Lecture 10 (Mon. 04/24): PPT PDF
Lecture 11 (Wed. 04/26): PPT PDF
Lecture 12 (Fri. 04/28): PPT PDF
Week 5 (SVD, streaming, etc) MW Jordan, F Nailen
Lecture 13 (Mon. 05/01): PPT PDF
Lecture 14 (Wed. 05/03): PPT PDF
Lecture 15 (Fri. 05/05): PPT PDF
Week 6 (Multi-GPU, etc.) MW Jordan, F Nailen
Lecture 16 (Mon. 05/08): PPT PDF
Lecture 17 (Wed. 05/10): PPT PDF
Week 7 (Recitation and Projects) MW Nailen, F (in-class office hour) TBD
Lecture 18 (Mon. 05/15): PPT PDF
Week 8 (Projects) MW no class, F (in-class office hour) TBD
Week 9 (Projects) MW no class, F (in-class office hour) TBD
Week 10 (Projects) MW no class, F (in-class office hour) TBD

Assignments: Lab 1: assignment text UNIX files Windows files
Lab 2: assignment text UNIX files Windows files
Lab 3: assignment text UNIX files Windows files
Lab 4: assignment text UNIX files Windows files
Lab 5: assignment text UNIX files Windows files
Lab 6: assignment text UNIX files Windows files

Project INFO
Textbook: The CUDA Handbook: A Comprehensive Guide to GPU Programming is recommended but not required. The book is a little more advanced than other CUDA books and might not be very approachable at first, but by the end of the course you should find it to be a valuable reference for both your project as well as any future GPU programming you find yourself doing. Buy through the author's site for a discount.

CUDA Installation Guide
Use this code to retrieve your hardware info after you setup CUDA.

Resources: CUDA C Programming Guide
Mapping from GPU name to Compute Capability

Material from previous year(s): 2015

Less useful, but cool resources: NVIDIA's Parallel Forall Blog
Videos from last several years of NVIDIA's conference on CUDA
How to Write Code the Compiler Can Actually Optimize (2015)
Excellent CPU optimization manuals
What Every Programmer Should Know About Memory
GPU focused systems guide to deep learning