Parallel Computing in the Computer Science Curriculum > Modules > Timing Operations in CUDA

Timing Operations in CUDA

Joel Adams, Calvin College, and Jeffrey Lyman, Macalester College

Summary

The purpose of this document is to teach students the basics of CUDA programming and to give them an understanding of when it is appropriate to offload work to the GPU.

Through completion of Vector Addition, multiplication, square root, and squaring programs, students will gain an understanding of when the overhead of creating threads and copying memory is worth the speedup of GPU coding.

This activity contains three parts, linked below. First there is a short introduction to setting up code in CUDA to run on a GPU. Then you will try running vector addition code on your GPU machine. Lastly, you will experiment with various types of operations and large sizes of arrays to determine when it is worthwhile to use a GPU for general-purpose computing.

Learning Goals

Context for Use

This is an activity that can be completed in a lab or active classroom setting.

Description and Teaching Materials

You can visit the module in your browser:

Timing CUDA Operations

or you can download the module in either PDF format or latex format.

PDF Format: TimingCUDAOperations.pdf.
Latex Format: TimingCUDA.tar.gz.
Word Format: TimingCUDAOperations.docx.

Teaching Notes and Tips

You will need the CUDA development tools installed on a machine with an nVIDIA GPU card that is capable of general purpose computing.

Assessment

No assessment instruments available.

References and Resources

You may want to refer to the nVIDA CUDA developer documentation for more information. This activity is designed to stand on its own, however.

See more Modules »



Comment? Start the discussion about Timing Operations in CUDA