Timing Operations in CUDA
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.
- Students will be able to time CUDA code and experiment with various data operations and problem sizes.
- Students will be able to describe the circumstances when using a GPU for general purpose computing is beneficial.
Context for Use
Description and Teaching Materials
You can visit the module in your browser:
or you can download the module in either PDF format or latex format.
Teaching Notes and Tips
References and Resources
Comment? Start the discussion about Timing Operations in CUDA