4 ms·
GPUs do not actually have control flow. They are SIMD vector processors (Same Instructions Multiple Data). CUDA and OpenCL make this a bit more explicit.
by nix0n 10y ago
GPUs do not actually have control flow.
They are SIMD vector processors (Same Instructions Multiple Data).
CUDA and OpenCL make this a bit more explicit.
- wolfgke 10y ago> GPUs do not actually have control flow. Wrong. Let's look at the instriction set of the AMD GCN3 ISA: > http://gpuopen.com/compute-product/amd-gcn3-isa-architecture-manual/ http://gpuopen.com/compute-product/amd-gcn3-isa-architecture... which links to > http://32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com/wp-content/uploads/2016/08/AMD_GCN3_Instruction_Set_Architecture_rev1.1.pdf http://32ipi028l5q82yhj72224m8j.wpengine.netdna-cdn.com/wp-c... which even has a whole chapter about control flow: "Chapter 4 Program Control Flow".
- deleted 10y ago[deleted]
- andars 10y ago> Wrong. I'd say it's more like "not quite". ~10 years ago, the statement was pretty much correct. GPUs were entirely SIMD, so they couldn't truly branch, but could fake it with predication. Longer branches would involve executing both branches on every thread and only committing the results of the active branch. Modern GPUs can do much better, since individual warps/wavefronts can truly diverge. Within warps, however, it's still a bit of a mess.
- wolfgke 10y ago> ~10 years ago, the statement was pretty much correct. If one looks at the capabilities of CPUs from 10 years ago, one can easily justify similar completely outdated statements for CPUs.
- uiri 10y agoWhile this is correct, it isn't the whole story. GPUs can implement control flow by calculating both results and then throwing away one of them based on a predicate. Also, GPUs typically do have a scalar unit which can perform branching but this is heavily discourage by CUDA and OpenCL due to the performance implications.
- emcq 10y agoCurrent GPUs are not SIMD. They are classic examples of MIMD (multiple instruction multiple data), with multiple concurrent processing units. SIMD is common in vector processing units, but GPUs do more than that at this point. https://en.m.wikipedia.org/wiki/MIMD https://en.m.wikipedia.org/wiki/MIMD