Toggle Dark-Mode
GPU Architecture
Good
Bad
Worst
GPU Architecture
Good
2 first warps would do branch
a
the third one would do branch
b
if
(ID
<
64
)
a
else
b
Bad
only one instruction can run on a warp (32 of threads), meaning branch
a
would run only on 1 thread wasting 31 threads branch
b
would be run on 31 threads and wasting 1 thread
if
(ID
==
0
)
a
else
b
Worst
worst case, wasting half of threads in multiple warps!!
if
(ID
%
2
==
0
)
a
else
b