Hands-on Labs

The purpose of these hands-on labs is to help you learn CUDA programming concepts and gain CUDA programming skills. The manual includes an introductory lab, followed by several well-known problems like matrix-matrix multiplication, vector reduction, and MRI. The purpose of each lab is to reinforce one or several CUDA programming skills and concepts. To help students learn special performance tuning techniques for CUDA, we added an appendix describing several well-known techniques, such as tiling, loop unrolling, data pre-fetching, etc.

Please make sure you meet the software requirements before continuing with these hands-on lab exercises.

The lab manual for this short course includes the following hands-on lab exercises and additional information:
  • Lab 0: Environment Setup and Job Dispatch
  • Lab 1.1: Matrix-Matrix Multiplication
  • Lab 1.2: Vector Reduction
  • Lab 2.1: Matrix-Matrix Multiplication with Tiling and Shared Memory
  • Lab 2.2: Vector Reduction with Unlimited Input Elements
  • Lab 3.1: Matrix-Matrix Multiplication with Performance Tuning
  • Lab 3.2: MRI with Performance Tuning
  • Appendix I: CUDA Performance Tuning Techniques
  • Appendix II: Useful References
For students with different levels of understanding of CUDA programming, we provide six (6) hands-on labs from basic programming know-how to performance tuning. Labs 0, 1.1 and 1.2 are included in the first hands-on lab section. Labs 2.1 and 2.2 are for the second lab section. Labs 3.1 and 3.2 are for the third lab section. Most labs are designed with varying levels of difficulty. We suggest that you choose the difficulty level that best fits your programming skills. You can advance your level of difficulty as time permits.

Solutions to the hands-on lab exercises are provided.

Acknowledgments

The following graduate students from the University of Illinois at Urbana-Champaign contributed to the creation of these lab materials:
  • Nady Obeid
  • John Stratton
  • Ray Sung
  • Xiao-Long Wu
We thank you for your generous contributions to this course!