Lecture 2

Learning objectives

After this class, you should be able to:

  1. Explain how a CUDA program is compiled.
  2. Explain the purpose of the following variables, APIs, and keywords: blockIdx, blockDim, threadIdx, cudaMalloc, cudaFree, cudaMemcpy, __global__, __device__, __host__, cudaThreadSynchronize.
  3. Explain how multiple threads on the GPU are partitioned into blocks and used to perform data parallel computation.
  4. Use the above features to write simple CUDA programs.

Reading assignment

  1. Read the UIUC Lec-2 slides.
  2. Search online for information on cudaMallocHost and cudaFreeHost.

Exercises and review questions


Last modified: 12 Jan 2014