CPU are general purpose calculator. It is excellent at nothing, but also bad at nothing.
GPU are specialised calculator. It is excellent at graphic stuff, and bad as a general purpose calculator.
The reason is simple: graphic is a set of instructions that repeat itself alot, so it is worth to combine many standard instructions into one single one and super optimise that function. Since this function will be used only in this context, they can sacrifice the flexibility of it for the gain of speed.
As a wrong example, it’s like if you had to calculate the volume of a polygon. The CPU would do it the hard way, like you would do it by hand. But the GPU would have a “gimme the 3d coordonates and I will tell you the volume” function. So the GPU you throw in the 3d points, it use it’s super optimised function (maybe even get help from some look up tables), and return the result in a fraction of the time it would normally take for a CPU.
Also, a CPU will have a few cores, while a GPU now have often several thousands of cores. They are slower, so you have to split the problem in many small pieces. Which is fine for a 3d image: it’s full of polygon, just send a few thousands at a time to be processed. A cpu may do each faster, but can’t compete at all with the thousands of the other.
Another thing that a GPU is good at: sorting matrix. Feed it a list, here come a sorted one. A CPU do not have such function. Reason being, a GPU deal with that. Alot.
But… Thousands of slow cores… It also mean that each result take more time to come out. For a single, simple task, the CPU will most likelly do it faster: it’s single core performance is higher for general purpose use. And sometime by a big margin! However, if you have thousands of repetitive tasks that can be done in parallel, then the GPU will probably beat it.
Latest Answers