mewais
mewais

Reputation: 1347

how does Multithreading in GPUs work?

How does a GPU handle multithreading ??

In CPUs for example there will be independent copies of the Register File for each thread. But with large register files as in GPUs that will be impossible. So how does GPUs handle threads ?? Do they fit them in the same register file ? What if some registers are used in more than one thread ? How does that work ?

Upvotes: 2

Views: 13436

Answers (1)

Greg Smith
Greg Smith

Reputation: 11549

NVIDIA GPUs have 1-4 warps schedulers per streaming multi-processor (SM). Each SM warps scheduler has a local register file. Warps are allocated to a warp scheduler and registers are allocated from the register file. The allocation lasts the for the lifetime of the warp. On each cycle each warp scheduler picks an eligible warp (not stalled) from it's active warp list and issues 1-2 instructions (CC <= 2.0 can only single issue).

This differs from SMT CPUs which have separate copies of some resources, but share the front end and execution paths. Intel CPUs supporting HyperThreading can dispatch instructions from both hardware threads each cycle depending on arbitration of the dispatch ports.

Upvotes: 5

Related Questions