I read this article:
FPGA or GPU? - Evolution continues
And someone added a comment in which he wrote:
Since GPUs are SIMDs, any code with an if-else statement will halve your performance. Half of the kernels will execute the if part while half of the kernels are in standby mode, and then the other half of the kernel will perform else calculations, while the first half of the kernels will be idle.
I do not understand why?
Why use a GPU (ie OpenCL) when using if-elseperformance will be reduced by half?
if-else
, . (, if, - ). " ", , , ., , warp (NVIDIA) wavefront (AMD) " ". ( NVIDIA 32, AMD 64 .)
if
, if-else, - 50% - . : n , 1/n ( warp/wafefront ). , if-else ( switch).
n
1/n
switch
, , , , , warp/wafefront. / / /..., .
Tl; DR: , , /, , , .
Source: https://habr.com/ru/post/1683887/More articles:Get separator output by read_csv in pandas - pythonHide column in jQuery dataTables? - javascriptSkip reading text file header in C - cPossible problems with the Office VSTO add-in - HRESULT 0x80004004 (E_ABORT) - c #difference between fixture and exit in pitein - pythonWhat collection - each spliterator operation iterates over? - javaпереместить вложенный список - listHow to set specific timezone in datepicker using jquery only? - javascriptHow can I get a "smart" sort of strings using Python? - pythonSwift 4 collection of Codable objects - dictionaryAll Articles