GPU Programming

Which describes occupancy on a GPU?

  1. AThe fraction of the GPU die area occupied by arithmetic units
  2. BThe ratio of warps actually resident on an SM to the maximum it can hold
  3. CThe fraction of GPU memory filled with data
Show answer and explanation

Answer: B. The ratio of warps actually resident on an SM to the maximum it can hold

Each SM has a maximum number of resident warps, and the number actually resident depends on registers per thread, shared memory per block, block size and so on. That ratio is the occupancy. With low occupancy, few warps are available to run while others wait for memory, so execution units sit idle more often. CUDA provides tools for calculating occupancy.

  • A. It is not about die area.
  • B. Correct. It is determined by register and shared-memory use and similar.
  • C. It is not memory utilization.
Practice this topic Back to topic

More GPU Programming questions

  1. What is the main way a GPU hides long memory latency (hundreds of cycles)?
  2. Which statement about GPU occupancy is correct?
  3. In CUDA, what is the relationship between blocks and SMs (streaming multiprocessors)?
  4. In CUDA, you want to wait mid-kernel for every other block to finish before moving to the next phase. What is the usual approach?
  5. Building a histogram of pixel values on a GPU can be slow if every thread does atomicAdd directly on 256 bins in global memory. What is a good improvement?