GPU Programming

Which describes CUDA unified memory?

  1. AMemory usable from both CPU and GPU through the same pointer, with data migrating automatically as needed
  2. BThe CPU and GPU physically merged into one chip
  3. CGPU memory made entirely read-only
Show answer and explanation

Answer: A. Memory usable from both CPU and GPU through the same pointer, with data migrating automatically as needed

With unified memory, an allocation can be accessed from both CPU and GPU through the same pointer, and data migrates page by page to whichever side accesses it. Programs become simpler, and data larger than GPU memory is easier to handle. Each migration involves page faults and transfers, though, so for performance, programs issue hints to prefetch data in advance.

  • A. Correct. It reduces the need to write copies by hand.
  • B. It is not about merging chips.
  • C. It is readable and writable.
Practice this topic Back to topic

More GPU Programming questions

  1. When a GPU performs element-wise addition of two large arrays (c[i] = a[i] + b[i]), what mainly determines performance?
  2. Why is double-precision (FP64) performance on many consumer gaming GPUs much lower than single-precision (FP32), for example one thirty-second?
  3. What is a characteristic of the tensor cores (matrix units) in recent GPUs?
  4. In GPU mixed-precision computation, why are multiplications often done in a low precision such as FP16 while accumulation is done in FP32?
  5. Summing the same floating-point data on a GPU gives results whose last digits differ slightly from run to run. What is the most likely cause?