GPU Programming

How does the GPU SIMT (single instruction, multiple threads) model differ from CPU SIMD instructions?

  1. ASIMT applies many instructions to one datum; SIMD applies one instruction to one datum
  2. BSIMT and SIMD are exactly the same with different names
  3. CIn SIMT each thread can be written as an independent program and the hardware handles branches; with SIMD the programmer or compiler explicitly uses fixed-width vector instructions
Show answer and explanation

Answer: C. In SIMT each thread can be written as an independent program and the hardware handles branches; with SIMD the programmer or compiler explicitly uses fixed-width vector instructions

CPU SIMD applies one instruction to a vector register holding 4 or 8 data items, so programs are written with the vector width in mind. With GPU SIMT the programmer writes ordinary code for a single thread, and the hardware bundles 32 threads to execute in lockstep. Threads may branch differently; the hardware executes the divergent paths one after another, though efficiency drops when it does.

  • A. Both apply one instruction to multiple data.
  • B. They differ in programming model and branch handling.
  • C. Correct. Execution is lockstep inside, but the programming model differs.
Practice this topic Back to topic

More GPU Programming questions

  1. Within one warp, a conditional branch sends half the threads to the if path and half to the else path (warp divergence). How is this generally executed?
  2. Both (1) and (2) above make half the threads run A and the other half run B. Which is correct about warp efficiency (32 threads per warp)?
  3. Which describes memory coalescing on a GPU?
  4. With i as each thread's index, reading the array every 32 elements as above is slower than reading a[i]. What is the main reason?
  5. When processing particle data with positions x, y and z on a GPU, which layout is better for memory coalescing?