COE4590_16_GPU2
COE4590_16_GPU2
(Lecture-16)
Graphics Processing Unit (GPU)
(II Lecture)
BY
ABDUS SAMAD
Threads, Blocks, and Grids
A thread is associated with each data element.
GPU supports 1000s lightweight threads as
compared to CPU which needs only a few heavy
ones.
Threads are organized into blocks.
A whole thread block consists of many elements
which are executed per thread at a time.
Blocks are organized into a grid. Blocks are
executed independently and in any order.
Thread management handled by GPU hardware
not by applications or OS:
How a Thread works?
Example: How many times 6 appear in an array
of 16 elements?
For single threaded operation there is a scan of
16 nos. sequentially and result of match is
counted in a counter.
For a multi-threaded operation lets there are 4
threads.
Each thread will examine 4 elements of thread
running on one GPU.
There is one grid consisting of one block.
How a Thread works?
3 6 7 5 3 5 6 2 9 1 2 7 0 9 3 6
Transfor
m To