A CPU is optimized for performing general purpose instructions that are useful for applications. They can usually do only a few things at a time – maybe a dozen. They are good at reading and writing from arbitrary places in memory, and performing several different mathematical and logical functions on small pieces of data (addition, multiplication, comparison of two values, etc.).
CPUs are also very good at branching: looking at the results of calculations, and doing entirely different things depending on the values (for example: if “lives = 0” then run the “end of game” code, otherwise run the “respawn” code.
On the other hand, GPUs are optimized for executing the same instruction on many different pieces of data. For example, take the square root of each of the one million values in a one thousand by one thousand grid. Usually they are particularly good at floating point arithmetic.
GPUs are optimized to be able to do all these calculations at the same time, taking far less time than a CPU, which can only do a few things at once. On the other hand, if you used a GPU to perform just a few calculations, then based on the results, perform a few other calculations, you would be wasting its capabilities, and it would be quite slow.
Both GPUs and CPUs are “Turing complete”. This means that they can basically doing anything that a computer can do, given enough time and memory. Neither is more capable than the other, in that sense, though each is much quicker than the other doing what it is good at.
Latest Answers